Connection Of Device - Fujitsu MB90335 Series Hardware Manual

16-bit microcontroller
Table of Contents

Advertisement

MB90335 Series
12.5.1

Connection of Device

The method for detecting the connection of the external USB device by software is
described.
■ Setting of HOST Function
To make it operate as a host of the USB device, set the HOST bit of the host control register 0 (HCNT0) to
"1".
■ Disconnection Status, Connection Status of the External USB Device
When the external USB device is disconnected, both HOST pins, D + and D-, are "L" by the pull-down
resistor. Then, the CSTAT bit in the host state status register (HSTATE) is "0", and the TMODE bit is
indefinite. The CSTAT bit of the host state status register (HSTATE) becomes "1" when the external USB
device is connected.
■ Connected Detection of External USB Device
To detect the connection of the external USB device, set the CNNIRE bit of the host control register 0
(HCNT0) to "1". The CNNIRQ bit of the host interrupt register (HIRQ) becomes "1", and a device
connection interrupt is generated. To clear this interrupt, write "0" to the CNNIRQ bit of the host interrupt
register (HIRQ). To detect the connection of the external USB device not through interrupt but through
polling, create a program so that it ensures that the CNNIRE bit of the host control register 0 (HCNT0) is
set to "0" and the CNNIRQ bit of the host interrupt register (HIRQ) is "1".
■ Acquiring Transfer Speed of Destination USB Device and Selecting Clock
To acquire the transfer speed of a destination USB after detecting the connection, make reference to the
value of the TMODE of the host state status register (HSTATE). The relation between the transfer speed
and the TMODE bit of the host state status register (HSTATE) is as follows:
• When a destination device is a Full Speed-enabled device → TMODE= 1
• When a destination device is a Low Speed-enabled device → TMODE= 0
After the transfer speed of the external USB device is acquired, when the RST bit of the UDC control
register (UDCC) is "1", update the CLKSEL bit of the host state status register (HSTATE) based on the
acquired transfer speed. The relation between the TMODE and CLKSEL bits of the host status register
(HSTATE) is as follows:
• TMODE = 1 → "1" is set to CLKSEL bit.
• TMODE = 0 → "0" is set to CLKSEL bit.
CM44-10137-6E
FUJITSU MICROELECTRONICS LIMITED
CHAPTER 12 USB HOST
12.5 Operation of USB HOST
271

Advertisement

Table of Contents
loading

This manual is also suitable for:

F2mc-16lxMb90v330aMb90f337Mb90337

Table of Contents