This works for 10-bit A/D on an 18F2520, using 9600 baud serial to a PC to view the results.
Code:DEFINE OSC 40 SerPin VAR PORTC.6 DEFINE ADC_BITS 10 ; 10-bit results ADCON2.7 = 1 ; right justify ADval VAR WORD Main: ADCIN 0, ADval SEROUT2 SerPin, 84,[DEC ADval,13,10] PAUSE 500 GOTO Main
Bookmarks