Friday, October 23, 2009

errata on timings

After I did the timings I did some thinking ... And yes I forgot to include the RS232 control bits in my calculation. So in fact when having 1 start bit , 8 data bits , 1 stop bit and no parity there are 10 bits to transfer per byte. So indeed don't forget you have 25% overhead on control bits.
  • serial bit speed 4 500 000 bits/s
  • serial byte+control speed 450 000 bytes /s
  • 4096 bytes transfer in 9,1ms
So the above calculation for the speed is the right one. I measured around 9ms with my scoop so this confirmed the latter. Also the fact I mentioned on the usb latency when only receiving is not correct. I can only measure the real serial speed when hooking in with scoop. Only when testing Rx-Tx complete chain I can deduce the latency. So I must get 18.2 ms to Rx-Tx the 8k ideally.
  • on windows 19.8ms -> 1.6 ms latency
  • on linux 18.8 ms -> 0.6 ms latency
Still some nice results I must say. Far better than using the FTDI in bit bang modes. As I wrote before these modes are far from efficient as they had to transfer byte after byte over the USB.
  • bit bang Tx 84 bytes 200ms
  • bit bang Rx 84 bytes 250ms
Meanwhile I wrote some middle ware software to test the all chain. I can send 16 messages of 256 bytes in one chunk now. Timings are wonderful ! Only 140ms to Tx - I2C -Rx them all. If I compare that with the bit bang mode:

Tx 200 ms * 16 = 3.2 seconds

With my system only 140ms which is a factor 23 faster !

Next blog I will show a small video about my test setup so stay tuned for more on this great interface.

No comments: