Skip to main content
parth kothiya
Associate III
October 3, 2019
Question

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

  • October 3, 2019
  • 2 replies
  • 828 views

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).

This topic has been closed for replies.

2 replies

Ozone
Principal
October 3, 2019

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.

Tesla DeLorean
Guru
October 3, 2019

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 VenmoUp vote any posts that you find helpful, it shows what's working..