piclist 2007\06\24\005624a
>
Thread:
ADC broken
www.piclist.com/techref/microchip/ios.htm?key=adc
BY
:
Jinx email (remove spam text)
> Is there any way to detect this block is not working properly
> before start working with it??
If you don't have access to an oscilloscope or analyser the
easiest way might be with LEDs. Put a pot on the analogue
input, divide the result by 4 (right-shift twice) and send that
to PortB, which has an LED on each pin (use resistors with
a high enough value to stay safe wrt the port current). When
Vin = Vref- all the LEDs should be off, displaying in binary
up to all on as you increase Vin
Just follow the set-up (ADCON0, ADCON1, TRISA,
TRISE etc) and sampling steps in the manual. Usually not
too much trouble to get the ADC going
Don't forget that the result registers are in different banks,
ADRESL is in Bank1, ADRESH in Bank0
Voltage into a pin should not be lower than 0.6V or it'll pop,
possibly also destroying other parts of the PIC. Protect it
with a Schottky diode (anode to 0V, cathode to pin), which
limits the voltage below 0V to about -0.3V. Perhaps even
a litle series resistance (470R ?) from the source to the pin,
or buffer the input with an op-amp. Or even all three if the
PIC is in a noisy environment (relays/solenoids going off,
RF, EMF etc)
<00ff01c7b61b$ec949080$0100a8c0@ivp2000> 7bit
See also: www.piclist.com/techref/microchip/ios.htm?key=adc
Reply
You must be a member of the
piclist mailing list
(not only a www.piclist.com member) to post to the
piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
month overview.
new search...