Your browser does not allow scripts
Please click here to view a static table of contents without scripts
Asynchronous Bit Bang Mode
Return to Introduction  Previous page  Next page
Asynchronous Bit Bang mode is the same as BM-style Bit Bang mode. Any data written to the device in the normal manner will be self-clocked onto the data pins which have been configured as outputs. Each pin can be independently set as an input or an output. The rate that the data is clocked out at is controlled by the Baud rate generator.

For the data to change there, has to be new data written and the Baud rate clock has to tick. If no new data is written to the device, the pins will hold the last value written.


When Asynchronous Bit Bang mode is enabled the IO signal lines are configured as follows:

FT232RL/ FT245RL Pin Number
FT232RQ/ FT245RQ Pin Number


Signal



Type



Description
1
30
D0
Input/Output
Bit Bang Data Bus Bit 0
5
2
D1
Input/Output
Bit Bang Data Bus Bit 1
3
32
D2
Input/Output
Bit Bang Data Bus Bit 2
11
8
D3
Input/Output
Bit Bang Data Bus Bit 3
2
31
D4
Input/Output
Bit Bang Data Bus Bit 4
9
6
D5
Input/Output
Bit Bang Data Bus Bit 5
10
7
D6
Input/Output
Bit Bang Data Bus Bit 6
6
3
D7
Input/Output
Bit Bang Data Bus Bit 7



In the case of the FT232R, CBUS0/CBUS1/CBUS2/CBUS3 can be configured to bring out the internal RD# strobe and  CBUS0/CBUS1 can be configured to bring out the internal WR# strobe when the device is in Asynchronous Bit Bang mode. This is the same as the Enhanced Asynchronous Bit Bang mode of the FT2232 device. Alternatively, the CBUS pins can be used to provide clock signals by setting the appropriate values in the EEPROM. The CBUS must be configured in the FT232R EEPROM. This option is not available for the FT245R.

FT232RL Pin Number
FT232RQ
Pin Number

Signal


Type


Description

23
22
C0
Input/Output
Configurable function
22
21
C1
Input/Output
Configurable function
13
10
C2
Input/Output
Configurable function
14
11
C3
Input/Output
Configurable function



A number of D2XX driver commands are needed to use Asynchronous Bit Bang mode. The commands of interest are listed below:

D2XX Function
Description
FT_SetBitMode
Asynchronous Bit Bang mode is enabled using the FT_SetBitMode command. A value of 0x01 will enable it and a value of 0x00 will reset the device mode.

FT_SetBaudRate
The rate of data transfer can be controlled by using the FT_SetBaudRate command. The maximum Baud rate is 3MBaud, but to allow time for the data to be setup and held around the WR# strobe the Baud rate should be less than 1MBaud.
The clock for the Asynchronous Bit Bang mode is actually 16 times the Baud rate. A value of 9600 Baud would transfer the data at (9600x16) = 153600 bytes per second, or 1 every 6.5
mS.

FT_Write
Data can be written to the device in Asynchronous Bit Bang mode using the FT_Write command. If multiple bytes are written to the device the values on the pins will change at the rate set by FT_SetBaudRate.

FT_GetBitMode
FT_GetBitMode returns the instantaneous value of the pins. A single byte will be returned containing the current values of the pins, both those which are inputs and those which are outputs.

FT_Read
FT_Read will return a buffer of values which have been sampled from the pins at the rate set by FT_SetBaudRate. If the read buffers have filled, data willl be lost. Each byte returned contains the values of the pins, both those which are inputs and those which are outputs.




Full descriptions of these functions are available in the
D2XX Programmer's Guide.

Code examples can be downloaded from
http://www.ftdichip.com/Projects/CodeExamples.htm.