eepty
Full Member level 2
I am using the C18 compiler for the PIC18F microcontroller
I want to write a C code for the ADC module. According to the datasheet, the CHS<4.0> in ADCON0 is the analog channel select bits. I do not want to assign the CHS4, CHS3, CHS2, CHS1, CHS0 bit by bit. How can I assign the CHS something like:
ADCON0bits.CHS = 5;
(I tried this code but I got error message)
Thanks
I want to write a C code for the ADC module. According to the datasheet, the CHS<4.0> in ADCON0 is the analog channel select bits. I do not want to assign the CHS4, CHS3, CHS2, CHS1, CHS0 bit by bit. How can I assign the CHS something like:
ADCON0bits.CHS = 5;
(I tried this code but I got error message)
Thanks