Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
or even the ADCON0 channel :-D
Jayanth is right though, it uses the value in 'chanel' to set the bits in ADCON0 by ORing them with 0xC1. The value you provide is shifted three places to the left so it aligns with the channel bit positions in the register.
chanel=chanel << 3; // chanel value transmitted by the paramter of unction is multiply by 2 power 3 = 8
ADCON0= 0xC1 | chanel; // OR function to add the chanel number into the register
so chanel 0 will give 0xC1
chanel 1 -> 0xC9
chanel 2 -> 0xD1
chanel 3 -> 0xD9
.....
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.