
Abstract:The main function is FT245BM USB and parallel I / O port protocol conversion between. FT245BM detail the working principle of the chip, internal structure, distribution and function of pin; FT245BM interface circuit is given based on the typical driver and application software design and the preparation method.
Introduction
1 Overview
At present, USB peripheral development is a hot spot. The USB bus with transmission speed, less resource and the true plug and play, etc., more and more favored by the industry. However, USB's development requires the designer of the USB standard, Firmware (firmware) programming and the preparation of such drivers are more in-depth understanding, thus limiting the USB developers; FT245BM chip USB-based product development, enabling R & D personnel in the shortest period to develop the appropriate USB products. The chip from the FTDI (Future Technology Devices Intl. Ltd.) Launched, simple to use, excellent performance, long familiar with microcontroller programming and simple VB, VC application programming, users can easily carry out product development.
2 FT245BM Chip Features
FT245BM's main function is USB and parallel I / O port protocol conversion between. Chip on the one hand to receive USB data from the host and converts it to parallel I / O port to send the data stream format peripherals; other peripherals via the parallel I / O USB port to convert the data format of the data transfer back to the host. Conversion between all the work done automatically by the chip, developers need to consider the design of the firmware.
FT245BM mainly by the internal USB transceiver, Serial Interface Engine (SIE),USB protocol engine and the first in first out (FIFO) controllers, etc., shown in Figure 1. USB transceiver provides USB1.1 / 2.0 full-speed physical interface to the USB bus, support for UHCI / OHCI host controller; serial interface engine, USB data is mainly used to complete the string / and two-way conversion, completed in accordance with USB1.1 specification USB data stream bit stuffing / bit anti-filled, and the cyclic redundancy check code (CRC5/CRC16) generation and error detection; USB protocol engine management device control from the USB port of the data stream; FIFO controller handles the external interfaces and send and receive data between the buffer conversion.
FIFO controllers and microcontrollers (such as the AT89C51, etc.) interface, mainly through the eight data lines D0 ~ D7, and read-write control line (, WR, and) to complete and SCM data exchange. FT245BM includes two FIFO data buffer, a 128 byte receive buffer and the other is to send 384 byte buffer. They are used for USB data and parallel I / O port data exchange buffer.
In addition, FT245BM also includes a built-in 3.3 V regulator, a 6 MHz oscillator, the clock frequency multiplier 8, USB PLL and EEPROM interface. FT245BM PQFP 32-pin package, compact size, easy to make a board and peripherals. Its shape and pin assignment shown in Figure 2, the functional description of each pin listed in Table 1.
Pin Function Table 1 FT245BM
Pin No. Pin Name Type Pin Function
25 D0 I / O Bi-directional data bus
24 D1 I / O Bi-directional data bus
23 D2 I / O Bi-directional data bus
22 D3 I / O Bi-directional data bus
21 D4 I / O Bi-directional data bus
20 D5 I / O Bi-directional data bus
19 D6 I / O Bi-directional data bus
18 D7 I / O Bi-directional data bus
16 RD IN From low to high, allowing to read data from the receive data buffer
15 WR IN From high to low, allowing to send data to data buffer
14 TXE OUT Is low, allowing the data written to the transmit data buffer
12 RXF OUT Is low, allowing the data to be read data buffer
7 USBDP I / O USB data signal lines D +, then the upper resistance of 1.5kO to 3.3V
8 USBDM I / O USB data signal line D-
32 EECS I / O EEPROM chip select line
1 EESK OUT EEPROM Clock
2 EEDATA I / O EEPROM data line
10 PWREN OUT Power enable line
11 SI / WU IN Send a message immediately, or wake-up signal line
4 RESET IN Reset pin
5 RSTOUT OUT Internal reset generator output pin
27 XTIN IN Clock input pin
28 XTOUT OUT Clock output pin
31 TEST IN Test pin
6 3V3OUT OUT 3.3V output pin
3,26 VCC PWR Battery, +4.4 ~ 5.25V
13 VCCIO PWR Control pin 10 ~ 12,14 ~ 16,18 ~ 25, the signal level, +3.0 ~ +5.25 V
9,17 GND PWR Power ground
30 AVCC PWR Internal analog power supply
29 AGND PWR Internal analog power supply to
3 Hardware Design
FT245BM typical hardware shown in Figure 3.This circuit uses the bus-powered mode, while using power-on reset mode, reset by the output of the microcontroller. Clock circuit can be 4 feet 6 MHz crystal oscillator module or from a 6 MHz crystal and two 33 pF of capacitance. Feet and I / O 24 pins connected, used to judge the USB bus is in a suspended state or normal state. USB interface in the supply side with a bead to reduce the interference of host and device; the same time, increase the power side decoupling and bypass capacitors to improve the circuit robustness. In the PCB board design, the alignment of the data line should be as short as possible and of equal length. Figure 3 93C46 (93C56 or 93C66) is an EEPROM, for storing products, VID, PID, serial number of equipment and some explanatory text. These require the user to write your own, write an application provided by the FTDI. VB users only need to run the corresponding application, write the appropriate information to their own. The EEPROM is optional. If no EEPROM, FT245BM will use the default VID, PID, product descriptors and power descriptor, and no device serial number.
Figure 3 FT245BM typical hardware Click to enlarge
4 software programming
When FT245BM the USB interface to connect to host, must be installed on a PC, provided free by the FTDI virtual serial port VCP (Virtual COM Port) driver. The driver is compatible with Windows 98 / 98 SE, Windows 2000/ME/XP the different versions. Users can in this virtual serial port application development on. The virtual serial port can be like a standard physical serial ports, as is access to essentially all of the virtual serial port for data communication is done through the USB bus, the device-side through the parallel I / O port to complete.
In the PC side, the application of VB on the virtual serial port (usually COM3) for application programming. We direct application of MSComm control, will MSComm3.CommPort set to 3, MSComm3.Seetings set to "9600, n, 8,1" (the rate of default, in fact, the data VCP driver is always the fastest rate of transmission) ; by MSComm3.PortOpen set COM3 to switch state; by MSComm3.Input and MSComm3.Output read or output data. When reading the data, set MSComm3.Rthreshold the value of 1. As long as there is data transfer to PC, to immediately trigger MSComm3.CommEvent events, automatically read the data COM3; and send data can be sent automatically or manually by the user's own settings. According to these, users can easily write your own applications.
In the device side, based on Manley's Insight SE-52 simulator program. Figure 4 shows the timing diagram of receiving data, first, to be sampled to the signal is low, if low, indicating that the machine has received the data from the PC, allowing the MCU data bus by the eight read data D0 ~ D7. Then, through the signal changes from low to high latch data (read data). Finally,Delay time, start the next byte read. Software flow shown in Figure 5. The process of sending data can send the data shown in Figure 6, timing diagram, prepared by the same token programs that send data. Equipment program can be further developed on this basis that the user according to their specific project programming.
5 Conclusion
USB interface, using FT245BM for the development of simple, easy, short development cycle, easy to use for engineering practice; the same time, can also be used for new product development, such as the USB interface, digital cameras, MP3 players and wireless USB Interface Modem in USB interface