C161U
USB Interface Controller
Preliminary Data Sheet
349
02.2000
PRELIMINARY
PRE
LI
M
INAR
Y
- E
XCE
RP
T
-
USBC_CMD_RESET
Reset Value: 0000
H
15.7
Programmers Guidlines: Using USB and EPEC
For normal functionality, the following interrupts must be enabled:
all udc_tx_done- and udc_rx_done-interrupts of those endpoints and in the direction in
which they are used
udc_setup, udc_suspend, udc_suspendoff, udc_start of frame, udc_configval
optional interrupts are the EPEC-interrupt (this interrupt might only be used if SW needs
to have complete control over the contents of the fifos and always wants to keep track of
the status of the transmission) and the UDC_txwr- and UDC_rxrr-interrupts (which are
generated every time, a fifo in the USB-block is ready to accept data or receive-data
might be read from the fifo; this interrupt is connected to the EPEC which in nomal
functionality does this transfer).
By default, the bits 8 and 15 of the CMD register (auto flush enable and tx_protect)
should be set.
15.7.1
Writing the configuration-value
After a system-reset, the USB-block expects the configurator of the UDC to be
transferred via the tx-fifo(0) like a normal in-transfer. Best is using the EPEC for this
endpoint. The source-pointer must be programmed to a memory-block containing the 85
bytes of the configurator, destination to usbd_txwr-register(0) and the length-register to
85 bytes. After starting the EPEC, it will transfer the configurator to the USB-block and
after having transferred all the data, the EPEC-interrupt is generated and if the
configurator went through the fifo, the udc_tx_done-interrupt(0) is also generated.
In order to allow generation of a next interrupt-pulse of the EPEC, SW must read the
EPEC-interrupt-register and clear the interrupt-bit of endpoint 0 by writing a ‘1’ to it.
Table 88
USBC_CMD_RESET USB RESET REGISTER
Bit No.
Bit
Function
(15:1)
Reserved
reserved
(0)
USBC_RST
Resets the USB block including the transmit and receive
logic.
Note: The USB RESET does not reset the USBCLC
register.
Note: The USB reset must be active for at least 10 clock
cycles.
Note: The USB reset must always be activated after the
USB device is connected to the USB