Re: 16F819 config for A/D
Hi. I've used this routine many times without a problem Try it.
OSCCON = $70 '8mhz
adcon1 = 7 'set inputs to all digital - adcin command will convert individual input to analog
@ DEVICE MCLR_ON, INTRC_OSC, WDT_ON, LVP_OFF, BOD_OFF, PWRT_ON, PROTECT_ON
'declare bit, byte, word variables here
TRISA = %00000011 'set RA0/1 to inputs, all others to outputs
TRISB = %00001111 'out,out,out,out,in,in,in,in
Clear 'RESET ALL VARIABLES UPON POWERUP
Pause 100 'SETTLE DOWN
'ADCON1.7 = 1 'RIGHT JUSTIFY RESULT on word variables - not needed for bytes
start:
ADCIN 0,(your variable)
Re: 16F819 config for A/D
Thanks! That's got it up and running, Cheers Pete