Sunday, October 18, 2009

some more timings

Here are some results with maximum speed (maximum cortex USART1 speed):

Test setup:
  • serial speed 4.5 MB/s -> ca 549 kb/s
  • tx/rx buffers taken 4k bytes
  • cortex DMA transfer used on both rx/tx
  • host PC1 with window 7 RC drivers 2.04.16
  • host PC2 with linux ubuntu 9.04 2xx so 0.4.16
  • FTDI latency on 1ms
So tx/rx theoretical time should be 7.28 ms / 4k.

Win7 Project written in C with VC 2008 using the 2xx FTDI DLL:
  • PC tx - Cortex rx time 8.9 ms / 4k
  • PC tx - Cortex rx- Cortex tx - PC rx time 19.8ms / 8k
Linux Project written in gnu C (gcc) using 2xx shared 2xx lib:
  • PC tx - Cortex rx time 8.9 ms / 4k
  • PC tx - Cortex rx- Cortex tx - PC rx time 18.8 ms / 8k
Linux Project written in java NB with RXTX:
  • Test succeeded only with baud rate at 9600 !!!
  • Bad results not comparable
Conclusion:

USB latency is now dropped to

--> 1,5 ms / 4K
--> 3 ms / 8K

Which can be seen as the normal due to the minimum USB latency timeout of 1ms.

You notice that Linux can perform 1ms better with 8k than win 7 ! Again a proof that for some processing Linux performs much faster than windows. The java test on linux was very bad. As soon speeds were higher than 9600 the receiver could not follow at all and stayed suspended on the read function. I don't know the reason for this but probably a mix of causes ( jre , rxtx lib and driver )

Any way I know for now that I can proceed using the 2xx DLL which performs very good and offers a nice portability between windows and Linux. You can simply take your code from one project to the other. However on linux you have to make sure that ftdi_sio and usbserial are unloaded with rmmod. Your user program will only run with sudo as root. I must investigate that further but is less important.

I continue in making the message layout buffers and programming the cortex to understand the commands. As soon I have some overall results I will write one last topic here.




No comments: