'16F886 and 16F88
AllDigital
Define SIMULATION_WAITMS_VALUE = 1
Define LCD_BITS = 4
Define LCD_DREG = PORTB
'Define LCD_DBIT = 8
Define LCD_RSREG = PORTB
Define LCD_RSBIT = 3
Define LCD_EREG = PORTB
Define LCD_EBIT = 2
Define LCD_RWREG = PORTB
Define LCD_RWBIT = 1
Dim adcv0 As Word
TRISA = 1 'RA0 (AN0) is input
TRISB = 0 'PORTB is output
ANSEL = 0x01
'Initialize the A/D converter
ADCON1 = %00000001 'Make AN0 analog inputs,
'make reference voltage = VDD
ADCON0 = %11000001 'A/D clock is internal RC, select AN0
Lcdinit
loop:
Lcdcmdout LcdLine1Home
Adcin 0, adcv0
Lcdout "adc test=", #adcv0, " "
Goto loop
End