Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
Differential ADC - ZX 1280

 
Post new topic   Reply to topic    Forum Index -> ZX-1281
Author Message
angad



Joined: 24 Jan 2009
Posts: 9

Posted: 02 March 2009, 22:47 PM    Post subject: Differential ADC - ZX 1280 Reply with quote

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
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR

Posted: 03 March 2009, 3:53 AM    Post subject: Re: Differential ADC - ZX 1280 Reply with quote

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).
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.

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.
Back to top
angad



Joined: 24 Jan 2009
Posts: 9

Posted: 03 March 2009, 10:29 AM    Post subject: Thank You Reply with quote

Thanks for this update.

It would be great if you could suggest a suitable circuit for zx 1280, or if not direct to specific sites where I could find more information.

-Thanks
-Angad
Back to top
spamiam



Joined: 13 Nov 2005
Posts: 666

Posted: 03 March 2009, 17:20 PM    Post subject: Re: Thank You Reply with quote

angad wrote:
It would be great if you could suggest a suitable circuit


Well, this can be done with an op-amp. You would use the op-amp as a "differential" amplifier, or as a "summing" amplifier.

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
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR

Posted: 03 March 2009, 18:19 PM    Post subject: Re: Thank You Reply with quote

spamiam wrote:
Well, this can be done with an op-amp.
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.
Back to top
angad



Joined: 24 Jan 2009
Posts: 9

Posted: 04 March 2009, 19:00 PM    Post subject: Reply with quote

Thank You all again !

Shall try out all the possibilities.

-Angad
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZX-1281 Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group