
SH7285/SH7286 USB Function Module
USB to Serial Conversion Application Note
2.3 Detecting a Connection to the USB Host
A connection to the USB host is detected using the cable connect interrupt (the BRST bit in the USBIFR0 register).
The cable connect interrupt occurs when a USB device cable is connected to the USB host.
After the user configures the MCU, the sample program pulls up the USB data bus D+ pin using the general output
port. The USB host recognizes that a USB device is connected by the pull-up.
Figure 2.1 shows an operation flowchart
of the sample program, and
Figure 2.2 shows the USB Function Module Peripheral Block Circuit.
Yes
Connects a cable
USB Function (Hardware) Sample Program (Software)
Cable is not connected
VBUS = 0
UDC core is reset
USB cable is connected
Pulls up D+ pin
Releases the UDC core reset
No
Receives bus reset
USBIFR0/BRSY = 1
Bus reset interrupt
Waits for receiving
the setup command
Clears buffer in software
Clears the bus reset flag
USBIFR0/BRSY = 0
Clears all buffers
ActBusReset
Configures the MCU
Initializes the memory
Initializes the USB module
Main loop
USBIFR0/BRST interrupt
Sets CPG
Sets BSC
Sets I/O PORT
Sets PFC
USBPND pin (PB10)
Sets clock in the
USB module
Sets the interrupt level
SetUsbModule
Pull-up enabled
D+ pin (PB10)
High
Interrupt started
Interrupt completed
Main processing started
InitMemory
InitSystem
Figure 2.1 Detecting a Connection to the USB Host
REJ05B1152-0100/Rev.1.00 May 2008 Page 4 of 35
Comentarios a estos manuales