English
Language : 

SH7216 Datasheet, PDF (14/32 Pages) Renesas Technology Corp – USB Mass Storage Class
SH7216 Group
USB Function Module: USB Mass Storage Class
5. Overview of the Sample Program
In this section, features of the sample program and its structure are explained. This sample program runs on the SH7216
CPU Board, which works as a RAM disk, and initiates USB transfers by means of interrupts from the USB function
module. Of the interrupts from modules in the SH7216, there are six interrupts related to the USB function module:
USI0, USI1, USBRXI0, USBTXI0, USBRXI1 and USBTXI1, but in this sample program, USI0 and USI1 are used.
5.1 State Transition Diagram
Figure 5 shows a state transition diagram for this sample program. In this sample program, as shown in figure 5, there
are transitions between three states.
Reset state
Immediately after the power supply has been turned on,
the system is in reset state. After the initial settings have been
completed, it returns to the stationary state.
Initial settings completed
Interrupt generated
(USBFI0)
USB communication state
Stationary state
Control transfer
USB communication
completed
Bulk transport
Figure 5 State Transition Diagram
• Reset state
Upon power-on reset and manual reset, this state is entered. In the reset state, the SH7216 mainly performs initial
settings.
• Stationary state
When initial settings are completed, a stationary state is entered in the main loop.
• USB communication state
In the stationary state, when an interrupt from the USB module occurs, this state is entered. In the USB
communication state, data transfer is performed by a transfer method according to the type of interrupt. The
interrupts used in this sample program are indicated by interrupt flag register 0, 1, 2, 3 and 4 (USBIFR0, 1, 2, 3 and
4). When an interrupt factor occurs, the corresponding bits in USBIFR0, 1, 2, 3 and 4 are set.
REJ06B0897-0100/Rev.1.00
July 2009
Page 14 of 32