Continue to Site

Welcome to EDAboard.com

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.

How to assign CHS register in C for PIC18F

Status
Not open for further replies.

eepty

Full Member level 2
Joined
Oct 21, 2005
Messages
143
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
2,611
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
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top