UART receive, a long time to wait

2 posts / 0 new
Last post
jamesleo-konka
Offline
Last seen:4年1月前
加入:2017-01-22 02:42
UART receive, a long time to wait

Hi, DIalog,
I'm using a UART to communicate with peripheral device.
First the MCU sends a command via UART, and then waits for feedback from peripheral.
The feedback length is not fixed and the coming time is unknown (varies from 0.1 second to a few seconds).
The system watchdog is enalbled, that means I can't wait UART feedback for a long time.
How to organize the tasks, ISR, Queue?
Is there a sample code for this application?

Thanks

Keywords:
Device:
MT_dialog
Offline
Last seen:2 months 3 weeks ago
工作人员
加入:2015-06-08 11:34
Hi jamesleo-konka,

Hi jamesleo-konka,

I dont think that there is an example code for what you would like to do exactly, perhaps you can have a look at the peripherals_demo which is a console like application and that could give you some guidance. Regarding not having a fixed value for the numer of characters that you are waiting from the UART, an idea would be to read the characters one by one and have a specific tag that would indicate the end of the command.

Thanks MT_dialog