SN8F2270B Series
USB 2.0 Low-Speed 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 87
Version 1.3
9.3 USB INTERRUPT
The USB function will accept the USB host command and generate the relative interrupts, and the program counter will
go to 0x08 vector. Firmware is required to check the USB status bit to realize what request comes from the USB host.
The USB function interrupt is generated when:
‧
The endpoint 0 is set to accept a SETUP token.
‧
The device receives an ACK handshake after a successful read transaction (IN) from the host.
‧
If the endpoint is in ACK OUT modes, an interrupt is generated when data is received.
‧
The USB host send USB suspend request to the device.
‧
USB bus reset event occurs.
‧
The USB endpoints interrupt after a USB transaction complete is on the bus.
‧
The NAK handshaking when the NAK interrupt enable.
The following examples show how to avoid the error of reading or writing the endpoint FIFOs and to do the right USB
request routine according to the flag.
9.4 USB ENUMERATION
A typical USB enumeration sequence is shown below.
1. The host computer sends a SETUP packet followed by a DATA packet to USB address 0 requesting the Device
descriptor.
2. Firmware decodes the request and retrieves its Device descriptor from the program memory tables.
3. The host computer performs a control read sequence and Firmware responds by sending the Device descriptor
over the USB bus, via the on-chip FIFO.
4. After receiving the descriptor, the host sends a SETUP packet followed by a DATA packet to address 0 assigning a
new USB address to the device.
5. Firmware stores the new address in its USB Device Address Register after the no-data control sequence
completes.
6. The host sends a request for the Device descriptor using the new USB address.
7. Firmware decodes the request and retrieves the Device descriptor from program memory tables.
8. The host performs a control read sequence and Firmware responds by sending its Device descriptor over the USB
bus.
9. The host generates control reads from the device to request the Configuration and Report descriptors.
10. Once the device receives a Set Configuration request, its functions may now be used.
11. Firmware should take appropriate action for Endpoint 0~2 transactions, which may occur from this point.