AN4000| Application Note

AN4000 PDF

AN4000| Application Note


Maxim/Dallas > App Notes > INTERFACE CIRCUITS Keywords: USB, host, MAX3421, MAX3421E, embedded

Feb 13, 2007

APPLICATION NOTE 4000

MAX3421E-Revisions 1 and 2 Host OUT Transfers
Abstract: This application note discusses the MAX3421E-Revisions 1 and 2 acting as a host USB controller. The MAX3421E sends data to a USB peripheral using a double-buffered Send FIFO. In Revs 1 and 2 of the part, special consideration is required for programming OUT transfers. This application note describes the sending mechanism. Example code for programming single-buffered and double-buffered OUT transfers is given.

Introduction
The MAX3421E is a USB host/peripheral controller that, when operating as a host, uses a double-buffered Send FIFO to send data to a USB peripheral. This FIFO pair is controlled by two registers: R2: SNDFIFO, the FIFO data register R7: SNDBC, the byte count register The microcontroller repeatedly writes the SNDFIFO register R2 to load the FIFO with up to 64 data bytes. Then the microcontroller writes the SNDBC register, which this does three things: 1. Tells the MAX3421E SIE (Serial Interface Engine) how many bytes in the FIFO to send. 2. Connects the SNDFIFO and SNDBC register to the USB logic for USB transmission. 3. Clears the SNDBAVIRQ interrupt flag. If the second FIFO is available for uC loading, the SNDBAVIRQ immediately reasserts.

Figure 1. The SNDFIFO and SNDBC registers load a "ping-pong" pair of FIFOs and byte count registers. As illustrated in Figure 1, the first FIFO byte does not come from the physical FIFO. Instead, the first FIFO byte comes from a synchronization register used to reconcile two internal clock domains, one for the microcontroller and the other for the USB logic.

Programming Single-Buffered Transfers
For simple transfers that are not bandwidth-critical, the firmware to send a packet is relatively straightforward. The steps are: 1. Load the SNDFIFO. 2. Load the SNDBC register. 3. Launch the transfer by writing the HXFR register with the OUT PID and end-point number.


AN4000 Application Note maxim Download PDF

Add this permalink to your bookmarks for future download of AN4000 ApplicationNote

Permalink: http://application.emcelettronica.com/maxim/AN4000

PDF AN4000 APPLICATION NOTE