CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

How to enable multiple ADCs

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
pilar



Joined: 30 Jan 2008
Posts: 197

View user's profile Send private message

How to enable multiple ADCs
PostPosted: Thu Sep 14, 2023 5:28 pm     Reply with quote

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: 19226

View user's profile Send private message

PostPosted: Thu Sep 14, 2023 11:36 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group