This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS570LC4357: N2HET as GIO

Part Number: TMS570LC4357

Tool/software: Code Composer Studio

I need to use some of the N2HET pins as GIO inputs and some as outputs

My understanding is that I can use the gioxxx functions to manipulate the N2HET pins i.e. 

From the examples, the HET bins only need the following set up:

       hetREG2->GCR         = 0x01000001;        //   turn on

       hetREG2->PULDIS  = 0x00000000;         // PULL enabled

       hetREG2->DIR    = 0 |( 1 << 2)|( 1 << 3);    // Pins 2 & 3 for output, the rest as input

The HET outputs toggle just fine, but the inputs only read 0 irrespective of being connected to 0 or 3.3.

Is there another configuration that needs to be set?

  • Hi John,

    You are right. You can use all the GIO functions for hetPORT:

    gioSetDirection(hetPORT2, dir);
    gioSetBit(hetPORT2, bit, value);
    gioSetPort(hetPORT2, value);
    gioGetBit(hetPORT2, bit);
    gioGetPort(hetPORT2);
    gioToggleBit(hetPORT2, bit);

    You don't need to set the 24th bit of HETGCR register.