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/TMS570LS0432: UART on N2HET

Part Number: TMS570LS0432

Tool/software: Code Composer Studio

I configured N2HET for UART, Transmission is working. But, receive is not working. Interrupt is not getting generated for Rx. I referred to the Example code & modified the code according to my controller.

  • Hello,
    Is it possible to share some part of your code (changes for example) and point to Example code you are using?

    Best regards,
    Miro
  • 6165.HET_EMU_SCI.c

    Hi,

    I've attached the modified HET_EMU_SCI.c file, after hetInit() function (which is not changed) i'm using following lines :

    ---------------------------------------------------------------------------------------------------------

    asm(" cpsie i");
    hetREG1->GCR = 0x01030001;

    //Send UART data using Polling
    hetREG1->INTENAC = 0xFFFFFFFF;
    hetREG1->FLG = 0xFFFFFFFF;
    HetUART1PutText("Send Data using Polling\n\r");
    HetUART1Printf("BaudRate: %d bps.\n\r", 115200);

    //Clear the flags, Enable transmit interrupts
    while(hetRAM1->Instruction[2].Data != 0);
    //while(hetRAM1->Instruction[4].Data != 0);//There could be a small glitch when switching between interrupt and polling
    hetREG1->FLG = 0xFFFFFFFF;
    hetREG1->INTENAS = 0x8;

    //Send UART data using interrupts
    while(hetRAM1->Instruction[2].Data != 0);
    HetUART1PutChar('S');
    while(Bit_Tran<27);

    //Clear the flags, Disable transmit interrupts
    hetREG1->INTENAC = 0x8; //disable the transmit
    while(hetRAM1->Instruction[2].Data != 0);
    hetREG1->FLG = 0xFFFFFFFF; //clear interrupt flags

    //Receive UART data using Polling
    HetUART1PutText("Type Any Letter to Echo using Polling:\n\r");
    while((CharReceive=HetUART1GetChar()) == 0);
    HetUART1PutChar(CharReceive);

    //Receive UART data using interrupt
    hetREG1->INTENAS = 1<<23;//enable Receive interrupt
    HetUART1PutText("\n\rType Any Letter to Echo using interrupt:\n\r");

    ---------------------------------------------------------------------------------------------------------

    Also, added this function in notification.c

    void hetNotification(hetBASE_t *het, uint32_t offset)
    {
    /* enter user code between the USER CODE BEGIN and USER CODE END. */
    /* USER CODE BEGIN (39) */
    //volatile int temp;
    char Rec_Data;
    if(offset==4)
    {
    Bit_Tran ++;
    if(Bit_Tran < 27)
    HetUART1PutChar(Output[Bit_Tran]);
    }
    else if(offset==24)
    {
    Rec_Data = hetRAM1->Instruction[25].Data;
    HetUART1PutChar(Rec_Data);
    }
    /* USER CODE END */
    }

    ---------------------------------------------------------------------------------------------------------

    The uC is running @ 80MHz, using NHET00 for Tx & NHET02 for Rx.

  • Hello,

    Your main() and notification() are good. I could not figure out the changes in the NHET code. Could you please post the source code (*.het) and let me know where the changes are?
  • 1373.HET_EMU_SCI.txt

    I've attached the file with *.txt extn, as the page was not allowing me to upload with *.het extn.

    I didn't do any changes in the *.het file. I just copied the file into my project. I made changes to the HET_EMU_SCI.c file, i changed the Baud rate according to my uc which is operating @ 80MMz.

  • Part Number: TMS570LS0432

    Tool/software: Code Composer Studio

      I've posted my query here, but no help. Need your inputs to get this resolved.

  • Hello,
    Is your question related with this thread: e2e.ti.com/.../781809

    Best regards,
    Miro
  • I worked with Pradeep to resolve this. Here's a working example for the TMS570LS04x.

    0243.TMS570LS04_HET_EMU_SCI_20190325_2152.zip

    The NHET triggers are working - only the baud rate is wrong.

    Pradeep, please post the config modification that made it work at 115200 BAUD.

  • Hello Pradeep,

    Have you make your code working with RX interrupt?

    You will see that TI example does support interrupt: processors.wiki.ti.com/.../N2HET_EMU_UART_AppNote.pdf
    The TI BMS TI-Design uses NHET emulated SCI on TMS570LS0432: www.ti.com/.../TIDM-TMS570BMS