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

ADC missing channels PIC16F18877

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



Joined: 24 Feb 2014
Posts: 10

View user's profile Send private message

ADC missing channels PIC16F18877
PostPosted: Mon Oct 01, 2018 6:13 am     Reply with quote

Hello, the current #include <16F18877.h> have ADC missing channels, only i can see ADC channels in PortA, PortB and PortC and missing the ADC channels in PortD and PortE.

The PIC16F18877 have up to 35 ADC channels.

The compiler version is 5.070

Maybe, can I use the channel HEX code number to use these missing channels ?

Thanks!

John
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Mon Oct 01, 2018 6:49 am     Reply with quote

That's not 'the current #include'. We are on 5.081 now....

Quite probably just adding the defines would do it. These are there only a couple of compiler releases later. you have the problem of 'new chip', and the first compiler versions often miss things. However there may be 'deeper' issues...

Code:

#define sAN24         0x00000001  //| D0
#define sAN25         0x00000002  //| D1
#define sAN26         0x00000004  //| D2
#define sAN27         0x00000008  //| D3
#define sAN28         0x00000010  //| D4
#define sAN29         0x00000020  //| D5
#define sAN30         0x00000040  //| D6
#define sAN31         0x00000080  //| D7
#define NO_ANALOGS             0  // None
#define ALL_ANALOG    0xFFFFFFFF  // A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7
// Second parameter:
// OR together desired pins
#define sAN32         0x00000100  //| E0
#define sAN33         0x00000200  //| E1
#define sAN34         0x00000400  //| E2
#define NO_ANALOGS_P2          0  // None
#define ALL_ANALOG_P2 0x00000700  // E0 E1 E2 


Note that the E port mappings are handled differently and use a second parameter. These are very unlikely to work with the older compiler... :(

There is a note of an opcode fix for the 16x188xx chips in 5.075, and it is also at this point that the adc channels are fixed. I'd honestly suggest getting an upgrade to at least this version if using this chip.
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