Ansel,anselh

Status
Not open for further replies.

ghostman11

Well-Known Member
i have been reading examples of mikroc from various places and most examples use the 16f chips, i am using the 18f1320 on the junebug....... my question is if you use ANSEL AND ANSELH to configure port pins as digital on the 16f, would i be correct in thinking that on the 18f1320 you would use ADCON instead? i have read the data sheet but i a little unsure. cheers guys
 
Hi,

Yes, its ADCON1 on the 18Fs.

Think you will be pleased with no more of the 16F Banking and Paging to bother about plus the advantage of the extra instructions like movff, cpfseq etc.
 
You also need to be aware that while the 16F, via adsel and adselh, can turn *any* pin analog or digital, the ADCON register in the 18F limits you to configuring *up to* the configured pin as analog.

So, on 16F you can enable, say, A0, A3, B2 as analog, leaving the rest (A1, A2, etc.) digital.

On the 18F, you can enable A0, or A0 and A1, or A0, A1 and A2, etc. You *cannot* make just B0 analog!

A trap I only discovered *after* laying out my PCB... <sigh>
 
Some of the newer 18 series have ANSEL and ANSELH. You may be able to use your PCB by swapping chips.

Mike.
 
thanks for the info i will keep that in mind.
welcome back mike hope the water was cold!!!! lol
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…