pilar
Joined: 30 Jan 2008 Posts: 197
|
How to enable multiple ADCs |
Posted: Thu Sep 14, 2023 5:28 pm |
|
|
Hi, I am using the PIC18F4620 with CCS 4.74 and I need to configure the first seven channels of the ADC converters (ADC0, ADC1, ADC2, ADC3, ADC4, ADC5, AD7), for this I am using this command:
Code: | setup_adc_ports(AN0_TO_AN7);
|
but it enables the RE1 pin as ADC6, I don't want this because I am using this pin as an output, how can I do what I need? |
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Thu Sep 14, 2023 11:36 pm |
|
|
You can't.
This is a 'read the data sheet'one.
Page 224. Register 18-2, shows the patterns of ADC inputs supported
by this chip (on the current datasheet).
Change to a more modern PIC. Newer devices do allow individual
pins to be selected, instead of the patterns supported by this chip.
Alternatively, you need to redesign your board to move the analog
signal to AN6 and your digital signal to E2. |
|