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.

LAUNCHXL-CC1350: CC1350 UART INTERRUPT

Part Number: LAUNCHXL-CC1350
Other Parts Discussed in Thread: CC1350

Hello,

I am using CC1350 launch pad for uart application. My intention is to get interrupt ,when different data with newline as end of frame is  recevied . When i configured uart  readReturnMode as UART_RETURN_FULL, i am getting interrupt when buffer is full.But when uart  readReturnMode is configured as UART_RETURN_NEWLINE , i am not getting interrupt when uart receives newline. the code is attached . any suggestions for the same ??

#include <stdint.h>
#include <stddef.h>
#include <unistd.h>

/* Driver Header files */
#include <ti/drivers/GPIO.h>
#include <ti/drivers/UART.h>
#include "string.h"
/* Example/Board Header files */
#include "Board.h"

void uartCallbackFunction(UART_Handle handle,void *buf, size_t count);
/*
 *  ======== mainThread ========
 */

int ReadByte;
uint8_t rxbuf[100];
uint8_t txbuf[100];
const char  echoPrompt[] = "Echoing characters:\r\n";
int rxbytes,i;
UART_Handle uart;

void *mainThread(void *arg0)
{
    UART_Handle uart;
    UART_Params uartParams;

    /* Call driver init functions */
    UART_init();

    /* Create a UART with data processing off. */
    UART_Params_init(&uartParams);
    uartParams.baudRate = 115200;
    uartParams.writeDataMode = UART_DATA_BINARY;
    uartParams.readDataMode = UART_DATA_TEXT;
    uartParams.readEcho = UART_ECHO_OFF;
    uartParams.readMode= UART_MODE_CALLBACK;
    uartParams.writeMode=UART_MODE_BLOCKING;
    uartParams.readReturnMode = UART_RETURN_NEWLINE;
    uartParams.readTimeout=UART_WAIT_FOREVER;
    uartParams.readCallback=uartCallbackFunction;

    uart = UART_open(Board_UART0, &uartParams);

    if (uart == NULL) {
        /* UART_open() failed */
        while (1);
    }

    UART_write(uart, echoPrompt, sizeof(echoPrompt))
    while(1)
    {
        rxbytes=UART_read(uart,rxbuf,10);
        for(i=0;i<100;i++);
    };
}
void uartCallbackFunction(UART_Handle handle,void *buf, size_t count)
{
//    UART_read(uart,rxbuf,5);
}

  • Hi, I believe this is related to line 36:

    uartParams.readDataMode = UART_DATA_TEXT;

    UART_DATA_TEXT is still not supported by the uart driver, check the latest driver documentation under "Not Supported Functionality":

    In UART_DATA_TEXT mode, the driver would examine the UART_ReturnMode value, to determine whether or not to unblock/callback when a newline is received. Since this is not supported by 13xx/26xx drivers, this is not possible.

    Also, check this post for more detailed explaination:

  • Thanks for the clarification.