MCC18 .h LATC3, 4, 5 messed up? p18f4550.h

Post
bill190
Senior Member
2010/05/24 20:39:37
In the MCC18\h directory is p18f4550.h and the following...

extern volatile near unsigned char LATC;
extern volatile near struct {
unsigned LATC0:1;
unsigned LATC1:1;
unsigned LATC2:1;
unsigned :3;
unsigned LATC6:1;
unsigned LATC7:1;
} LATCbits;


Shouldn't that be like I have below?

extern volatile near unsigned char LATC;
extern volatile near struct {
unsigned LATC0:1;
unsigned LATC1:1;
unsigned LATC2:1;
unsigned LATC3:1;
unsigned LATC4:1;
unsigned LATC5:1;
unsigned LATC6:1;
unsigned LATC7:1;
} LATCbits;
icserny
Super Member
RE: MCC18 .h LATC3, 4, 5 messed up? p18f4550.h 2010/05/24 21:40:35
LATC<5:3> are not implemented (see TABLE 10-6 in the datasheet) therefore there is no reason to define them.
bill190
Senior Member
RE: MCC18 .h LATC3, 4, 5 messed up? p18f4550.h 2010/05/25 19:08:35
Thank you!

I need to put my glasses on! I thought all the pins in one area were "C's", but they are mixed in with the "D's"! Smile
icserny
Super Member
RE: MCC18 .h LATC3, 4, 5 messed up? p18f4550.h 2010/05/25 23:20:48
It is worthwile to compare the PIN diagram of the PIC18F4550 to a non-USB MCU. One can see that the pin which belongs to the RC3 bit is used up for the VUSB (that's why the C port has only 7 bit), and the pins RC4, RC5 are shared with USB data signals D+/D-. The latter two pins can also function as digital inputs (digital output is not implemented) therefore RC<5:4> are implemented, but TRIS<5:4> and LATC<5:4> are not.