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.

How to create UART connection using CC2650 SensorTag?

Other Parts Discussed in Thread: CC2650, CC2650STK

Hey there,

Let me give you overview of the project I am trying to create. 

Ultimately I am looking to create a device that uses a ZNP+ZAP setup that uses a 5X5 CC2650 and a STM32 MCU. The two are currently wired together on a custom board via UART. I have been able to flash the SensorTag+ZstackCore project successfully to the 2650. I can connect it to a network as a SensorTag

I have not begun looking at transmitting data over UART yet. I am looking to receive or view UART test data from a SensorTag to theCCDebugger to my PC. Once i get the UART test data from a sensortag, I can use a similar approach for my custom board. This will allow me to verify the UART is working on the board. Once I have a proper UART connection I will start pushing real data through the UART and see if the 2650 can package and handle that properly.

I am going by a very step by step approach. I am wondering if anyone has done this before? And if so, what was required to get it working. 

I am aware that the ZNP+ZAP setup will require the STM to have ZDO commands from the Zigbee library. So for now I am using a Zstackcore+SensorTag image for the 2650. Would it be possible to connect another  pseudo"sensor" to the UART aka the STM to the SensorTag?

Currently I have imported the UART.h and UART.c files into the IAR SensorTag project. But I am not sure what to do from there and what to call to send and receive data through a UART line.

Any and all help is always appreciated,

-J

  • CC2650 is a very powerful SOC. Unless you want to run ZC or ZR on it, I don't suggest you to use ZAP-ZNP which would need an extra MCU.
  • Ok, good to know. I think I'll stick with my current SensrTag+Enddevice setup then. Do you have any insight on how to create UART connections on it?

  • You can do the following steps to enable UART on CC2650STK.

    1. Revise the following red lines in Board.c (under C:\ti\tirtos_simplelink_2_11_01_09\packages\ti\boards\SensorTag\CC26XXST_0120)

    const UARTCC26XX_HWAttrs uartCC26XXHWAttrs[CC2650_UARTCOUNT] = {
        {    /* CC2650_UART0 */
            .baseAddr = UART0_BASE,
            .intNum = INT_UART0,
            .powerMngrId = PERIPH_UART0,
            .txPin = Board_DP5_UARTTX,
            .rxPin = Board_DP4_UARTRX,
            .ctsPin = PIN_UNASSIGNED,
            .rtsPin = PIN_UNASSIGNED
        },
    };

    2. Add "#include <ti/drivers/UART.h>" in sensortagapp.c

    3. Claim two global variables "static UART_Handle SbpUartHandle;" and "static UART_Params SbpUartParams;" in sensortagapp.c

    4. You can add the following codes in the end of SensorTagApp_initialization() to output UART messages.

      {  
      uint8 txbuf[] = {0,1,2,3,4};
      UART_Params_init(&SbpUartParams);
      SbpUartHandle = UART_open(CC2650_UART0, &SbpUartParams);
      UART_write(SbpUartHandle, txbuf, 5);
      }

  • Awesome, I take it that this only outputs what is received on the UART line? Does this function like an echo? Or do I have to send data to the UART line from the app elsewhere?

    Edit:

    I performed all the changes. tera Term Still does not echo back the words I type. Is there anything else I am missing? 

  • To receive UART message, you should register A UART receiver callback to do it.
  • I have actually solved the UART issue.

    I was able to make use of the TL module.

    By adding an event handler to SensorTagApp_process

    #if defined (NPI_USE_UART) || defined (NPI_USE_SPI)
    //TL handles driver events. this must be done first
    TL_handleISRevent();
    #endif //TL

    Now when I connect to the SensorTag 2650 via Tera Term, I am now able to successfully echo values to the screen. I am able to do the same on the custom board as long as I change the Board.h Pinout to what my custom board is.

    This page was helpful. Although written for Bluetooth, the way it is used is the same for Zigbee.

    http://processors.wiki.ti.com/index.php/Adding_driver_cc2650

  • Thanks for sharing.
  • Hello,

    Whilst I am working with a TL module implementation I would like to know

    how do the MRDY/SRDY management because from my experience the

    TL library does not work with the POWER_SAVING predefined option.

    Otherwise MRDY/SRDY will be required although I will assign to

    PIN_UNASSIGNED both pins.

    I suppose that the MRDY/SRDY “handshake” sequence described on

    "Adding Serial Communication to a BLE Project"  will enable both devices

    to be ready to send and/or receive data.

    Welcome any advice.

    Thanks

    Alex