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.

LAUNCHCC3235MOD: Problems detecting UART0 reads

Part Number: LAUNCHCC3235MOD
Other Parts Discussed in Thread: SYSCONFIG, CC3235SF, CC3235S

Hello,

I'm having trouble detecting Rx data in UART0.

This is my setup, I have configured UART0 through sysconfig like the capture below

I can send data out, and the device I'm interfacing with sends data back. I can see that in a logic analyzer.

However, I'm never reading anything. This is the code I'm using

                  UART_Handle uart;
        UART_Params uartParams;


        UART_Params_init(&uartParams);
        uartParams.writeDataMode = UART_DATA_BINARY;
        uartParams.readDataMode = UART_DATA_BINARY;
        uartParams.writeMode = UART_MODE_BLOCKING;
        uartParams.readMode = UART_MODE_BLOCKING;
        uartParams.readReturnMode = UART_RETURN_FULL;
        uartParams.readEcho = UART_ECHO_OFF;
        uartParams.readTimeout=1000;
        uartParams.writeTimeout=1000;
        uartParams.baudRate = 115200;

        uart = UART_open(CONFIG_UART_EXPANSION, &uartParams);
        //UART_control(uart, UART_CMD_RXENABLE, NULL);

        if (uart == NULL) {
            while (1);
        }

        char c = 0x0;
        int32_t readCount;
        uint8_t buff[64];
        while (1) {

            //FF00031D0C
            char c1 = 0xff;
            char c2 = 0x00;
            char c3 = 0x03;
            char c4 = 0x1d;
            char c5 = 0x0c;
            UART_write(uart, &c1, 1);
            UART_write(uart, &c2, 1);
            UART_write(uart, &c3, 1);
            UART_write(uart, &c4, 1);
            UART_write(uart, &c5, 1);

            //UART_read(uart, &input, 1);
            readCount=UART_read(uart, buff, 1);
        }

 

readcount is always 0, and the UART_read operation always return when the timeout has expired.

Is there anything I'm doing wrong?

Thanks,

Ausias

  • Hello again,

    I forgot to mention the simple uartecho example on UART1 works just fine.

    Thanks,

  • Hi Ausias,

    Do you see the same issue if you use different launchpad pins? Also, does enabling DMA affect the behavior you are observing?

    For your connected device, is it possible to insert a short delay before it responds back with its UART data? It could be that the data is sent back before the UART_read() has fully setup the UART read operation.

    Regards,

    Michael

  • Hello,

    I have a uart to USB cable that do not work either on the same pins P45/P62

    The cable do work at a different pins P07/P08. But then, at those new pins, the device do not respond. However, it keep responding at the original P45/P62 pins.

    Are there any differences between those two pin sets?

    When the device responds, it takes less than 75 us, what would then be the best approach to send and receive data?

    Thanks,

     

  • Hello again,

    Finally it's working at pins P07/P08.

    It seems there were two issues: i) the start sequence of the device was not the right at any time and ii) I was bombing the device with so many requests it was completely unresponsive. Adding some delays did the trick.

    The question that remains is why pin Rx P45 does not work. What is the most likely cause?

    Thanks,

  • Hi Ausias,

    The reason why P45 doesn't work is because the header pin marked P45 on the CC3235SF launchpad is by default not connected to the P45 of the CC3235SF chip. This is since it is used as an analog DCDC pin and cannot be actually used as a digital IO for CC3235SF variant devices. For the CC3235S without the 1MB of internal flash, that DCDC is not needed and P45 is usable. See the Pin 45 entry in Table16-7 of the TRM for more information: http://www.ti.com/lit/swru465

    Let me know if you need more clarification or have more questions about using UART on the CC3235.

    Regards,

    Michael

  • Hello Michael,

    That solves all issues.

    Thanks,