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.

[FAQ] [参考译文] [常见问题解答]基于 MSPM0事件的 UART RX ms 级超时实现

Guru**** 1105770 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1220244/faq-uart-rx-ms-level-timeout-realization-based-on-event-for-mspm0

主题中讨论的其他器件:MSPM0L1306

MSPM0G 或 MSPM0L UART 上的超时功能无法达到 ms 级别。

下面是一个 基于1个 UART、1个计时器、2个 DMA 实现它的示例。

这里是方框图。 关键是它不使用 UART RX  触发 DMA 将 RXDATA 移动到缓冲区。 它使用 UART RX 触发 DMA 来更新计时器寄存器。 它使用 cC0来触发另一个 DMA 以将 RXDATA 移到缓冲区。 继续从 RX 接收数据时、计数器将重新初始化、并继续触发 CC0。  数据传输完成后、计数器将计数到 CC1并生成 CPU 中断。   

以下是测试结果(0.1s 延迟):

下面是代码:

e2e.ti.com/.../Uart_5F00_Timeout_5F00_MSPM0L1306.zip