Hi,
I'm confused.
Please give a signal flow diagram with description.
****
You speak about RF...but the ADCs are for 1Msmpl/s only.
I doubt that the ADC input really is RF...so what is it really?
Then you spaek about simultaneously data acquisition and processing.
You can't process them simultaneously, because the ATmega128 is no dual core processor. You need to process one after the other.
Theoretically you could do simultaneous sampling. But then I assume you need to do a soft-SPI with two data channels.
But is this really necessary? If the ADC inputs change relatively fast, then a LCDisplay is not very useful because your brain can't process much more readings than 3 in a second.
Then the formula isn't optimized for an 8 bit microcontroller.
If you square a 12 bit vlaue, the the result will be a 24 bit value.
Why don't you avoid the squaring by: returnloss = 20 × log(Code_F / Code_R)
Klaus
I assume the ADC input is very low frequency... and thus they can be treated like DC voltage? Is this true?and then the put of RF detector is an analog voltage which goes into two 12-bit ADCs sampling at 1MSPS.
I tried to input "a little" into my calculator, but it didn´t accept it.A little delay can be acceptable
You need to specify what means "real time" for you.but I want to process return loss equation in real-time.
Yes, the ADC input can be treated as DC voltage. It should not fluctuate at one particular frequency (when the knob is not moving). The input to ADC is from 4V max to 4mV minimum. Moving when the knob is moving.I assume the ADC input is very low frequency... and thus they can be treated like DC voltage? Is this true?
****Why 1MSmpl/s?
An ATMega can hardly do this.
Knob rotation from 1V to 11V in 10-15 seconds. Displaying one result in one second on LCD will do the job too.I tried to input "a little" into my calculator, but it didn´t accept it.
"A little delay" can be 1° of your 5GHz signal, which is just 0.55ps...I assume this is not what you need.
Maybe you should give some values with units.
****
As mentioned above. From real-time, I meant knob rotation from 1V to 11V in 10-15 seconds. Displaying one result in one second on LCD will do the job too.You need to specify what means "real time" for you.
If the ADC_input signals are fluctuating (synchronously to each other) then you need to specify this (frequency or dv/dt)....and the max tolerable error caused by this.
Soft-SPI:
Software SPI (in opposite to hardware SPI).
The AVR internal SPI can´t work with two ADCs in parallel.
The only way I see (if you really need this) is to "emulate" the SPI function with software. A lot of code. No precise timing. Try to avoid it.
Yes, that's all I need to do. But, I think I need to select another ADC which can work for this application. As 1MSPS seems quite a lot for ATmega128 MCU. Can you please recommend an ADC for this application?***
DSP structure:
A big phrase. But a small task in your case:
ADC-sampling, dividing, logarithm...
****
Please understand:
As long as you move the knob: you don´t need high resolution, nor high precision. Jou just want to see if the value goes up, down or doesn´t move.
But I assume when the knob is not moved you want precise values.
This can be optimized by using low pass filters - either analog or digital. No big deal.
Klaus
ATmega can't process ADC data at MS/s. Considering the respective calculations, you'll rather end up at kS/s or below. That's no principle problem for the application, VCO scan speed has to be adjusted appropriately. Not sure if the application requires a particular scan speed respectively measurement points per second.
I see that ATmega hardware SPI doesn't allow exact simultaneous sampling with the chosen ADCs. There are several solutions depending on the effective sampling rate, e.g. using a different ADC type, analog S/H, low-pass filters for quasi simultaneous sampling, mentioned soft SPI.
If you update the display once per second, then an ADConversion once per second could be sufficient.Because I was wondering if the data will be sampled and processed quickly enough, keeping in mind the knob rotation from 1V to 11V in 10-15 seconds.
I'd start with the AVR internal ADCs.Can you please recommend an ADC for this application?
For non-fluctuating input signals the lowpassfilter does nothing. It won't modify the signal.Do I still use low-pass filters when there are no fluctations (knob being stationary)?
I'm referring to level translation for the SPI interface.
Matching the analog input voltage is another thing, but usually performed by simple resistor networks.
I'm referring to level translation for the SPI interface.
Matching the analog input voltage is another thing, but usually performed by simple resistor networks.
Hi,
If you update the display once per second, then an ADConversion once per second could be sufficient.
For sure I'd use multiple samples to reduce noise...but I personally think that 1MSmpl/s gives no benefit.
Instead of two ADCs I'd go for a single ADC with multiplexed input. You could go for two conversions within 10us. The deviation in time and the resulting deviation in voltage should be no problem. Especially when the knob is not moved.
Are you sure you need an external ADC? Isn't the AVR internal 10 bit ADC enough?
Did you consider to use V_F as ADC_Vref .... and V_C as ADC input? (Only possible if always: V_F >= V_C)
Then you need a single cinversion only (where both channels are treated simultaously) and the result is the quotient of both...so you save processing time. Additionally you always get a good resolution fir the quotient.
I'd start with the AVR internal ADCs.
For non-fluctuating input signals the lowpassfilter does nothing. It won't modify the signal.
But since (in my eyes) the LPF makse sense when the knob is moved...I'd use it. No need to switch it off.
Klaus
Hi,
3.3V vs 5V:
Why not run the ATMega with 3.3V?
Klaus
Hi,
ATmega128 can run from 4.5 - 5.5V (written in datasheet). I have also ordered the evaluation kit of ATmega128 MCU. Therefore, I do not want to change MCU, but I can change ADC.
I was just ready about this ADC:
https://www.analog.com/en/products/analog-to-digital-converters/ad7091r-2.html#product-overview
It seems AD7091R-2 is a two channel 12-bit ADC. Seems nice and has SPI support too. But again, it also has 1MSPS which we do not need.
Hi,
ATmega128 can run from 4.5 - 5.5V (written in datasheet). I have also ordered the evaluation kit of ATmega128 MCU. Therefore, I do not want to change MCU, but I can change ADC.
I was just ready about this ADC:
https://www.analog.com/en/products/analog-to-digital-converters/ad7091r-2.html#product-overview
It seems AD7091R-2 is a two channel 12-bit ADC. Seems nice and has SPI support too. But again, it also has 1MSPS which we do not need.
- - - Updated - - -
It also can be operated on 5V voltage which is same with ATmega128
Hi,
A riddle.... What SP4T switch are you talking about?
Usually an analog switch has logic inputs...and no logic outputs.
And often the analog inputs work with TTL input levels.
So it is happy with the output levels from a 3.3V supplied CMOS device like the AVR.
You (as well as every electronics designer) need to read datasheets:
At the SP4T datasheet look for: V_IL and V_IH.
And at the AVR datasheet look for V_OL and V_OH.
Usually you find them in the specification tables for "I/O"s. No need to read the complete datasheet for these informations.
Klaus
Sure, if you don't need true simultaneous sampling.Can I use this ADC mentioned above?
Sure, if you don't need true simultaneous sampling.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?