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/LP-CC2652RB: CCS/LP-CC2652RB

Part Number: LP-CC2652RB
Other Parts Discussed in Thread: CC2652RB

Tool/software: Code Composer Studio

Hello all,

I have started working with cc2652 LP. My requirement are as below:

1. Connect the cc2652 to my existing hardware (atmega 328p) via TX and RX and receive data in string format.

2. Store the incoming data to an SD card of flash drive via spi interface.

3. Transfer the stored data via ble to an android enabled mobile phone.

Please let me know how i should proceed?

  • Hi Shivam,

    I suggest you download the SDK and study the examples in there. Naming a few that might be interesting:

    * uartecho

    * sdraw

    * simple_peripheral

  • Hello,

    Thanks for your reply, i tried uartecho with my cc2652 LP, but i am unable to see the character echo on serial port, i am using putty.
    I am pretty new to the environment. Please help me.

    regards,

    shivam

  • Make sure your Putty connects to application UART COM port simulated by LP-CC2652RB.

  • Yeah putty is getting connected as I am getting the message "Echoing characters" given as printf in the uartecho example but I am not getting the characters I type in serial port.

    There is some step I am missing in executing the code.

  • I want to check UART example with cc2652 i.e to establish a serial port interface with computer. I am currently running the UART echo example but I am not getting the characters on serial port though connection with putty gets established.

  • If you are sure that you connect to Application UART COM port of your LP-CC2652RB, you should check the baudrate next. The correct baudrate settings should be 115200.

  • Yes my dear friend baud rate settings are correct as well because I am getting a message of "Echoing characters".

    I think I am missing some step in executing the code.

  • Do you type in anything into your Putty Console and see it on the console? I just test this on my LP-CC2652RB and I am sure it works fine.

  • Yes exactly now you got it.

    When I type anything on putty console I don't see it back on the console.

    Can you tell me step by step process what you are following after importing uartecho example in ccs ide.

    Many thanks for your help in advance.

  • After you download uartecho into your LP-CC2652RB with CCS, you can close CCS and disconnect/reconnect USB cable between your desktop and LP-CC2652RB. Then, start Putty and press reset button on your LP-CC2652RB to test again.

  • Thanks it worked.
    Now i want to interface the ti cc2652 launchpad with Arduino RX/TX and receive data and display in serial port.
    How should i proceed for it.

  • I suppose you can revise uart echo example to use two UARTs on CC2652RB, one UART to communicate with Arduino and another to output message to Putty.

  • How to define 2 uarts for cc2652, do you know of any code example or link where 2 uarts are used for cc2652.

  • I would suggest you to test this with uartecho example. You can use syscfg to add the second UART and clone the second UART codes from the first UART to make it work.

  • You mean to say that i shall connect arduino TX/RX to CC2652RB-LP DIO 2 and DIO 3. Then i will use 2nd uart to display the incoming data on 2nd Uart i.e. DIO 6 & 7.
    It will be helpfull for me if you can also let me know how to clone the second uart code from first one.

    Thanks,

    shivam

  • This link is helpfull, but how to visualize when i will connect dio 2,3 to arduino tx , rx and then want to see the incoming data on serial monitor. 

  • I suppose you just need to connect dio 2,3 (this is first UART pins) to arduino tx , rx and you can use "UART_write(uart1,..." to output message from second UART on serial monitor.

  • I have made the connections as you are telling and used "UART_write(uart1,..." in while loop of the code.

    But still not getting the results on serial monitor.
    I am sending the string characters from arduino side and want to receive it via cc2652 and display them on cc2652 uart.

  • Do you input anything to first UART RX when you test this?

  • In speicific i didnt input anything, just that while testing uart echo i was entering characters on terminal to view them back.
    For details please refer the code in the file attached.

    uartecho.txt
    #include <stdint.h>
    #include <stddef.h>
    
    /* Driver Header files */
    #include <ti/drivers/GPIO.h>
    #include <ti/drivers/UART.h>
    
    /* Driver configuration */
    #include "ti_drivers_config.h"
    
    /*
     *  ======== mainThread ========
     */
    void *mainThread(void *arg0)
    {
        char        input;
        const char  echoPrompt[] = "Echoing characters:\r\n";
        const char echo1Prompt[] = "UART 2 Echoing characters:\r\n";
        UART_Handle uart;
        UART_Params uartParams;
        UART_Handle uart1;
        UART_Params uart1Params;
        /* Call driver init functions */
        GPIO_init();
        UART_init();
    
        /* Configure the LED pin */
        GPIO_setConfig(CONFIG_GPIO_LED_0, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW);
    
        /* Turn on user LED */
        GPIO_write(CONFIG_GPIO_LED_0, CONFIG_GPIO_LED_OFF);
    
        /* Create a UART with data processing off. */
        UART_Params_init(&uartParams);
        uartParams.writeDataMode = UART_DATA_BINARY;
        uartParams.readDataMode = UART_DATA_BINARY;
        uartParams.readReturnMode = UART_RETURN_FULL;
        uartParams.baudRate = 115200;
    
        uart = UART_open(CONFIG_UART_0, &uartParams);
    
        if (uart == NULL) {
            /* UART_open() failed */
            while (1);
        }
        /* Create second UART with data processing off. */
            UART_Params_init(&uart1Params);
            uart1Params.writeDataMode = UART_DATA_BINARY;
            uart1Params.readDataMode = UART_DATA_BINARY;
            uart1Params.readReturnMode = UART_RETURN_FULL;
            uart1Params.baudRate = 115200;
    
            uart1 = UART_open(CONFIG_UART_1, &uart1Params);
    
            if (uart1 == NULL) {
                /* UART_open() failed */
                while (1);
            }
        UART_write(uart, echoPrompt, sizeof(echoPrompt));
        UART_write(uart1, echo1Prompt, sizeof(echo1Prompt));
    
        /* Loop forever echoing */
        while (1) {
            UART_read(uart, &input, 1);
            UART_write(uart, &input, 1);
        }
    }
    

    #include <stdint.h>#include <stddef.h>
    /* Driver Header files */#include <ti/drivers/GPIO.h>#include <ti/drivers/UART.h>
    /* Driver configuration */#include "ti_drivers_config.h"
    /* *  ======== mainThread ======== */void *mainThread(void *arg0){    char        input;    const char  echoPrompt[] = "Echoing characters:\r\n";    const char echo1Prompt[] = "UART 2 Echoing characters:\r\n";    UART_Handle uart;    UART_Params uartParams;    UART_Handle uart1;    UART_Params uart1Params;    /* Call driver init functions */    GPIO_init();    UART_init();
        /* Configure the LED pin */    GPIO_setConfig(CONFIG_GPIO_LED_0, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW);
        /* Turn on user LED */    GPIO_write(CONFIG_GPIO_LED_0, CONFIG_GPIO_LED_OFF);
        /* Create a UART with data processing off. */    UART_Params_init(&uartParams);    uartParams.writeDataMode = UART_DATA_BINARY;    uartParams.readDataMode = UART_DATA_BINARY;    uartParams.readReturnMode = UART_RETURN_FULL;    uartParams.baudRate = 115200;
        uart = UART_open(CONFIG_UART_0, &uartParams);
        if (uart == NULL) {        /* UART_open() failed */        while (1);    }    /* Create second UART with data processing off. */        UART_Params_init(&uart1Params);        uart1Params.writeDataMode = UART_DATA_BINARY;        uart1Params.readDataMode = UART_DATA_BINARY;        uart1Params.readReturnMode = UART_RETURN_FULL;        uart1Params.baudRate = 115200;
            uart1 = UART_open(CONFIG_UART_1, &uart1Params);
            if (uart1 == NULL) {            /* UART_open() failed */            while (1);        }    UART_write(uart, echoPrompt, sizeof(echoPrompt));    UART_write(uart1, echo1Prompt, sizeof(echo1Prompt));
        /* Loop forever echoing */    while (1) {        UART_read(uart, &input, 1);        UART_write(uart, &input, 1);    }}

  • This is the expected behavior of uartecho example so what's your issue?

  • Thanks for your patience, my requirement is i want to receive string characters from arduino RX/TX to CC2652 TX/RX and view the incoming characters on CC2652 Serial monitor.
    Its okay if i dont use 2 uarts.

  • You can try to connect CC2652 RX to arduino TX to receive the message and connect CC2652 TX to output to Serial monitor.

  • Where do i have to connect CC2652 TX for output?
    Because when i am connecting Arduino TX to CC2652 RX, i am unable to get the ouput on cc2652 serial monitor. But when i am connecting Arduino TX to CC2652 TX, i am able to get the output on serial monitor, i think its going through the debugger.

    Please help YC.

    thanks,

    shivam

  • Do you enable and use two UARTs on LP-CC2652R?

  • Yes I am able to do that but it's not required as one UART is enough for my final application.

  • Yes i have tried to do it.
    Please see the code below:

    #include <stdint.h>
    #include <stddef.h>
    /* Driver Header files */
    #include <ti/drivers/GPIO.h>
    #include <ti/drivers/UART.h>
    /* Driver configuration */
    #include "ti_drivers_config.h"
    void *mainThread(void *arg0)
    {
    char input;
    const char echoPrompt[] = "Echoing characters:\r\n";
    UART_Handle uart;
    UART_Params uartParams;
    /* Call driver init functions */
    GPIO_init();
    UART_init();
    /* Configure the LED pin */
    GPIO_setConfig(CONFIG_GPIO_LED_0, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW);
    /* Turn on user LED */
    GPIO_write(CONFIG_GPIO_LED_0, CONFIG_GPIO_LED_ON);
    /* Create a UART with data processing off. */
    UART_Params_init(&uartParams);
    uartParams.writeDataMode = UART_DATA_BINARY;
    uartParams.readDataMode = UART_DATA_BINARY;
    uartParams.readReturnMode = UART_RETURN_FULL;
    uartParams.baudRate = 115200;
    uart = UART_open(CONFIG_UART_0, &uartParams);
    if (uart == NULL) {
    /* UART_open() failed */
    while (1);
    }
    UART_write(uart, echoPrompt, sizeof(echoPrompt));

    UART_Handle uart1;
    UART_Params uartParams1;
    /* Call driver init functions */
    GPIO_init();
    UART_init();
    /* Create a UART with data processing off. */
    UART_Params_init(&uartParams1);
    uartParams1.writeDataMode = UART_DATA_BINARY;
    uartParams1.readDataMode = UART_DATA_BINARY;
    uartParams1.readReturnMode = UART_RETURN_FULL;
    uartParams1.baudRate = 115200;
    uart1 = UART_open(CONFIG_UART2_0, &uartParams1);
    if (uart1 == NULL) {
    /* UART_open() failed */
    while (1);
    }
    // UART_write(uart, echoPrompt, sizeof(echoPrompt));
    /* Loop forever echoing */
    while (1)
    {
    UART_read(uart1, &input, 1);
    UART_write(uart, &input, 1);
    }
    }

  • How can i verify that dual uart is working?

  • Do you mean to use one UART or two UARTs?

  • I had shown you how to do at