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.

CC2642R: UART_write() problem

Part Number: CC2642R


I have a question about the SimpleLink MCU SDK driver UART.
As a circuit configuration, I can read back the transmitted data myself.

My Goal
Implement the logic to check the consistency between the UART signal sent by UART and the receive interrupt. If the send data matches the receive data, send the next UART immediately.

Software implementation
1. After executing UART_write (), a reception completion interrupt is generated depending on the transmission data.
2. Execute UART_read () within the interrupt to check the consistency between the transmitted data and the received data.
3. Set the minimum time (10us) timer. *
4. In the “3” timer interrupt context, execute UART_write (). *
* Follow the UART_write () warning and move from the interrupt context of UART reception before executing UART_write ().

Problem
UART transmission may not be executed with “4”. (I think it occurs when the timer setting time is short...)

Possible solutions
If UART_writeCancel () is executed before executing UART_write () of "4", events that do not transmit UART will not occur.
Is this treatment correct?

 

Thank you.

  • Hi,

    UART_writeCancel () is used to cancel UART_write() operations that are on-going. I am not sure how it will help when called before UART_write().

    Regards.

  • Thank you for your reply.



    To achieve the goal, we need to know why UART_write () cannot perform UART transmission.

    My expectation is that the next UART_write () will not be accepted successfully for a period of time after the UART_write () call.

    I think either of the following to solve the problem.

    • Wait for the time from when UART_write () is called to execute UART transmission until the next UART_write () is called to enable UART transmission.

    • Call UART_writecancel () immediately after UART transmission is completed with UART_write ()
  • Hi,

    I guess this solution might not work all the time as you might run into timing issues. Perhaps you can try to see how it performs.

    Alternatively, you can implement an interrupt based solution instead using the low level driver-lib APIs.

    Thanks