![]() |
RS-232 was quite simplistic. While the specs defined the electrical characteristics, little was said about the protocol. RS-232 was a simple communications channel. Send a binary or ASCII byte down the wire and it gets received by the other end. This allowed RS-232 to be used effortlessly for just about anything. Most designers would develop their own protocols which sat on top of RS-232. Then comes along USB with all its complexities. Enumeration, device descriptors, endpoints, tokens, message pipes, control/bulk/interrupt/isochronous transfers, WDM device drivers - enough! No longer is it something you can wack on your microcontroller in 30 minutes. However if you are just starting out in USB and want to get something happening quickly without any hassles of enumeration, device descriptors and the works then FTDI may have two ICs which interest you. One provides a simple asynchronous channel, the other a byte wide FIFO interface with little need to even glance at the USB Spec. FTDI brought out the FT8U232AM as a legacy USB to RS-232 Converter. It doesn’t require any programming, simply solder the device down and switch it on. While they can be used for USB to RS-232 adaptors they are also a quick way to make an existing product USB compliant.
But won't this device enumerate as a FTDI USB <-> RS-232 making my product look sub-standard? Yes, you are quite right - if you don’t include a serial EEPROM. But for a extra $1 you can surface mount down a SO8 serial EEPROM and program it with your PID/VID, manufacturer string, product string and serial number string. Now when your customers plug in your device they see the "Bells and Whistles USB Data Logger" made by "my company XYZ." FT8U232AM - USB UltraBaud Transfer IC with RS-232/RS422 and CPU I/F Options While the external 93C46 can dictate a new set of VID/PID and strings, it can also set up the maximum power in the USB Configuration Descriptor. This is handy when you plan to use the FT8U232AM in a bus powered design. The '232AM has a PWRCTL pin which is tied low for bus powered designs and tied high for self powered designs. The status of this pin is reflected in the configuration descriptors bmAttributes field, allowing the '232AM to be used in devices that are bus or self powered without the need of reprogramming the EEPROM each time or on loss of self power. In a bus powered design under suspend conditions the entire device can only drain 500uA from Vbus, a limitation imposed by the USB Standard. The '232AM provides a sleep pin which can be connected to the RS-232 line drivers (in the case of a USB to RS-232 dongle) or other circuitry to place the devices in sleep modes and hopefully meeting the low power suspend requirements of the spec. The '232AM also provides a USBEN output which goes high once the device has been configured by the host. The FTDI documentation suggests it could be used in devices with both USB and RS-232 ports to control a multiplexer to switch control between ports. Another use could be in high powered bus functions which can drain up to 500mA (5 load units) but is not permitted to drain any more than 100mA (1 load unit) until they are configured. This pin could enable the extra load once the device is configured, such as charge pumps or LCD/user interfaces etc. But while this device has many advantages for legacy devices, it shouldn’t be dismissed for new designs either. While the legacy VCOM drivers may put some off on the PC side, the good news is VCOM isn’t the only way to talk to your new FT8U2XXAM device. You can also use FTDI’s direct driver FTD2XX. This does away with the hassles of legacy com port interfaces and worries of device drivers by providing a series of .DLL calls your user mode program can call to interrogate your device. But designing a new device around the FT8U232AM could lead to performance problems. While USB has a data rate of 12Mbits per second ignoring protocol overheads, the FT8U232AM can only handle 2Mbits per second and worse still, many microcontrollers can only handle a couple hundred bits per second on their asynchronous interfaces. Therefore FTDI has an 8 byte parallel FIFO version. It shares the same USB descriptors, same PID/VID, but removes the asynchronous serial interface in preference for a bi-directional 8 bit FIFO interface capable of 1Mbytes per second or 8Mbits per second. This device provides RD/WR control lines enabling it to be memory mapped on a microcontroller’s bus, but omits a chip select thus you need additional glue logic for address decoding. FT8U245AM - Fast Parallel Data Transfer IC While it doesn’t provide a DMA interface as such, it does provide RXF and TXE pins indicating the FIFO’s status. These could be used to control DMA or interrupts with a little glue logic, or a more popular choice at present is to map these pins into a status register, so you can read and write data to the device on one port and check the FIFO's status on another. The FT8U245AM lacks the PWRCTL (Bus Powered/Self Powered Input), USBEN (USB Enabled) and sleep pins that it's '232AM counterpart has. As Fred Dart from FTDI points out, the '245AM enumerates as a bus powered device. This allows the device to be used "in practice" as a bus powered device or a self powered device. When used in a self powered device, the FT8U245AM draws little or no current from Vbus and thus is well within the power requirements of self powered devices. It's also possible to detect a sleep condition on the '245AM as the RCCLK input goes low during suspend. Adding a high impedance CMOS buffer allows the ability to detect this condition, while not loading or effecting the RC time constant required to maintain oscillator stability when the device comes out of suspend. In many cases the omission of these pins isn't a significant limitation, as this device is normally tacked on to a larger embedded system with it's own power supply. One such example is Jeff Pollard's PC 104 adaptor published in Circuit Cellar, Issue 132, July 2001. The serial EEPROM on both devices can be programmed effortlessly over USB with a application (FTD2XXST EEPROM serialiser and tester utility) from FTDI. There is no need to program the EEPROM before soldering to your board. Summary
Add USB in 10 minutes! For those of us who can't wait long enough to build a board can find prebuild modules from Ravar.net. These modules are available in both serial and parallel interface versions and are priced at US$27ea ($50 AUS). This makes them an ideal USB add on solution for Microchip, AVR and other microprocessors. The serial version gives you the flexibility of adding it to your existing asynchronous comms port leaving the parallel I/O ports free or if you need speed, you can use the USBMOD2 with a parallel interface capable of 1Mbyte/sec.
These modules are also available from DonTronics Gigatechnology & DonTronics sells the FT8U232AM/BM and FT8U245AM/BM bare chips. Click for current prices. |