Hi, I am trying to use the 16f88 ability for read analog voltages. I need to use analog inputs RA0-RA3. My initial settings are as follows:
ANSEL = %00001111 'set RA0-RA3 as analog inputs
ADCON1 = %10000000 'Right Justifies 10-bit value
OSCCON = $60 'Sets the internal oscillator to 4 Mhz
DEFINE ADC_BITS 10 ' Sets the number of bits in the result to 10
ti var byte
ti = 50 '50 MILLISECONDS DELAY'
A var word ‘ A,B,C and D as variables
B var word
C var word
D var word
TRISA = %00001111
TRISB = 0 ‘Turn PORT B as outputs
I am using RA5 as my communication out to the LCD. (Internal clock). I am using also the 8 pins Portb for controlling two steps motors. Problem here is that if I ground the input pins (just for testing) I should get zero voltages and I don’t. I am using a 1K resistor to ground. For sure I am missing something here. Please advice.
Bookmarks