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

Discussion in 'Embedded Systems and Microcontrollers' started by spinnaker, Oct 21, 2015.

  1. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    988
    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.
     
  2. JohnInTX

    Moderator

    Jun 26, 2012
    2,340
    1,022
    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.
     
  3. RRITESH KAKKAR

    Senior Member

    Jun 29, 2010
    2,831
    89
    hello spinnaker ,
    How is XC8 compared to MPLAB?
     
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    About as well as an apple compares to an orange.

    One is a compiler and the other a design environment.
     
  5. RRITESH KAKKAR

    Senior Member

    Jun 29, 2010
    2,831
    89
    Hello,
    You mean to say Xc8 is better than Hi tech C ?
     
  6. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    988
    Why don't you start your own thread?

    XC8 is hitech but neither are MPLab,
     
    RRITESH KAKKAR likes this.
  7. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    988
    Thanks I should have look at the other structures and that would have given me a hint to what was up.
     
Loading...