Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

RTOS/CC2650: AT commands using UART

$
0
0

Part Number:CC2650

Tool/software: TI-RTOS

Hi,

Has anyone tried sending AT commands to a LTE module using UART for the CC2650?

I tried the uart_echo as a starting point and it worked. I removed the jumpers for the TXD and RXD pins and I used a UART pH sensor that continuously sends data every second and it works too. But when I tried to send an AT command and expect a response from the module the code just hangs there after UART_write. I am not sure if it's the problem of the module or the code since UART seems to working properly with the CC2650.

The code can be seen below:

    char rxBuffer[100];
    const char txBuffer[] = "AT+CSQ\r";
    UART_init();
    UART_Handle uart;
    UART_Params uartParams;
    UART_Params_init(&uartParams);
    uartParams.readMode = UART_MODE_BLOCKING;
    uartParams.writeMode = UART_MODE_BLOCKING;
    uartParams.writeDataMode = UART_DATA_BINARY;
    uartParams.readDataMode = UART_DATA_BINARY;
    uartParams.stopBits = UART_STOP_ONE;
    uartParams.readEcho = UART_ECHO_OFF;
    uartParams.baudRate = 9600;
    uart = UART_open(0, &uartParams);
    if(uart){
        UART_write(uart, txBuffer, sizeof(txBuffer));
        printf("Command: %s\n", txBuffer);
        Task_sleep(500*1000/Clock_tickPeriod);
        UART_read(uart, &rxBuffer, sizeof(rxBuffer));
        printf("Response: %s \n", rxBuffer);
    }
    UART_close(uart);


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>