cancel
Showing results for 
Search instead for 
Did you mean: 

UART RX DMA & IDLE interrupt occur then i want to new data at location BUFFER[0] every time.

parth kothiya
Senior

UART DMA receive unknown length of data (maximum data length 64 bytes) but in every message terminate with 3.5 char times silent interval ( MODBUS RTU FRAMING) so to detect silent interval i'm using IDLE interrupt occur before new message start.

When IDLE interrupt occur i want reset DMA receive data buffer and want new data start at buffer[0] location ( NOT OVER WRITE OF DATA LIKE CIRCULAR BUFFER) how can i do this?

or any other way to detect MODBUS RTU frame end (silent char interval).

2 REPLIES 2
Ozone
Lead

Move the received data in the idle timeout interrupt handler, and reset the rx index pointer.

You will need to have reception handling independant of (modbus command) evaluation.

>... but in every message terminate with 3.5 char times silent interval ( MODBUS RTU FRAMING) ...

At least in theory.

The realityis that existing devices on the market do not always conform well to the 0,5/3,3 character time rule.

You'd presumably have to reconfigure the DMA, ie suspend and change pointers/counts, or just reinitialize​ the DMA.

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