Maxim MAX3420E Music Mixer User Manual


 
9. How do I program a SETUP transfer?
The USB host uses a CONTROL transfer to send a SETUP packet to the MAX3420E along with
eight bytes that serve as a USB "op-code". The MAX3420E stores these bytes in an 8-byte FIFO,
and then asserts a Setup Data Available interrupt request. The SPI master responds by reading
the eight SETUP bytes at register address R4 (SUDFIFO), interpreting the USB request from
these bytes, and taking the appropriate action. When finished servicing the request, the USPI
master sets a bit called ACKSTAT (ACK from acknowledge, STAT from STATUS stage) to tell the
MAX3420E to acknowledge the status stage of the CONTROL transfer.
10. Do I need to program the USB data toggles?
No. The MAX3420E handles these toggles automatically during USB transfers. The only time
firmware might need to intervene is when the host sets a new configuration in a
multiconfiguration design (these are rare). The MAX3420E has register bits to clear the endpoint
toggles for this purpose.
11. The MAX3420E interrupt request bits are cleared by writing "1" to them. Is this
backwards?
It may seem backwards at first, but it is the most efficient way to clear a register bit. To service
a typical interrupt request, the SPI master reads an interrupt request register (either USBIRQ or
EPIRQ), and checks using various bit masks to determine the source of the interrupt. For
example, to test for the SUDAVIRQ interrupt request, firmware would read R11 (EPIRQ) and AND
the result with 00100000 (the SUDAVIRQ bit is in the bit 5 position). Typically a program will
equate a label like bmSUDAV with 0010000. Once the IRQ bit is detected to be a 1, the firmware
can simply write the mask value back to the register (SUDAVIRQ = bmSUDAV) and only the
desired bit is cleared. IRQ bits written with a zero are unchanged.
12. Do you have any programming tips?
When using the SPI full-duplex mode, the very first register access should set the FDUPSPI bit to
1 in order to correctly set up the interface for subsequent accesses.
5.
Host Software Questions
1. How does my Windows® application talk to the MAX3420E?
A Windows® application talks to the PC's USB host controller through a driver. The driver may
be built into Windows or it may be custom. Windows includes built-in drivers for standard device
classes, such as Human Interface Devices (HID) and Mass Storage Devices. If your firmware
supports one of these standard classes, your customer does not need to load a custom driver.
If you are designing a device that does not conform to one of the built-in Windows standard
device classes, the end user must install a custom driver when your USB device is plugged in the
first time.
2. Does Maxim supply a custom Windows driver?
No.
3. What example code does Maxim supply?
You can find example C code for implementing a HID application on the Maxim website at
USB
Enumeration Code (and More) for the MAX3420E. This example code emulates a PC keyboard,
which types a text string into any Windows application that accepts text (e.g., Notepad)
whenever a pushbutton is pressed. By conforming to the standard HID class, the application runs
without a custom Windows driver. Regardless of your target application, most of this example
code is USB 'boilerplate' that can be used as a starting point for your code.
4. I want to design a MAX3420E-based device that does not conform to a standard
Windows class. What do I use for a Windows driver?
There are two alternatives:
Write the Windows driver yourself. This is complex and difficult, recommended for
specialists only.