cancel
Showing results for 
Search instead for 
Did you mean: 

UART Help needed

Pje
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

2 REPLIES 2

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thank you Tesla DeLorean,

I appreciate your input it helps me clearing my mind