Programming questions, How does my firmware talk to the max3420e, How do i program a bulk in transfer – Maxim Integrated MAX3420E User Manual

Page 5

Advertising
background image

interrupts?
The MAX3420E supports both interrupt types, using a control bit called INTLEVEL. Setting
INTLEVEL=1 makes the INT output pin open-drain, active-low for wired-OR applications. This
mode requires an external pullup resistor to V

L

. Setting INTLEVEL=0 (the default value)

makes the INT pin edge-active with a push-pull output driver. In edge mode, a second bit
called POSINT sets the edge polarity to positive or negative.

7. How fast can I run the MAX3420E SPI interface (SCLK max frequency)?

With V

L

of 2.5V or greater, the SCLK signal can be as high as 26MHz. For lower V

L

values,

the data sheet shows how much to derate the SCLK maximum frequency.

8. Is there a low limit to the MAX3420E SCLK frequency?

No. This clock can be held high or low indefinitely. Also, the MAX3420E ignores SCLK
transitions while SS# is high.

9. I have an 8-pin microprocessor, and it takes 5 of its' IO pins to connect to the

MAX3420E. How do I do IO?
The MAX3420E has four general-purpose outputs (GPOUT3-0) and four general-purpose input
pins (GPIN3-0) that are set and read using the IOPINS register, R20. This replaces the
microcontroller pins used to implement the SPI interface, and provides additional ones.

10. Do I need to add external pullup resistors to the GPIN pins?

No. The GPIN pins are internally pulled up (typical value of 20kΩ) to V

L

.

11. Can I drive optocouplers from the SPI interface pins?

Yes. The MAX3420E outputs have enough drive current to drive optocoupler LEDs through
series resistors. Consult the data sheet for exact drive specs. The output buffers were
designed with opto-isolation in mind, since the MAX3420E SPI interface is uniquely suited to
electrically isolating USB.

12. What is the purpose of the VBCOMP pin? Does it power the MAX3420E?

No. The VBCOMP pin does not power anything in the MAX3420E. It goes only to an internal
comparator to detect the presence of V

BUS

.

4. Programming Questions

1. How does my firmware talk to the MAX3420E?

The MAX3420E has a set of 21 registers that are accessed by its slave SPI interface. The SPI
master first sends a command byte that sets the register address and direction, and then
transfers one or more data bytes.

2. How do I program the MAX3420E to handle USB enumeration?

As a peripheral, the MAX3420E device needs only to respond to requests from the host
(usually a PC).

3. How do I program a BULK IN transfer?

When you have data ready to send to the host, load an IN FIFO, then write the byte count
register for the particular endpoint. Since the IN FIFOs are 64 bytes in length, up to 64 bytes
can be loaded at a time. When finished loading the data, write the IN endpoint BYTECOUNT
register with the number of bytes loaded into the IN FIFO. Writing the byte count register
"arms" the endpoint for USB transfer. The MAX3420E does the rest. The next IN request to its

Page 5 of 9

Advertising