Hi,
I am using ZX 1280 to measure differential voltage. Port F has all the +ve signals and port K has all the -ve signals. The range of +ve signal is from -3V to +3V.
I tried the test_diff_adc.bas by changing the pin numbers in the for loop, but I could not comprehend the steps and was not able to further modify it to my application.
If possible, please put down the steps for differential ADC in zx 1280 using port F and port K (+ve signals on F and -ve signals on K).
Thank you.
- angad
Differential ADC - ZX 1280
Re: Differential ADC - ZX 1280
The short answer is that what you've asked for can't be done. Moreover, you may damage the ZX-1280 by applying negative voltages to it.angad wrote:If possible, please put down the steps for differential ADC in zx 1280 using port F and port K (+ve signals on F and -ve signals on K).
If you need to measure voltages in the -3V to +3V range, you'll have to add external circuitry to shift the range to be no lower than 0V and scale the range so that the upper voltage is no more than Vcc.
Secondly, you need to read the ATmega1280 datasheet to learn which ADC input combinations are supported in differential mode. Only 44 of the 240 possible combinations are supported and some of them are different gain settings (1X, 10X, 200X) for the same pair of inputs.
Once you've decided which combination(s) to use, it is fairly simple to modify the previously posted code to set the ADMUX register bits as needed. Note that for some combinations, you also need to set a bit in the ADCSRB register (MUX5). The other 5 bits (MUX4..MUX0) are in the ADMUX register.
- Don Kinzer
Re: Thank You
Well, this can be done with an op-amp. You would use the op-amp as a "differential" amplifier, or as a "summing" amplifier.angad wrote:It would be great if you could suggest a suitable circuit
The difficulty is the fact that the standard op-amp circuit runs on a positive AND A NEGATIVE voltage supply. Inputs below the negative voltage supply are problematic, and this is why I said that a summing amplifier might be preferable if you are using a single sided supply.
In its simplest form, you would set up the op-amp as a voltage follower, and the input would be the "sum" of the two voltages in question. They would go to the non-inverting input through identical resistors. The output would go back to the inverting input.
If you need to add gain, then you would need to run the feedback through a resistor to the inverting input, and also have ground going to the inverting input through a resistor as well. The gain is defined as a function of the ratio of those two resistors.
Now, the sum is NOT a differential, but you may be able to work with the sum instead of the difference.
If you are likely to have a negative value to the sum, then you would need to use a reverse biased diode from the inverting input to ground to limit the negative excursions.
I have had good luck with the MCP602 and MCP604 for rail-to-rail, single sided supply applications.
ADDENDUM:
To get a true differential of the inputs without having a negative supply,I think you could offset each of the inputs with the + voltage supply. Then feed each of these into an op-amp in differential mode. I bet there are more effective ways to do this, but I am not sure.
-Tony
Re: Thank You
Or two, perhaps. A useful information source about op amps is Op Amps For Everyone. In particular, it describes the differential amplifier and summing amplifier, both of which you may need. Another source is the Handbook of Operational Amplifiers.spamiam wrote:Well, this can be done with an op-amp.
- Don Kinzer