I'm using USART with DMA to implement a Modbus rtu slave node.
I want to implement this:
- the USART use DMA to store received characters in a buffer
- a contdown-timer count the time between character to recognise the end of the frame.
- the timer is loaded when new characters are loaded by the DMA. I want to recognize them with a 20kHz ISR that I use to do other stuff: Checking the value of the DMA count I know if new bytes has arrived.
I use the DMA as a sort of FIFO, because:
- I don't know the size of the message
- I don't want to use a ISR for each character to avoid loss of information.
Unfortunately, I didn't find any information about getting DMA count!
Does anyone can help me?
Thank you very much.