Hi everyone:
One question what would I read if a digital input i aplly -5v ?
the second one would I be able to read negative values with ADC ?
Thanks a lot, sorry for the questions but I am still learning...
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
Posted: Wed Jun 13, 2007 1:40 pm
If you REALLY pull the PIC pin down to -5V you will probably destroy the PIC. Fortunately the PIC pins have protection diodes to make this difficult. Read about "Input Protection" or "Protection Diodes" on the datasheet. Also read Microchip application note AN521 to see what can be done with these diodes.
To read negative voltages on an A/D pin you need to convert the voltage to positive. Often this is done cheaply by connecting two equal resistors (maybe 1K) in series from the negative signal to the A/D +5V supply. Then a -5V signal gives 0V to the A/D, a 0V signal gives +2.5V, and +5V gives +5V. _________________ The search for better is endless. Instead simply find very good and get the job done.
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
Posted: Thu Jun 14, 2007 4:24 pm
Check out the electrical specifications for the part you are using. Most of them state that an input LOW can be VSS-0.3V. You can't measure a negative voltage, directly, with the ADC. If you're not sure about something, read the specification sheet first!
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum