|
|
| 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 |
|
|
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?
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: |
|
|
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: |
|
|
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
Vic |
|
| Back to top |
|
 |
|