2021-01-21 09:57 PM
I've setup USART to interrupt on a timeout using:
CR2.RTOEN
CR1.RTOIE
And configured the timeout using:
RTOR.RTO
It works great, really nice feature. The RTO timeouts are always measured from the last stopbit/character received. However, I need to support a timeout even if zero characters were received. Does anybody know of a method to reset the RTO counter etc?
2021-01-21 10:53 PM
I doubt that RTO can be used for that. A simplistic approach would be using HAL_UART_Receive with a small timeout value (SysTick). A more sophisticated approach could start a timer and use a timer interrupt when the time is over.
2021-01-23 06:38 AM
For "no reception" timeout typically a notification/event/semaphore wait function or other independent software/hardware timeouts are used.
2021-01-23 07:19 PM
I thought that might be the case. Was looking for a dependable workaround to keep timeout functionality to the peripheral itself (just seemed like more modular design).
Appreciate the responses. Shame its not possible, honestly it seems like a trivial change to the functionality (force manual triggering of a stop bit). That said, I understand that'd be a respin of silicon and thats just not going to happen :(
Does anybody know if using internal pull-ups and bitbanging a USART rx to a stopbit would work?
2021-01-23 11:38 PM
>using internal pull-ups and bitbanging a USART rx to a stopbit
Surely the connected device pulls stronger than the pull-ups. And if not, you're risking corruption of genuinely incoming data.
> Shame its not possible, honestly it seems like a trivial change to the functionality
You can start an "Idea", maybe it'll stick, at least for future devices.
Meantime, just accept the status quo, as Piranha and KnarfB said.
JW
2021-02-15 03:37 PM
thanks!