SMSC AN 9.29 APPLICATION NOTE Revision 1.4 (09-10-04) AN 9.29 USB20H04 4-Port USB2.0 Hub Controller Configuration Programming Preface This Application Note provides detailed information on methods to configure the USB20H04 4- Port USB2.0 Hub Controller in a hub system. Audience This manual assumes that the users have some familiarity with hardware design, USB protocols, and serial bus architectures. The goal of this application note is to provide information pertaining to the serial bus port of the USB20H04 that will assist in configuring the device using any of the supported methods. Overview The SMSC 4-port hub controller is fully compliant with the USB2.0 Specification and does not require firmware development. Refer to the complete datasheet for reference when using this application note. A default configuration is available in the USB20H04 following a reset. This configuration may be sufficient for some applications when it is desired to save the expense of an EEPROM. The controller may also be configured from a microcontroller or an external EEPROM. When using the microcontroller interface, the USB20H04 appears as an SMBus slave device. The EEPROM interface supports a 2-wire I2C device. Features Please refer to the USB20H04 datasheet for an updated list of features. General Features ■ Compliant with USB2.0 Specification ■ Hub controller IC with four downstream ports ■ Four transaction translators ensure maximum USB throughput ■ Enables bus-powered Hi-Speed hub design ■ Compatible with On-The-Go (OTG) USB devices ■ Integrated Session Request Protocol (SRP) operates with dual-role OTG hosts ■ Default configuration with pin selectable options ■ Serial interface to configure vendor ID and other options from EEPROM or microcontroller ■ Flexible OEM configuration options ■ Available in a 64-pin QFP
21
Embed
AN 9.29: USB20H04 4-Port USB2.0 Hub Controller ...application-notes.digchip.com/142/142-47676.pdf · USB20H04 4-Port USB2.0 Hub Controller Configuration Programming SMSC AN 9.29 3
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
PrefaceThis Application Note provides detailed information on methods to configure the USB20H04 4-Port USB2.0 Hub Controller in a hub system.
AudienceThis manual assumes that the users have some familiarity with hardware design, USBprotocols, and serial bus architectures. The goal of this application note is to provide informationpertaining to the serial bus port of the USB20H04 that will assist in configuring the device usingany of the supported methods.
OverviewThe SMSC 4-port hub controller is fully compliant with the USB2.0 Specification and does notrequire firmware development. Refer to the complete datasheet for reference when using thisapplication note.
A default configuration is available in the USB20H04 following a reset. This configuration maybe sufficient for some applications when it is desired to save the expense of an EEPROM. Thecontroller may also be configured from a microcontroller or an external EEPROM. When usingthe microcontroller interface, the USB20H04 appears as an SMBus slave device. The EEPROMinterface supports a 2-wire I2C device.
Features
Please refer to the USB20H04 datasheet for an updated list of features.
General Features
■ Compliant with USB2.0 Specification
■ Hub controller IC with four downstream ports
■ Four transaction translators ensure maximum USB throughput
■ Integrated termination and pull-up/pull-down resistors
■ Internal short circuit protection of DP and DM lines
■ On-chip oscillator uses low cost 24MHz crystal
■ Supports individual or ganged over-current protection and power control
■ LED drivers for each downstream port
Description of Serial InterfaceConfiguration of the USB20H04 is performed after reset. The USB20H04 can be configured either by an externalmicrocontroller or by an external EEPROM. The SMB_SEL_N pin determines the method used.
The SMBus interface shares the same pins as the EEPROM interface. If the SMB_SEL_N pin is configured toactivate the SMBus interface, external EEPROM support is no longer available and the user-defined configurationvalues must be loaded via the SMBus.
Pin Function ListingThe USB20H04 serial interface includes the following pins:
Two External Sources of Configuration Data
I2C EEPROM
The I2C EEPROM interface implements a subset of the I2C Master specification. The Hub’s I2CEEPROM interface is designed to attach to a single “dedicated” I2C EEPROM, and conforms to the
Table 1 USB20H04 Pin Table for Configuration Select and Serial Port Interface
NAMEBUFFER
TYPEACTIVELEVEL DESCRIPTION
SMB_SEL_N I N/A SMBus Select. Selects between configuration via the SMBus interface, or from an external EEPROM or using the internal default, as described in the table below.
SMB_SEL_N CS/EE_SEL SMBus or EEPROM interface configuration.
0 0 SMBus slave. Address: 0101100
0 1 SMBus slave. Address: 0101101
1 0 Internal default configuration.
1 1 2-wire EEPROM interface.
CS/EE_SEL IO8 N/A Chip Select. This multifunction pin is sampled on the rising edge of RESET_N. If SMB_SEL_N = 1, the internal default configuration will be used when this pin is low, or the external I2C EEPROM will supply the configuration when this pin is high. When SMB_SEL_N = 0, this pin selects the SMBus slave address, as described in the table above. Connect a 1k ohm resistor in series with the input when connecting this pin to either VDD or VSS.
SD/SDA IOSD12 N/A Serial Data. Data I/O on the 2-Wire interface.
SCK/SCL IOSD12 N/A Serial Clock. Clock for the 2-Wire interface.
Revision 1.4 (09-10-04) 2 SMSC AN 9.29APPLICATION NOTE
Standard-mode I2C specification (100kbit/s transfer rate and 7-bit addressing) for protocol andelectrical compatibility. Extensions to the I2C specification are not supported.
The USB20H04 acts as the master, and generates the serial clock SCL, controls the bus access(determines which device acts as the transmitter and which device acts as the receiver), and generatesthe START and STOP conditions.
IMPLEMENTATION CHARACTERISTICS
Serial EEPROM interface details may be obtained in the specific manufacturer’s datasheet. Forexample, the MicroChip 24AA00 Datasheet includes a section that describes the read operation.User’s of the USB20H04 will generally not need to be concerned with these details.
PULL-UP RESISTOR
The circuit board designer is required to place external pull-up resistors on the SDA & SCL lines (perSMBus 1.0 Specification, and EEPROM manufacturer guidelines) to VDD in order to assure properoperation.
I2C EEPROM SLAVE ADDRESS
Slave address is 1010xxx (where xxx is don’t care”). The optional 10-bit addressing is NOT supported.
I2C EEPROM DATA READ
Please refer to the Philips Semiconductor Standard I2C-Bus Specification for details on I2C busprotocols.
IN CIRCUIT EEPROM PROGRAMMING
The USB20H04 enables in circuit programming of the attached EEPROM by tri-stating the serialinterface when in reset. The circuit board would typically be designed with a header for makingconnection to a programmer.
SMBus Slave Interface
Instead of loading User-Defined Descriptor data from an external EEPROM, the USB20H04 can beconfigured to receive a code load from an external processor via an SMBus interface. The SMBusinterface shares the same pins as the EEPROM interface, and if the SMB_SEL pin is configured toactivate the SMBus interface, then external EEPROM support is no longer available. Due to systemissues, the USB20H04 will wait indefinitely for the SMBus code load to complete, and will only appearas a newly connected device on USB after the code load is complete.
The USB20H04 conforms to voltage, power, and timing specifications as set forth in the SMBus 1.0Specification for Slave-Only devices. The SMBus implementation is a subset of the SMBus interfaceto the host, since it only supports two protocols. The Write Byte and Read Byte protocols are the onlyvalid SMBus protocols for the USB20H04. The USB20H04 responds to other protocols as describedin the Invalid Protocol Section. Reference the System Management Bus Specification, Rev 1.0.
The SMBus interface is used to read and write the registers in the device. The register set is shownin section 3.3 Internal Memory Register Set.
Bus Protocols
Typical Write Byte and Read Byte protocols are shown below. Register accesses are performed using7-bit slave addressing, an 8-bit register address field, and an 8-bit data field. The shading indicatesthe Hub driving data on the SDA line; otherwise, host data is on the SDA line.
The slave address is the unique SMBus Interface Address for the Hub that identifies it on SMBus. Theregister address field is the internal address of the register to be accessed. The register data field isthe data that the host is attempting to write to the register or the contents of the register that the hostis attempting to read.
Data bytes are transferred MSB first.
SMSC AN 9.29 3 Revision 1.4 (09-10-04)APPLICATION NOTE
When using the SMBus Interface for byte transfers, a write will always consist of the SMBus InterfaceSlave Address byte, followed by the Internal Address Register byte, then the data byte:
The normal read protocol consists of a write to the USB20H04 with the SMBus Interface Address byte,followed by the Internal Address Register byte. Then restart the Serial Communication with a Readconsisting of the SMBus Interface Address byte, followed by the data byte read from the Hub. Thiscan be accomplished by using the Read Byte protocol.
For the following SMBus tables:
Write Byte
The Write Byte protocol is used to write data to the registers. The data will only be written if theprotocol shown in Table 2 is performed correctly. Only one byte is transferred at time for a Write Byteprotocol.
Read Byte
The Read Byte protocol is used to read data from the registers. The data will only be read if theprotocol shown in Table 3 is performed correctly. Only one byte is transferred at time for a Read Byteprotocol.
Invalid Protocol Response Behavior
Registers that are accessed with an invalid protocol will not be updated. A register will only be updatedfollowing a valid protocol. The only valid protocols are Write Byte and Read Byte, which are describedabove.
The USB20H04 only responds to the Slave Address as defined in the USB20H04 datasheet.
Attempting to communicate with the Hub over SMBus with an invalid slave address, or invalid protocolwill result in no response, and the SMBus Slave Interface will return to the idle state.
The only valid registers that are accessible by the SMBus slave address are the registers defined inthe Registers Section. See section below for response to undefined registers.
UNDEFINED REGISTERS
Reads to undefined registers return NACK. Writes to undefined registers have no effect and returnNACK.
The USB20H04 will not respond to a general call address of 0000_000b. The general call address isfor addressing every device connected to the I2C-bus. However, if a device doesn’t need any of thedata supplied within the general call structure, it can ignore this address by not issuing anacknowledgement.
Slave Device Time-Out
According to SMBus specification, v1.0 devices in a transfer can abort the transfer in progress andrelease the bus when any single clock low interval exceeds 25ms (TTIMEOUT, MIN). Devices thathave detected this condition must reset their communication and be able to receive a new STARTcondition no later than 35ms (TTIMEOUT, MAX).
Note: Some simple devices do not contain a clock low drive circuit; this simple kind of device typicallyresets its communications port after a start or stop condition.
Stretching the SCLK Signal
The USB20H04 supports stretching of the SCLK by other devices on the SMBus, but does not stretchthe SCLK. This is related to a provision in the I2C specification that allows a device to delay the serialtransfer by stretching the low period of the clock.
SMBus Timing
The SMBus Slave Interface complies with the SMBus AC Timing Specification. See the SMBus timingin the Timing Diagram section.
Bus Reset Sequence
The SMBus Slave Interface will reset and return to the idle state upon a START field followedimmediately by a STOP field.
SMBus Alert Response Address
SMBALERT# signal is not supported by the USB20H04.
Internal Memory Register Set
Table 4 SMBus Slave Interface Register Map
REGISTER ADDRESS
READ/WRITE REGISTER NAME
BIT 7 (MSB) BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1
BIT 0 (LSB)
00h R/W Status/Command 7 6 5 4 3 2 1 0
01h R/W VID MSB 15 14 13 12 11 10 9 8
02h R/W VID LSB 7 6 5 4 3 2 1 0
03h R/W PID MSB 15 14 13 12 11 10 9 8
04h R/W PID LSB 7 6 5 4 3 2 1 0
05h R/W DID MSB 15 14 13 12 11 10 9 8
06h R/W DID LSB 7 6 5 4 3 2 1 0
07h R/W Config Data Byte 3 7 6 5 4 3 2 1 0
08h R/W Config Data Byte 2 7 6 5 4 3 2 1 0
09h R/W Config Data Byte 1 7 6 5 4 3 2 1 0
SMSC AN 9.29 5 Revision 1.4 (09-10-04)APPLICATION NOTE
The registers shown in the table above are the defined registers in the Hub. Reads to undefinedregisters return 00h. Writes to undefined registers have no effect and do not return an error.
Register 00h: Status/Command
Registers 02-01h: Vendor ID
0Ah R/W Max Power 7 6 5 4 3 2 1 0
0Bh R/W Hub Controller Max Current
7 6 5 4 3 2 1 0
0Ch R/W Power-on Time 7 6 5 4 3 2 1 0
BIT NUMBER BIT NAME DESCRIPTION
7:2 Reserved Reserved
1 WRITE_PROT Write Protect: The external SMBus host sets this bit after the Hub’s internal memory is loaded with configuration data. Note: The External SMBus Host is responsible for verification of
downloaded data.
0 = The internal memory (address range 01-0Ch) is not write protected.1 = The internal memory (address range 01-0Ch) is write-protected to prevent unintentional data corruption.}
Note: This bit is write once and is only cleared by assertion of the external RESET_N pin.
0 USB_ATTACH USB Attach & power-down the SMBus Interface.
0 = Default; SMBus slave interface is active.1 = Hub will signal a USB attach event to an upstream device, Note: SMBus Slave interface will completely power down after the ACK has completed.
Note: This bit is write once and is only cleared by assertion of the external RESET_N pin.}
BIT NUMBER BIT NAME DESCRIPTION
15:8 VID MSB Most Significant Byte of the Vendor ID
7:0 VID LSB Least Significant Byte of the Vendor ID
15:8 PID MSB Most Significant Byte of the Product ID
7:0 PID LSB Least Significant Byte of the Product ID
BIT NUMBER BIT NAME DESCRIPTION
15:8 DID MSB Most Significant Byte of the Device ID
7:0 DID LSB Least Significant Byte of the Device ID
BIT NUMBER BIT NAME DESCRIPTION
7 Self/Bus Power Selects between self and bus powered operation
0=Self-Powered operation1=Bus-powered operation
6 Port indicators Indicates implementation of LED indicators
0= No LED indicators1= LED indicators
5 High Speed Disable Disables the capability to attach as either a High/Full-speed device, and forces attachment as Full-speed only i.e. (no High-Speed support).
The ports may be individually configured to be inactive. However, the order in which ports are set toinactive is very specific. Port 4 must be the first port configured to be inactive, followed by port 3.
Register 09h: Configuration Data Byte 1
Register 0Ah: Max Power
BIT NUMBER BIT NAME DESCRIPTION
7:4 Non-removable device Indicates which port(s) include non-removable devices. A zero indicates that the port is removable.
Bit 7 =1; port 4 non removable.Bit 6 =1; port 3 non-removable.Bit 5 =1; port 2 non-removable.Bit 4 =1; port 1 non-removable.
3:0 Port Disable Disables 1 or more contiguous ports. ‘0’ = port is available, ‘1’ = port is disabled.
Bit 3 =1; port 4 is disabled. Port 4 must be configured inactive first.Bit 2 =1; port 3 is disabled.Bit 1 =1; port 2 is disabled.Bit 0 =1; port 1 is disabled.
BIT NUMBER BIT NAME DESCRIPTION
7 Dynamic Power Controls the ability for the hub to transition to Bus powered operation if the local power source is removed (can revert back to self power if local power source is restored)
0= No Dynamic auto-switching.1= Dynamic Auto-switching capable.
6 On-The-Go On-The-Go (OTG) Support Enable;0=OTG Disabled.1=OTG Enabled.
5:4 Reserved Reserved
3:0 Over Current Timer Over Current Timer delay.
0101 = 2ms1010 = 4ms1111 = 6ms
Note: all other values are reserved
BIT NUMBER BIT NAME DESCRIPTION
7:0 MAX Power Value in 2mA increments that the 4-port Hub consumes from an upstream port in this configuration.
A value of 50 (decimal) would indicate 100mA
Revision 1.4 (09-10-04) 8 SMSC AN 9.29APPLICATION NOTE
System Hardware DesignThe following simplified schematic diagrams show how the serial port pins are connected for each ofthe programming modes. The internal default configuration mode is shown here as a reference.
BIT NUMBER BIT NAME DESCRIPTION
7:0 Hub Controller Max Current
Absolute maximum current requirement of the Hub Controller electronics (in 2mA increments).
A value of 50 (decimal) would indicate 100mA, which is the default value!
BIT NUMBER BIT NAME DESCRIPTION
7:0 Power-on Time Time in 2 ms intervals from the time power the power-on sequence begins on a port until power is good on that port.
Figure 1 USB20H04 Internal Default Mode
USB20H04
SCK/SCLSD/SDA
VDD3.3
SMB_SEL_NCS/EE_SELSELF_PWR
Bus/SelfPower Select0=Bus-Power1=Self-Power
1k
SMSC AN 9.29 9 Revision 1.4 (09-10-04)APPLICATION NOTE
External SMBus ConnectionThe SMBus serial data can be generated using a PC and an adapter called iPort.
This adapter connects to the Serial Port of a Windows based PC. Call (609)466-1751 for pricing andother information from Micro Computer Control Corp, the manufacturer of this adapter. The web pagefor the MIIC 201 may be available at: http://www.mcc-us.com/201.htm.
The "iPort Message Center" application that is included with the iPort makes it possible tocommunicate to the SMBus interface of the USB20H04. The data used to configure the USB20H04 isstored in a file with a .IML extension as shown in the following examples. When using the SMBus forconfiguration, the USB ATTACH bit of the Status/Command register must be set after all other registershave been programmed.
Example .IML file for Multi TT
MCC I2C Message List File V2
$58,W,Y,$0000,01,04,
$58,W,Y,$0000,02,24,
$58,W,Y,$0000,03,00,
$58,W,Y,$0000,04,8A,
$58,W,Y,$0000,05,10,
$58,W,Y,$0000,06,06,
$58,W,Y,$0000,07,58,
$58,W,Y,$0000,08,00,
$58,W,Y,$0000,09,05,
$58,W,Y,$0000,0A,00,
$58,W,Y,$0000,0B,00,
$58,W,Y,$0000,0C,80,
$58,W,Y,$0000,00,03,
AutoRepeat = OFF
SendOnInt = OFF
End of Sequence
SMSC AN 9.29 11 Revision 1.4 (09-10-04)APPLICATION NOTE
EEPROM ProgrammingTypically the EEPROM used to configure the USB20H04 will be programmed prior to assembly on thehub board. The board may be designed to accommodate in circuit programming. While the USB20H04is in a reset condition, the serial port is in a tri-state mode. This makes it possible for an external source(such as the ATE equipment) to program the EEPROM. A hub demo system available from SMSCcalled the HD1 illustrates another method that uses jumpers to make provision for in circuitprogramming.
Programming the HD1 demonstration board with SEEVAL
The HD1 board includes special headers to facilitate the attachment of an EEPROM programmer. The16 position header J4 provides access to the 24C02 I2C type EEPROM.
When connecting an external programmer to the HD1 board, remove the power cable and all USBcables to protect the circuits. The programming system provides the power to the EEPROM.
Because the jumpers allow the EEPROM to be isolated from the other hub circuitry, several types ofprogrammers should be compatible with the HD1. SMSC has successfully used the inexpensiveSEEVAL programmer from MicroChip to program either device. The SEEVAL board connects to theSerial Port of a Windows based PC. The SEEVAL application that is included with the programmerpurchase is the only software required to transfer data to the EEPROMs.
A socket on the SEEVAL board is designed for standard 8-pin DIP devices. The 16 position headerrequires an adapter cable to connect to the socket. Manufacture the cable to connect the 8 pins of theDIP socket to the header connector pins shown in the following table.
DIP SOCKETHEADER
CONNECTOR
1 2
2 4
3 6
4 8
5 10
6 12
7 14
8 16
SMSC AN 9.29 13 Revision 1.4 (09-10-04)APPLICATION NOTE
AppendixThere are many ways to configure the hub based on your specific application. The following are twoexamples to be used as a reference. Table 5 shows the binary and hex values for each registeraddress of the USB20H04 for a typical configuration. In this example, the hub is configured for multi-TTmode and self-power operation with all four ports active.
Added under General Features: Default configuration with pin selectable optionsRemoved under Hardware Features: Detects removal of self-power and automatically changes mode to bus-power
Rev. 1.211-03-03
3 Description of Serial Interface, page 9
Removed reference to microwire EEPROM
Rev. 1.211-03-03
Table 3.1 - USB20H04 Pin Table for Configuration Select and Serial Port Interface, page 9
Replaced Table
Rev. 1.211-03-03
3.2 Two External Sources of Configuration Data, page 9
Removed reference to microwire EEPROM
Rev. 1.211-03-03
4 System Hardware Design, page 18
Updated Figure 4.1, Figure 4.2, Figure 4.3
Rev. 1.211-03-03
6.1 Programming the HD1 demonstration board with SEEVAL, page 21
First paragraph modified
Rev. 1.211-03-03
6 EEPROM Programming, page 21 Removed the following sections:6.3 Example .HEX file for 93C46 with Single TT6.4 Programming the HD1 93C46 EEPROM with SEEVAL
Rev. 1.105-13-03
Register 00h: Status/Command – pg. 14
Bits 1 and 0 modified
Rev. 1.105-13-03
Register 07h: Configuration Data Byte 3 – pg. 15
Bit 5 modified
Rev. 1.105-13-03
Register 08h: Configuration Data Byte 2 – pg. 16
Bit name and description modified for Bit 3:0
Rev. 1.105-13-03
Register 09h: Configuration Data Byte 1 – pg. 16
Bit 3:2 changed to Bit 3:0, bit name and description also modified
Rev. 1.105-13-03
5 External SMBus Connection – pg. 19
The following sentence has been added in the third paragraph:ìWhen using the SMBus for configuration, the USB ATTACH bit of the Status/Command register must be set after all other registers have been programmed.
Rev. 1.105-13-03
5.1 Example .IML file for Multi TT – pg. 19
$58,W,Y,$0000,09,06, changed to $58,W,Y,$0000,09,05
SMSC AN 9.29 19 Revision 1.4 (09-10-04)APPLICATION NOTE
SMSC DISCLAIMS AND EXCLUDES ANY AND ALL WARRANTIES, INCLUDING WITHOUT LIMITATION ANY AND ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND AGAINST INFRINGEMENT ANDTHE LIKE, AND ANY AND ALL WARRANTIES ARISING FROM ANY COURSE OF DEALING OR USAGE OF TRADE. IN NO EVENT SHALL SMSC BE LIABLE FOR ANY DIRECT, INCIDENTAL, INDIRECT, SPECIAL, PUNITIVE, OR CONSEQUENTIALDAMAGES; OR FOR LOST DATA, PROFITS, SAVINGS OR REVENUES OF ANY KIND; REGARDLESS OF THE FORM OF ACTION,WHETHER BASED ON CONTRACT; TORT; NEGLIGENCE OF SMSC OR OTHERS; STRICT LIABILITY; BREACH OF WARRANTY; OR OTHERWISE; WHETHER OR NOT ANY REMEDY OF BUYER IS HELD TO HAVE FAILED OF ITS ESSENTIAL PURPOSE, ANDWHETHER OR NOT SMSC HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
SMSC AN 9.29 21 Revision 1.4 (09-10-04)APPLICATION NOTE