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.

LED and HetPort bits correspondence

Hi,

where can I found the correspondence table between hetPort1 bits and LEDs on the board (whic bit for which LED)?

And what about the led colors?

I've search though the forum and documentation with no success.

I'm working with a TMDX570LS31HDK

Thank you

  • Hi,

    Please refer to sheet#14 of the below schematics,

    http://processors.wiki.ti.com/images/e/ec/TMS570LS31x_HDK_Schematics_RevE.pdf

    More info available at http://processors.wiki.ti.com/index.php/TMS570LS31x_HDK_Kit

    Best Regards,

    Karthik.

    PS: If this answers your question, please click verify answer to close this thread.

  • Thank you for the reference, Since I do not find the documentation very clear I've invested half a day to deepen this issue. For anyone having the same problem here is my definitive functions to drive the LEDs:

    // num: LED number (0 to 7,clockwise from top-left)
    // status: for monochrome LEDs 0: off, 1:on, others:off
    //         for RGB-LED (num=3|7) 0:off, 1:red, 2:green, 3:blue, others:off
    void ledChange(uint8 num, uint8 status)
    {
        switch (num){

        case 0:
            if (status==1) hetREG1->DOUT |= 0x00020000;
            else hetREG1->DOUT &= 0xFFFDFFFF;
            break;

        case 1:
            if (status==1) hetREG1->DOUT |= 0x80000000;
            else hetREG1->DOUT &= 0x7FFFFFFF;
            break;

        case 2:
            if (status==1) hetREG1->DOUT |= 0x00000001;
            else hetREG1->DOUT &= 0xFFFFFFFE;
            break;

        case 3:
            hetREG1->DOUT |= 0x00100024;
            if (status==1) hetREG1->DOUT &= 0xFFEFFFFF;
            else if (status==2) hetREG1->DOUT &= 0xFFFFFFFB;
            else if (status==3) hetREG1->DOUT &= 0xFFFFFFDF;
            break;

        case 4:
            if (status==1) hetREG1->DOUT |= 0x02000000;
            else hetREG1->DOUT &= 0xFDFFFFFE;
            break;

        case 5:
            if (status==1) hetREG1->DOUT |= 0x00040000;
            else hetREG1->DOUT &= 0xFFFBFFFF;
            break;

        case 6:
            if (status==1) hetREG1->DOUT |= 0x20000000;
            else hetREG1->DOUT &= 0xDFFFFFFF;
            break;

        case 7:
            hetREG1->DOUT |= 0x08010010;
            if (status==1) hetREG1->DOUT &= 0xFFFEFFFF;
            else if (status==2) hetREG1->DOUT &= 0xFFFFFFBF;
            else if (status==3) hetREG1->DOUT &= 0xF7FFFFFF;
            break;
        }
    }

    void ledOff()
    {
        hetREG1->DOUT = 0x08110034;
    }

    Before using them one must simply:

    • enablethe GIO driver in HlCoGen
    • set the LED ports as output with the instruction hetREG1->DIR       = 0xAA170035;

    Enjoy,

    Matteo