Download Developing USB PC Peripherals
Transcript
USB Enumeration Code For example, say seven to nine bytes of data are stored every frame into internal RAM of the device from a 64 kbps PCM codec. The SOF interrupt can be used to initiate transfer of these bytes into the transmit FIFO for transmission to the host. The same SOF interrupt can also be used for the transfer of isochronous data from the host. Note that you'll need to use the FIFO in dual packet mode for isochronous transfer. The dual packet mode provides a method to match the rate of voice codec, 64 kbps in this example, to the USB rate of 12 Mbps. The user manual of the 8x930Ax[3] describes the above routines in greater details. 5.4 USB Enumeration Code A USB enumeration code example, USB_ENUM.ASM, is included on the enclosed diskette and listed in Appendix A for your reference. It enables the 8x930Ax to perform the USB enumeration when a device first attaches to the host. Since the enumeration is mandatory, the code example can be re-used. It should be modified and integrated with other firmware modules to complete the firmware for your device. In this section, the operating model of the enumeration code is explained. It can be used as an example for handling USB control transfers described in earlier sections. chip reset initialize SFRs, variables, etc. idle_loop (user applications) Figure 5-5. Flow diagram of the enclosed USB_ENUM.ASM 56