Introduction - Philips PDIUSBD12 Firmware Programming Manual

Hide thumbs Also See for PDIUSBD12:
Table of Contents

Advertisement

Interconnectivity
Firmware Programming Guide for PDIUSBD12

1. Introduction

PDIUSBD12 is a high-speed USB interface device with parallel bus and local DMA transfer capability. The
objective of the recommended firmware design is to enable PDIUSBD12 to achieve the fastest transfer rate over
USB.
Peripheral devices such as the printer, scanner, external mass storage, and digital camera can use PDIUSBD12
in transferring data over USB. The CPUs in these devices are very busy in handling many tasks like device
control and data and image processing. The firmware of PDIUSBD12 is designed to be fully interrupt-driven.
While CPU is doing its foreground task, the USB transfer is being handled in the background. This assures best
transfer rate and better software structure and also simplifies programming and debugging.
The data exchange between the background ISR (Interrupt Service Routine) and the foreground Main Loop is
achieved by event flags and data buffers. For example, the PDIUSBD12 Main bulk out endpoint can use a
circular data buffer. When PDIUSBD12 receives a data packet from USB, an interrupt request is generated to
the CPU and the CPU will service ISR immediately. Inside the ISR, the firmware moves the data packet to the
circular buffer from PDIUSBD12's internal buffer and then clears the PDIUSBD12's internal buffer to enable
PDIUSBD12 to receive new packet. The CPU can continue its current foreground task until completion, e.g.
printing current page. Then it returns to the main loop, checks the circular buffers for new data, and starts
another foreground task.
Circular data buffer
With this structure, the Main Loop does not care whether the data source is from USB, serial port, or parallel
port. The Main Loop only checks the circular buffer for new data to be processed. This concept is very
important. Thus, the Main Loop program can target on data processing and the ISR can do the job of data
transfer at the fastest speed possible.
Similarly, the control endpoint uses the same concept in data packet handling. The ISR receives and stores
control transfers in data buffers and sets the corresponding flag registers. The main loop will dispatch the
request to protocol handling routines. Since all the standard device, class, and vendor requests are processed in
protocol handling routines, ISR can maintain its efficiency. Also, when new request is added, only modification
at the protocol level is needed.
RXRP, Read Pointer maintained by main loop
Main loop in foreground
ISR in background
RXWP, Write Pointer maintained by ISR
Philips Semiconductors - Asia Product Innovation Centre
Visit
http://www.flexiusb.com
Page 4 of 22

Advertisement

Table of Contents
loading

Table of Contents