PDA

View Full Version : ADC Config



TrevorDawes
- 18th April 2010, 16:01
Hi all, I am new to the PIC world and I am pulling the hair out of the old bald head. Can someone point me to a ADC example that includes the ADCON setup on a PIC18F4620.

rsocor01
- 18th April 2010, 16:46
TrevorDawes,

Do a search in this forum. I did a quick search and found many results for what you are looking for. The following link is one of the results I found.

http://picbasic.co.uk/forum/showthread.php?t=10300&highlight=PIC18F4620

Robert

Charles Linquis
- 19th April 2010, 01:34
I had a problem with ADCIN on my 18F2221's. I solved the problem by doing it the "old fashioned way":




ADCON0 = (channel << 2) + $3 ;Set up the ADC channel, turn on the A/D
PAUSEUS 20 ; wait for the analog switch 'glitch' to die down
ADCON1.1 = 1 ;Set the Go/Done bit
PAUSEUS 2 ; insure minimum time
WHILE ADCON1.1 = 1:WEND ; wait for the go/done bit to clear
Result.HighByte = ADRESH
Result.LowByte = ADRESL