Hi I'm trying to test the adc on a picf161939. I have followed the adc procedure but its not working. I am measuring an analog value from a pot and sending the adresh and adresl to port c and d with led's on it.
At the outputs of portc and d I am getting a random sequence.
I assume the code is wrong but can't see where I've gone wrong.
PIC16F1939 - problem with adc and pot
At the outputs of portc and d I am getting a random sequence.
I assume the code is wrong but can't see where I've gone wrong.
Code (Text):
- #include <pic16f1939.h>
- #include <xc.h>
- #define _XTAL_FREQ 500000 //1ms delay
- void main()
- {
- PORTC = 0; PORTD = 0;
- LATC = 0; LATD = 0;...