Do you have any programming tips, Host software questions, Does maxim supply a custom windows driver – Maxim Integrated MAX3420E User Manual

Page 7: What example code does maxim supply

Advertising
background image

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.
Purchase a general-purpose driver. These typically consist of the USB driver and a
companion library of C functions to access the driver. Drivers are matched to the VID
(Vendor ID) and PID (Product ID) in your device descriptor.

Microsoft has announced a general-purpose BULK driver for USB in the upcoming "Vista"
version of Windows.

5. How does the MAX3420E compare with USB 'serial bridge' chips?

Page 7 of 9

Advertising