steve langner
Member
Back again in trouble with this basic stuff. Hope some kind guy can explain why this code doesn't work.
I thought ANSEL = 1 caused the selected input to be enabled as analog in an AllDigital environment'
However, the simulator displays the input as digital . So where am I going wrong?
TRISIO = %00000010
ANSEL = 1
AllDigital
GPIO = %00000000
Dim x As Word
main:
Adcin 1, x
GP0 = 1
GP2 = 1
WaitMs x
GP4 = 1
GP5 = 1
WaitMs x
GP0 = 0
GP2 = 0
WaitMs x
GP4 = 0
GP5 = 0
WaitMs x
Goto main
End
I thought ANSEL = 1 caused the selected input to be enabled as analog in an AllDigital environment'
However, the simulator displays the input as digital . So where am I going wrong?
TRISIO = %00000010
ANSEL = 1
AllDigital
GPIO = %00000000
Dim x As Word
main:
Adcin 1, x
GP0 = 1
GP2 = 1
WaitMs x
GP4 = 1
GP5 = 1
WaitMs x
GP0 = 0
GP2 = 0
WaitMs x
GP4 = 0
GP5 = 0
WaitMs x
Goto main
End