libftdi Archives

Subject: Baudrate for bitbang mode

From: Patrick Domack <patrickdk@xxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Sat, 01 Jan 2011 18:14:54 -0500
I've browsed the maillist but can't seem to locate infomation about this issue really.

I got a TTL-RS232R-5V cable, and was going use it to replicate the signal states at one location, to another one at a different location.

I'm having an issue getting the baudrates in sync between the two of them (in the tests I'm only using the same one, run it in read mode, store the output, then replay recorded data back).

I have found if I set the baudrate after I switch into bitbanging mode, it seems to have no effect. If I switch it before, it sets the baud rate to 8x what I set it to, but if it goes up around 500kbit or higher baud, it gets inconsistant.

Using the baud_test sample program, in serial mode it's accurate, in async mode (-m a), it gives:

./libftdi-0.18/examples/baud_test -m a
real baudrate used: 9600
this test should take 10.42 seconds
and took 42.5663 seconds, this is 2349 baud or factor 0.245

Tests using my program, and setting the baudrate before switching into bitbang mode show, for reading:

Took 34.0593, approx baud of 154017, set baud 19200, data size 5245696

and for writing baud*2, found using baudrates >57600 needed baud*4:

Took 34.7484, approx baud of 150962, set baud 38400, data size 5245696



--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx
Current Thread
  • Baudrate for bitbang mode, Patrick Domack <=