2024-08-24 09:31 PM
Hi All,
I am working on a project from a customer which has alreday code for working with the UART although I need some help or advise,
The code uses an RX interrupt when a byte is received then place the byte in a memory location and a Timer interrupt fires every few miliseconds and read the bytes from the memory location.
This seems to me a bit strange using 2 interrupts to receive UART Data,I haveto say that the UART received data does not have a consistend lenght 1 time it is 12 bytes and the second time it is only 6 bytes ,
How would you guys advise how to do this in a more or better way
Thanks a always for the valuable help we receive from this Forum
Regards
Solved! Go to Solution.
2024-08-24 10:22 PM
Well typically using the UART IRQ to fill a FIFO / RING buffer is actually quite desirable as most of the STM32 only hold a single byte internally, and you do want to separate the processing and parsing, so it's not byte-time critical.
How often you service that depends on the packet sizes, and bandwidth,but 9600 baud is around 1000 chars/seconds, so 1 ms isn't out of bounds.
2024-08-24 10:22 PM
Well typically using the UART IRQ to fill a FIFO / RING buffer is actually quite desirable as most of the STM32 only hold a single byte internally, and you do want to separate the processing and parsing, so it's not byte-time critical.
How often you service that depends on the packet sizes, and bandwidth,but 9600 baud is around 1000 chars/seconds, so 1 ms isn't out of bounds.
2024-08-24 11:32 PM
Thank you Tesla DeLorean,
I appreciate your input it helps me clearing my mind