Future Technology Devices International Ltd. AN232R-01 Bit Bang Modes for the FT232R and FT245R Copyright © 2006 Future Technology Devices International Ltd.
11
Bit Bang Modes for the FT232R and FT245R
1.1
Overview
Bit Bang mode is a special FT232R and FT245R device mode that changes the 8 IO lines into an 8 bit bi-directional data bus.  There are three types of Bit Bang mode for the FT232R: •  Asynchronous Bit Bang Model 3 , which is the same as the FTDI BM and C chip-style Bit Bang mode, with the addition of Read and Write strobes in the case of the FT232R. • Synchronous Bit Bang Model by, where data is only read from the device when the device is written to.  This is the same as the FT2232 Synchronous Bit Bang mode. • CBUS Bit Bang Mode [ 3 ], a new 4-bit version of Bit Bang mode is available on the FT232R CBUS pins. Asynchronous and Synchronous Bit Bang modes are enabled by driver commands, while CBUS Bit Bang must be set up in the device EEPROM before it can be enabled with a driver command.
1.2
Asynchronous Bit Bang Mode
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:
In the case of the FT232R, any of CBUS0, CBUS1, CBUS2 or CBUS3 can be configured to bring out the internal RD# or WR# strobes 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.
A number of D2XX driver commands are needed to use Asynchronous Bit Bang mode.  The commands of interest are listed below:

1.3
Synchronous Bit Bang Mode
Synchronous Bit Bang mode is the same as the FT2232 Synchronous Bit Bang mode.  With Synchronous Bit Bang mode, data will only be sent out if there is space in the device for data to be read from the pins.  This Synchronous Bit Bang mode will read the data bus pins first, before it sends out the byte that has just been transmitted.  It is therefore 1 byte behind the output and so to read the inputs for the byte that you have just sent, another byte must be sent.  For example: ● Pins start at 0xFF ●  Send 0x55, 0xAA ●  Pins go to 0x55 and then to 0xAA ●  Data read = 0xFF, 0x55 ●  Pins start at 0xFF ●  Send 0x55, 0xAA, 0xAA (repeat the last byte sent) ●  Pins go to 0x55 and then to 0xAA • Data read = 0xFF, 0x55, 0xAA The timing for Synchronous Bit bang is described in this diagram and the table below: Time
Description

Current pin state is read t2 RD# is set inactive t3 t4 RD# is set active again, and any pins that are output will change to the new data. Clock state for data setup
WR# goes active t6 WR# goes inactive 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 Synchronous Bit Bang mode is enabled the IO signal lines are configured as follows:
In the case of the FT232R, any of CBUS0, CBUS1, CBUS2 or CBUS3 can be configured to bring out the internal RD# or WR# strobes when the device is in Synchronous Bit Bang mode. 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.
A number of D2XX driver commands are needed to use Synchronous Bit Bang mode.  The commands of interest are listed below:

1.4
CBUS Bit Bang Mode
The FT232R supports a new type of Bit Bang mode on the CBUS pins.  The CBUS Bit Bang mode must be configured in the FT232R EEPROM and then enabled with a FT_SetBitMode command to function.  It is not available on the FT245R. When CBUS Bit Bang mode is enabled the CBUS pins are configured as follows:
The FT_SetBitMode and FT_GetBitMode D2XX commands are required to communicate with CBUS Bit Bang.  Since these functions allow only a single byte to be sent or received, this version of Bit Bang is much slower than the Asynchronous and Synchronous Bit Bang types when used to transfer large buffers of data with FT_Write and FT_Read, but it does provide an additional 4 IO pins for the FT232R.  The data transfer rate is limited by USB frames. The D2XX commands required to use CBUS Bit Bang mode are listed below:
For example: FT_SetBitMode(Handle, 0xF1, 0x20) Set all pins to output with bit 0 high: Set bits 0 and 1 to input, bits 2 and 3 to output and make bits 2 and 3 FT_SetBitMode(Handle, 0xCC, 0x20) high: Read pins: 0x0F) FT_GetBitMode(Handle, Data) where the lower nibble is given by (Data AND 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.
1.5
FT232R Datasheet FT245R Datasheet D2XX Programmer's Guide Sample Projects
Neither the whole nor any part of the information contained in, or the product described in this manual, may be adapted or reproduced in any material or electronic form without the prior written consent of the copyright holder. This product and its documentation are supplied on an as-is basis and no warranty as to their suitability for any particular purpose is either made or implied. Future Technology Devices International Ltd. will not accept any claim for damages howsoever arising as a result of use or failure of this product. Your statutory rights are not affected. This product or any variant of it is not intended for use in any medical appliance, device or system in which the failure of the product might reasonably be expected to result in personal injury. This document provides preliminary information that may be subject to change without notice. Head Office - Glasgow, UK Future Technology Devices International Limited 373 Scotland Street Glasgow G5 8QB United Kingdom Tel: +44 (0) 141 429 2777 Fax: +44 (0) 141 429 2758 E-Mail (Sales): sales1@ftdichip.com E-Mail (Support): support2@ftdichip.com E-Mail (General Enquiries): admin1@ftdichip.com Web Site URL: http://www.ftdichip.com Web Shop URL: http://apple.clickandbuild.com/cnb/shop/ftdichip Branch Office - Taiwan Future Technology Devices International Limited (Taiwan) 4F, No 16-1, Sec. 6 Mincyuan East Road Neihu District Taipei 114 Taiwan ROC Tel: +886 2 8791 3570 Fax: +886 2 8791 3576 E-Mail (Sales): tw.sales1@ftdichip.com E-Mail (Support): tw.support1 @ftdichip.com E-Mail (General Enquiries): tw.admin1@ftdichip.com Web Site URL: http://www.ftdichip.com Branch Office - Hillsboro, Oregon, USA Future Technology Devices International Limited (USA) 5285 NE Elam Young Parkway Suite B800 Hillsboro, OR 97124-6499 USA Tel: +1 (503) 547-0988 Fax: +1 (503) 547-0987 E-Mail (Sales): us.sales@ftdichip.com E-Mail (Support): us.support@ftdichip.com E-Mail (General Enquiries): us.admin@ftdichip.com Web Site URL: http://www.ftdichip.com Agents and Sales Representatives Please visit the Sales Network page of the FTDI Web site for the contact details of our distributor(s) in your country.
- A - Asynchronous Bit Bang Mode 3 - - CBUS Bit Bang Mode 8 Contact 12 Disclaimer 11 E-Mail 12 FT232R 3, 5, 8 FT245R 3, 5 History 10 5 Synhcronous Bit Bang Mode