This is for a different chip but it might help. I like dealing with the registers directly, an example of both are here.
http://www.picbasic.co.uk/forum/show...9694#post79694
This is for a different chip but it might help. I like dealing with the registers directly, an example of both are here.
http://www.picbasic.co.uk/forum/show...9694#post79694
Dave
Always wear safety glasses while programming.
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
DT
Thanks to all...
I will try the code and I will reply!
Stefano
Bookmarks