Why is C4 and C5 not defined in XC8 for the P18f26J53?

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
Why are the various C4 and C5 member variables not defined in XC8 for the P18f26J53?


typedef union {
struct {
unsigned TRISC0 :1;
unsigned TRISC1 :1;
unsigned TRISC2 :1;
unsigned :3;
unsigned TRISC6 :1;
unsigned TRISC7 :1;
};
struct {
unsigned :3;
unsigned TRISC3 :1;
};
} TRISCbits_t;

They shown as a valids pin in the datasheet. Am I missing something or is this a bug? C3 is not a valid pin but C4 and C5 are.
 

JohnInTX

Joined Jun 26, 2012
4,787
RC4 and RC5 are input only - from 10.4 in the data sheet
Unlike other PORTC pins, RC4 and RC5 do not have
TRISC bits associated with them.
.. so you can't write to those TRIS bits. The way they are defined in the .h will generate and error if you try to use them - which is what you would want it to do..
Have fun.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
RC4 and RC5 are input only - from 10.4 in the data sheet
.. so you can't write to those TRIS bits. The way they are defined in the .h will generate and error if you try to use them - which is what you would want it to do..
Have fun.
Thanks I should have look at the other structures and that would have given me a hint to what was up.
 
Top