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.

CC1310串口接收提前退出导致无数据

大家好:

我用CC1310launchPad的uartecho例程和传感器MINIR20通信的时候遇到了串口接收提前退出导致无数据的问题。

开发环境:CCS9.2.0;

SDK:simplelink_cc13x0_sdk_3_20_00_23

编译器版本:TI V18.12.3.LTS

例程:uartecho

串口初始化部分:

        UART_Params uartParams;
        UART_Handle UART = NULL;
        /* 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.readEcho = UART_ECHO_OFF;
        uartParams.readTimeout = (uint32_t) 300 * 1000/ Clock_tickPeriod;
        uartParams.baudRate = 9600;
        UART = UART_open(Board_UART0, &uartParams);
        if (UART == NULL)
        {
            return -1;
        }

问题:

1. 需要在1310的TX接一个上拉电阻,否则传感器接收1310发的数据会出错(传感器反馈:‘?’);

2. 通信成功率低,大约15%。

串口读取超时时间是300ms,但是我调试发现,UART_read会提前退出,大约1.04ms,接收数据长度rxlen=0;

读取成功的大约会15ms左右return,接收数据长度rxlen=10;

谢谢!