Token register – Lantronix DSTni-EX User Manual

Page 55

Advertising
background image

47

Token Register

The Token register performs USB transactions when in host mode (HOST_MODE_EN=1).
When the host microprocessor wants to execute a USB transaction to a peripheral, it writes the
TOKEN type and endpoint to this register. After this register is written, the USB begins the
specified USB transaction to the address contained in the Address register.

The host microprocessor must always check that the TOKEN_BUSY bit in the control register is
not set before performing a write to the Token register. This ensures that token commands are
not overwritten before they execute.

The Address register is also used when performing a token command and therefore must also
be written before the Token register. The Address register is used to correctly select the USB
peripheral address that will be transmitted by the token command.

The SOF Threshold register is used only in host mode. When host mode is enabled, the 14-bit
SOF counter counts the interval between SOF frames. The SOF must be transmitted every 1us
so the SOF counter is loaded with a value of 12000. When the SOF counter reaches zero, a
Start-of-Frame (SOF) token is transmitted. The SOF Threshold register programs the number of
USB byte times before the SOF to stop initiating token packet transactions. This register must
be set to a value that ensures that other packets are not actively being transmitted when the
SOF timer counts to zero. When the SOF counter reaches the threshold value, token
transmission stops until after the SOF has been transmitted. The value programmed into the
Threshold register must reserve enough time to ensure that the worst case transaction will
complete. In general, the worst case transaction is a IN token, followed by a data packet from
the target, followed by the response from the host. The actual time required is a function of the
maximum packet size on the bus. Typical values for the SOF threshold are:

64 byte packets=74

32 byte packets=42

16 byte packets=26

8 byte packets=18

Advertising