Fast serial read/write

Hallo,

I need some advice.
I’m developing an application that need fast serial read and write.
It is sending one byte, The byte is looped back on the RX wire (hardware).
Then I must read the received byte and see if it match the one i send. Than I can send a new one.
The receiving device need the time between the bytes to be smaller than 1 ms.!!!

But it seems the latency from the writefile to the readfile is high. The best I can accomplish is around 3 ms between to written bytes. That not fast enough for the receiving device. I have tried boosting the TX/RX thread to high priority.
Sending all bytes at the same time works fine (But that is actually not allowed)

I’m using a VF50 module running WEC2013. The serial port is running at 9600 baud

Any one now if it is possible to speed up the latency for the ReadFile/WriteFile on serial port?
Would using OVERLAPPED I/O work?

Thomas

Hi,

You could try disabling DMA inside registry. Go under HKLM\Drivers\Builtin\UARTA and set EnableDMA to 0.

Using overlapped i/o is not supported in the driver.
Also please note that UART on VF module is limited and does not have timeout interrupt, because of this all interrupts are done by additional timers and you may see some delay from sending to receiving byte.

I see…

Is this different on the VF61 modules? Would it be possible to make some FreeRTOS M4 using the UART to make fast read/write trhis way??

Thomas

Controller on VF61 is the same. You could try disabling DMA as I wrote and maybe you get the performance. If not you could try using M4 and do polling not interrupts. If you will do only this on M4 it should give you the performance needed.

I have tried disabling DMA. I give just a minimal performance boost. I could get it down to approx 2 ms.
I will try work with the VF61 option