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
Preferred method to attach to ADC pin

 
Post new topic   Reply to topic    Forum Index -> ZX-24
Author Message
victorf



Joined: 01 Jan 2006
Posts: 342
Location: Schenectady, New York

Posted: 14 January 2006, 2:42 AM    Post subject: Preferred method to attach to ADC pin Reply with quote

I have a simple voltage divider circuit on the 12V battery line on a PCB:

+!2V -> 8.06K -> 4.02K -> GND

An ADC pin is attached to the junction between the two resistors. I wish to periodically measure the battery voltage and turn on a Low Battery LED when the voltage drops to a fixed value.

My question is how do I set the input port. Should I use zxInputTriState or zxInputPullUp? Why? Question

Any enlightenment will be appreciated.

Vic
Back to top
dkinzer
Site Admin


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

Posted: 14 January 2006, 6:18 AM    Post subject: Reply with quote

Using zxInputTriState would be the preferred method in this case. If you were to use zxInputPullup, the effective circuit would be different and the result would be affected.

To see the effect, draw the voltage divider with 12 volts applied to the top and then add a 40K or so pullup to +5. Now, do a circuit analysis and calculate the voltage at the junction of the three resistors. Do the same analysis without the pullup to +5. The answer will be different.
Back to top
victorf



Joined: 01 Jan 2006
Posts: 342
Location: Schenectady, New York

Posted: 14 January 2006, 11:45 AM    Post subject: Reply with quote

I appreciate your response. As you must know, I am NOT an electronics wiz.

I tried your analysis just to see how it works and I understand why to tri-state.

Thanks Very Happy

Vic
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZX-24 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