|
Taking a Look at the USB
by Don Powrie
Start ý Speed
Limit ý The Mechanics ý Destination
ý Sources and PDF
THE MECHANICS
The FT8U245AM is available from FTDI
in surface-mount form as a 32-pin MQFP, and samples of the FT8U245AM
are available through Saelig. The evaluation board (DLP-USB1) can
be seen in Photo 1.
|
|
| Photo 1ýThe DLP-USB1 from DLP
Design allows you to easily evaluate the FT8U245AM. Mounting
pins on 0.1ý spacings
makes easy work of interfacing to target electronics. |
Interfacing to the FT8U245AM is made
via eight data lines and four handshaking lines, as outlined in Figure
1 and Table 1. The FT8U245AMýs internal FIFO is comprised of two buffers,
which can hold 128 bytes of received data coming from the host PC
and 384 bytes of data to be transmitted to the host.
|
|
| Figure 1ýThe FT8U245AM communicates
with a target microcontroller via an 8-bit data bus and four
handshaking lines. |
Additional circuitry can be used
to detect when the device enters Standby mode. This is usually nothing
more than a quad NAND gate
|
Pin
|
Direction
|
Function
|
|
*RD
|
Input
|
When pulled low, *RD takes the
eight data lines from a high impedance state to the current
byte in the FIFOýs receive buffer. Taking *RD high returns
the data pins to a high impedance state and prepares the next
byte (if available) in the FIFO to be read.
|
|
WR
|
Input
|
When taken from a high state
to a low state, *WR reads the eight data lines and writes
the byte into the FIFOýs transmit buffer. Data written to
the transmit buffer is immediately sent to the host PC and
placed in the RS-232 buffer, which is opened by the application
program.
|
|
*TXE
|
Output
|
When high, the FIFOýs 384-byte
transmit buffer is full or busy storing the last byte written.
Do not attempt to write data to the transmit buffer when *TXE
is high.
|
|
*RXF
|
Output
|
When low, at least one byte is
present in the FIFOýs 128-byte receive buffer and is ready
to be read with *RD. *RXF goes high when the receive buffer
is empty.
|
|
Table 1ýThe FT8U245AMýs four
handshaking lines give the target microcontroller complete
access to the FIFO buffer.
|
.
Power for your target electronics can
be taken from the USB port, provided you are careful not to exceed
the limits of 500 mA during normal operation and 500 ýA when in Standby
mode. The FT8U245AM enters Standby mode after 3 ms of no USB activity
(meaning there is no start of frame packets). Meeting this power specification
will require that you shutdown your target electronics when the FT8U245AM
enters Standby mode, most likely by adding a MOSFET power switch or
switches.
The product ID (PID), vendor ID (VID),
device description, and manufacturer name can be stored in an EEPROM
device via a built-in interface on the FT8U245AM. The EEPROM can also
store a unique serial number that is generated and written by the
program 232PROG.EXE, which can be downloaded from FTDIýs web site.
If you are planning to commercialize a product with a USB port, you
must register your own PID and VID with the USB-IF.
USB analyzers are available from a number
of companies and tend to be rather expensive, but they are worth the
money if you are attempting to isolate an elusive software bug. The
level of information that is provided by these analyzers requires
that you be extremely familiar with the USB specification. At this
level of understanding, you will probably want to write your own drivers.
PREVIOUS
NEXT
Circuit Cellar provides up-to-date information for engineers. Visit
www.circuitcellar.com for
more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com
or subscribe online.
ýCircuit Cellar, the Magazine for Computer Applications. Posted with
permission. |