OSCCON = %01110000
ADCON0 = %10000001
ADCON1 = %00010000
ANSEL = %01110111
ANSELH = %00001100
TRISA = %00000111
TRISB = %00110000
TRISC = %00000111
Define ADC_CLOCK = 3
Define ADC_SAMPLEUS = 50
Dim a2d_0 As Word
Dim a2d_1 As Word
Dim a2d_2 As Word
Dim i As Byte
Define SEROUT_DELAYUS = 5000
WaitMs 1
For i = 20 To 0 Step -1
Adcin 0, a2d_0 'get the voltage from a2d_0
WaitMs 5
Serout PORTC.6, 9600, "FIRST: ", a2d_0, CrLf
WaitMs 5
Adcin 1, a2d_1 'get the voltage from a2d_1
WaitMs 5
Serout PORTC.6, 9600, "SECOND: ", a2d_1, CrLf
WaitMs 5
Adcin 2, a2d_2 'get the voltage from a2d_2
WaitMs 5
Serout PORTC.6, 9600, "THIRD: ", a2d_2, CrLf
Next i
End
PIC16F690 8MHZ INTERNAL OSC
Hello cant get the ADC result what am i missing any idea ?
regards
mastero
ADCON0 = %10000001
ADCON1 = %00010000
ANSEL = %01110111
ANSELH = %00001100
TRISA = %00000111
TRISB = %00110000
TRISC = %00000111
Define ADC_CLOCK = 3
Define ADC_SAMPLEUS = 50
Dim a2d_0 As Word
Dim a2d_1 As Word
Dim a2d_2 As Word
Dim i As Byte
Define SEROUT_DELAYUS = 5000
WaitMs 1
For i = 20 To 0 Step -1
Adcin 0, a2d_0 'get the voltage from a2d_0
WaitMs 5
Serout PORTC.6, 9600, "FIRST: ", a2d_0, CrLf
WaitMs 5
Adcin 1, a2d_1 'get the voltage from a2d_1
WaitMs 5
Serout PORTC.6, 9600, "SECOND: ", a2d_1, CrLf
WaitMs 5
Adcin 2, a2d_2 'get the voltage from a2d_2
WaitMs 5
Serout PORTC.6, 9600, "THIRD: ", a2d_2, CrLf
Next i
End
PIC16F690 8MHZ INTERNAL OSC
Hello cant get the ADC result what am i missing any idea ?
regards
mastero