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.

LAUNCHXL2-570LC43: Need Support

Part Number: LAUNCHXL2-570LC43
Other Parts Discussed in Thread: HALCOGEN,

Hello people,

I have tried some of  very basic examples in CCS ( like adding, subtracting of two nos etc ). I have used #include <stdio.h>  and got the output in the console.

The main file is shown below:

int x, y, sum;
printf("Enter 1st no: ");
scanf("%d", &x);
printf("Enter 2nd no: ");
scanf("%d", &y);

sum = x + y;
printf("Sum of %d and %d is %d", x, y, sum);

I have to do the same but the  output should be shown at Serial terminal. What datatype for variables should be used, what functions should be used to diplay the message and receive the nos?

Please help

Best Regards,

Advath

  • Hello Advath,

    The SCI port can be used to send characters to serial terminal, or receive characters from the serial terminal.

    The HALCoGen has an example to configure SCI to TX character to serial terminal. HALCoGen->Help->Help Topics.

    This is a useful training video:

    https://training.ti.com/hercules-how-tutorial-using-sci-uart-communication

  • Hello QJ,

    I have tried it with LAUNCHXL2-570LC43. I didn't get  any errors. But I am not getting ANY OUTPUT in the SERIAL TERMINAL. What can I do?

    The main code is shown below:

    /* USER CODE BEGIN (0) */
    #include "HL_sci.h"
    /* USER CODE END */

    /* Include Files */

    #include "HL_sys_common.h"

    /* USER CODE BEGIN (1) */
    static unsigned char command;
    /* USER CODE END */

    /** @fn void main(void)
    * @brief Application main function
    * @note This function is empty by default.
    *
    * This function is called after startup.
    * The user can use this function to implement the application.
    */

    /* USER CODE BEGIN (2) */
    /* USER CODE END */

    uint8 emacAddress[6U] = {0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU};
    uint32 emacPhyAddress = 1U;

    void main(void)
    {
    /* USER CODE BEGIN (3) */
    _enable_IRQ();

    sciInit();

    sciSend(sciREG1, 21U, (unsigned char *)"Press any key!\r\n");

    sciReceive(sciREG1, 1U, (unsigned char *)&command);

    while(1);
    /* USER CODE END */

    }


    /* USER CODE BEGIN (4) */
    void sciNotification(sciBASE_t *sci, unsigned flags)
    {
    sciSend(sci, 1, (unsigned char *)&command);

    sciReceive(sci, 1, (unsigned char *)&command);

    }

    void esmGroup1Notification(int bit)
    {
    return;
    }

    void esmGroup2Notification(int bit)
    {
    return;
    }
    /* USER CODE END */

    Best Regards,

    Advaith

  • Hello Advaith,

    The terminal's baudrate and stop bit should be configured correctly.

    When you open terminal, proper COM port should be selected: COMxx: XDS110 Class Application/User UART

  • Hello QJ,

    Actually I did all those before compiling the code. I think problem is with  the below two commands:

    sciSend(sciREG1, 21U, (unsigned char *)"Press any key!\r\n");

    sciReceive(sciREG1, 1U, (unsigned char *)&command);

    I am using LAUNCHXL2-570LC43. Is there any change in the pin number or anything like that? I have one more doubt. I connected the launchpad and pc through & this  is the only hardware connected. Is it enough?

    Best Regards,

    Advaith

  • Can you please try this example?

    2772.example_sci_uart_9600.c

  • Hello QJ,

    Thank you  very much for your support.