HOLTEK HT45B0K

HT45B0K
SPI to USB Bridge
Features
●
●
●
●
●
●
●
●
●
Glueless slave SPI interface to Holtek's MCU
USB (Universal Serial Bus) 1.1 Full-speed module
− 6 endpoints (endpoint 0 included)
− FIFO: 8, 8, 8, 64, 8, 64 for EP0~EP5 respectively
Operating voltage: VDD = 3.3V~5.5V
6MHz/12MHz (CLKI) external clock input for USB PLL clock
Suspend Mode with low suspend current
Remote Wake-up function
USB Multiple Interrupt Generation Sources:
♦ Access of the corresponding USB FIFO from the USB host
♦ USB suspend signal from the USB host
♦ USB resume signal from the USB host
♦ USB Reset signal from the USB host
CMOS external clock input, CLKI, with frequency 6MHz/12MHz for the USB PLL clock
16-pin NSOP package
General Description
This device is a companion chip for microcontrollers to provide USB connectivity with the USB
host. Six USB endpoints are supported with 8/8/8/64/8/64-byte FIFO for endpoint 0~5 respectively.
An external interrupt output to the host MCU is used for inetrrupt-driven operation.
However, the host MCU may also poll the status register to obtain the latest status if the interrupt is
not used.
The possible applications include low-cost data links for computers/peripherals, portable and
battery operated devices/instruments, factory automation and process control.
Block Diagram
S D I
V 3 3 O
U S B
M o d u le
S D O
S C K
V
D D
S e r ia l
I/O
In te rfa c e
U D P
U D N
S C S
C L K I
P L L
4 8 M H z
IN T
V D D
G N D
Rev 1.00
T o a ll
c h ip
p o w e r
1
March 22, 2010
HT45B0K
SPI to USB Bridge
Pin Assignment
S D I
1
1 6
S D O
N C
2
1 5
N C
S C K
3
1 4
V 3 3 O
S C S
4
1 3
U D P
C L K I
5
1 2
U D N
IN T
6
1 1
V D D
V S S
7
1 0
V D D
N C
8
9
V S S
H T 4 5 B 0 K
1 6 N S O P -A
Pin Description
Pin Name
SDI
SDO
SCK
CLKI
I/O
I
= HIGH
O
Serial I/O data output.
SDO is high impedance when
= HIGH
I
Serial I/O clock input
SCK is high impedance when
= HIGH
I
Serial I/O Chip select input, low active
Connected to internal pull-high resistor.
I
External clock input
O
Interrupt output - CMOS output structure
Connected to the external interrupt input of MCU
A USB related interrupt will generate a low pulse signal on this line
─
V33O
Descriptions
Serial I/O data input
SDI is high impedance when
UDP
I/O
UDN
I/O
3.3V regulator output
USBD+ line
USB function is controlled by software control register.
USBD- line
USB function is controlled by software control register.
VDD
─
Positive power supply
VSS
─
Negative power supply, ground
NC
─
No connection
Absolute Maximum Ratings
Supply Voltage....................................................................................................VSS−0.3V to VSS+6.0V
Input Voltage.......................................................................................................VSS−0.3V to VDD+0.3V
Storage Temperature.................................................................................................−50°C to +150°C
Operating Temperature.................................................................................................−40°C to +85°C
IOH Total.....................................................................................................................................−10mA
IOL Total.......................................................................................................................................15mA
Total Power Dissipation..............................................................................................................10mW
Note : These are stress ratings only. Stresses exceeding the range specified under “Absolute Maximum
Ratings” may cause substantial damage to the device. Functional operation of this device at other
conditions beyond those listed in the specification is not implied and prolonged exposure to extreme
conditions may affect device reliability.
Rev 1.00
2
March 22, 2010
HT45B0K
SPI to USB Bridge
D.C. Characteristics
Symbol
VDD
Parameter
Operating Voltage
Test Conditions
VDD
―
3.3V
IDD
Operating Current
(SPI Enabled, USB Transceiver
and 3.3V Regulator On)
5.0V
3.3V
5.0V
ISUS
ISTB
Suspend Current
(SPI Enabled, USB Suspend and
3.3V Regulator On)
Standby Current
(SPI Disabled, USB Disabled
and 3.3V Regulator Off)
Conditions
fCLKI=6MHz or 12MHz
fCLKI=6MHz, SCK= fCLKI/4
fCLKI=12MHz, SCK= fCLKI/4
Min.
Typ.
Max.
Unit
3.3
―
5.5
V
―
4.0
6.0
mA
―
6.5
10
mA
―
4.0
7.0
mA
―
7.0
10
mA
―
Output no load,
SUSP2=1 (bit 4 in UCC)
―
400
500
μA
―
Output no load
―
0.1
1
μA
0.3×VDD
V
VIL1
Input Low Voltage for I/O pins
―
―
0
―
VIH1
Input High Voltage for I/O pins
―
―
0.7×VDD
―
VDD
V
VIL2
Input Low Voltage for CLKI
―
―
0
―
0.3×VDD
V
VIH2
Input High Voltage for CLKI
―
―
0.7×VDD
―
VDD
V
4.0
12
―
mA
10
25
―
mA
-4.0
-5.0
―
mA
-5.0
-10
―
mA
IOL
I/O pins Sink Current
IOH
I/O pins Source Current
RPH
Pull-high Resistance for
only
Rev 1.00
3.3V
5.0V
3.3V
5.0V
VO=0.1×VDD
VO=0.9×VDD
3.3V
―
5V
3
15
45
75
kΩ
10
30
50
kΩ
March 22, 2010
HT45B0K
SPI to USB Bridge
A.C. Characteristics
Symbol
RPOR
Parameter
VDD Slew Rate for POR
fCLKI
System Clock
(External Clock Input)
tCP
SCK Period (tCH + CL)
tCH
tCL
SCK High Time
SCK Low Time
Test Conditions
VDD
Conditions
―
―
Min.
Typ.
Max.
Unit
0.0034
―
―
V/ms
―
6
―
MHz
―
12
―
MHz
ns
3.3V~
5.0V
―
3.3V
―
62.5
―
―
5.0V
―
50.0
―
―
ns
3.3V
―
28
―
―
ns
5.0V
―
22
―
―
ns
3.3V
―
28
―
―
ns
5.0V
―
22
―
―
ns
3.3V
―
500
―
―
ns
5.0V
―
400
―
―
ns
tCSW
High Pulse Width
tCSS
to SCK Setup Time
―
―
100
―
―
ns
tCSH
to SCK Hold Time
―
―
0
―
―
ns
tSDS
SDI to SCK Setup Time
―
―
100
―
―
ns
tSDH
SDI to SCK Hold Time
―
―
0
―
―
ns
tR
SPI Output Rise Time
―
―
―
10
―
ns
tF
SPI Output Fall Time
―
―
―
10
―
ns
tW
SPI Data Output Delay Time
―
―
0
―
―
ns
Rev 1.00
4
March 22, 2010
HT45B0K
SPI to USB Bridge
Functional Description
SPI Interface
The MCU communicates with the USB Module via an internal SPI interface. The SPI interface
(SPI Chip Select), SCK (SPI Clock), SDI (Serial
on this device is comprised of four signals:
Data Input) and SDO (Serial Data Output). The SPI master, which is the MCU, asserts
by
pulling it low to start the data transaction cycle. When the first 8 bits of data are transmitted,
should not return to a high level. Instead,
must remain at a low level until the whole 16-bit
data transaction is completed. If
is de-asserted, that is returned to a high level, before the 16bit data transaction is completed, all data bits will be discarded by the USB Module SPI slave.
SPI Timing
Both read and write operations are conducted along the SPI common interface with the following
format:
● Write Type Format: 8-bit command input + 8-bit data input
● Read Type Format: 8-bit command input + 8-bit data output
To initiate a data transaction, the MCU master SPI needs to pull
to a low level first and then
also pull SCK low. The input data bit on SDI should be stable before the next SCK rising edge,
as the device will latch the SDI status on the next SCK rising edge. Regarding the SDO line, the
output data bit will be updated on the SCK falling edge. The master needs to obtain the line status
before the next SCK falling edge.
There are 16 bits of data transmitted and/or received by the SPI interface for each transaction. Each
is high, the SPI interface is
transaction consists of a command phase and a data phase. When
disabled and SDO will be set to a high impedance state.
After a complete transaction has been implemented, which requires 16 SCK clock cycles, the
master needs to set
to a high level in preparation for the next data transaction.
For write operations, the device will begin to execute the command only after it receives a 16-bit
has been set high again by the master.
serial data sequence and when the
For read operations, the device will begin to execute the command only after it receives an 8-bit
read command after which it will be ready to output data. If necessary, the master can de-assert
the
pin to abort the transaction at any time which will cause any data transactions to be
abandoned.
Commands and Registers
There are 2 types of commands:
● Read Register
● Write Register
Command/Address Format
Command Type
Bit.7
Bit.6
Bit.5
Bit.4
Bit.3
Bit.2
Bit.1
Bit.0
Read Register
0
X
X
A4
A3
A2
A1
A0
Write Register
1
X
X
A4
A3
A2
A1
A0
There are 17 registers available to control the USB module which are addressed by 5 address bits
A4~ A0 of Read /Write Register commands.
Rev 1.00
5
March 22, 2010
HT45B0K
SPI to USB Bridge
SCS
SCK
SDI
A7
A6
A5
A4
A3
A2
A1
A0
D7
D6
D5
D4
D3
D2
D0
D1
SDO
Writing Type Format:8-bit Command Input + 8-bit Data Input
SCS
tW
SCK
SDI
A7
A6
A5
A4
A3
A2
A1
Don '
t care
A0
D7
SDO
D6
D5
D4
D3
D2
D1
D0
Reading Type Format:8-bit Command Input + 8-bit Data Input
Rev 1.00
6
March 22, 2010
HT45B0K
SPI to USB Bridge
USB Module
To communicate with an external USB host, the internal USB module has the external pins known
as UDP and UDN along with the 3.3V regulator output V33O. All data transmissions and receptions
between MCU and USB module including USB commands are conducted along the interconnected
SPI interface. The USB module has 6 endpoints and 160 bytes FIFO for the endpoints respectively.
A Serial Interface Engine (SIE) decodes the incoming USB data stream and transfers it to the
correct endpoint buffer memory (FIFO). The USB function control is implemented using a series
of registers accessed by the MCU using its SPI Master serial interface. A series of status registers
provide the user with the USB data transfer situation as well as any error conditions. The USB
contains its own independent interrupt which can be used to indicate when the USB FIFOs are
accessed by the host device or a change of the USB operating conditions including the USB
suspend mode, resume event or USB reset occurs.
USB Accessing Commands
There are both read and write commands for accessing the USB Module. For reading and writing
to registers, both command and address information is contained within a single byte. A series of
registers which are addressed by 5 address bits A4~A0 are available to control the USB module for
Read/Write Registers commands. The format for reading and writing commands is shown in the
following table.
Command Type
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Read Registers
0
x
x
A4
A3
A2
A1
A0
Write Registers
1
x
x
A4
A3
A2
A1
A0
Note: “x” here stands for “don’t care”.
USB Status and Control Registers
There are several registers associated with the USB function. Some of the registers control the
overall function of the USB module as well as the interrupts, while some of the registers contain
the status bits which indicate the USB data transfer situations and error condition. Also there are
FIFOs for the USB endpoints to store the data received from or to be transmitted to the USB host.
The USB module has 6 endpoints (EP0~EP5) with different FIFO size for each one. The FIFO size
is 8 bytes for EP0~EP2 and EP4 which support “Interrupt transfer”, while the FIFO size for EP3
and EP5 is 64 bytes which can support “Bulk transfer”.
Rev 1.00
7
March 22, 2010
HT45B0K
SPI to USB Bridge
USB Register Summary
Address
Name
POR state
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
00H
USC
--00 0000
―
―
PLL
V33C
RESUME
URST
RMWK
SUSP
01H
USR
--00 0000
―
―
EP5IF
EP4IF
EP3IF
EP2IF
EP1IF
EP0IF
―
SYSCLK
―
EPS1
EPS0
UAD5
UAD4
UAD3
UAD2
UAD1
UAD0
WKEN
―
STL5
STL4
STL3
STL2
STL1
STL0
EOT
CRCF
NAK
IN
OUT
ERR
ASET
―
―
CLEAR
TX
REQUEST
02H
UCC
-0-0 0000
03H
AWR
0000 0000 UAD6
04H
STALL
--11 1110
05H
SIES
0100 0000
NMI
06H
MISC
0x1- -000
LEN0
07H
SETIO
--11 1110
―
―
08H
UIC
--00 0000
―
―
09H
Unused
---- ----
―
SUSP2 USBCKEN EPS2
READY SETCMD
SETIO5 SETIO4
EU5I
SETIO3
EU4I
SETIO2 SETIO1 DATATG
EU3I
0AH
PIPE
0BH
SWRST
0-00 000- SUSPC
0CH~0FH
Unused
---- ----
Reserved
10H
FIFO0
XXXX XXXX
Data for endpoint 0
11H
FIFO1
XXXX XXXX
Data for endpoint 1
12H
FIFO2
XXXX XXXX
Data for endpoint 2
13H
FIFO3
XXXX XXXX
Data for endpoint 3
14H
FIFO4
XXXX XXXX
Data for endpoint 4
15H
FIFO5
XXXX XXXX
Data for endpoint 5
16H~1FH
Unused
---- ----
Reserved
---- ---0
EU2I
EU1I
EU0I
Reserved
―
―
EP5E
EP4E
EP3E
EP2E
EP1E
―
―
―
―
―
―
―
RESET
USC Register
The USC register contains the status bits for USB suspend, resume and reset indications. It also
contains the bits used to control the Remote Wake-up, V33O output and PLL functions. Further
explanation on each bit is given below:
USC Register
Bit
7
6
5
4
3
2
1
0
Name
R/W
POR
―
―
―
―
―
―
PLL
R/W
0
V33C
R/W
0
RESUME
R
0
URST
R
0
RMWK
R/W
0
SUSP
R
0
Bit 7~6
Bit 5
Bit 4
Bit 3
Rev 1.00
Unimplemented, read as “0”.
PLL: PLL enable control
0: turn on the PLL
1: turn off the PLL
V33C: V33O output enable control
0: turn off the V33O output
1: turn on the V33O output
RESUME: USB resume indication flag
0: USB device does not receive the resume signal or has left the suspend mode.
1: USB device receives the resume signal and is going to leave the suspend mode.
When the USB device receives the resume signal, this bit is set to 1 by SIE. This bit will
appear for about 20ms, waiting for the MCU to detect it. When the RESUME is set by
SIE, an interrupt will be generated to wake up the MCU. In order to detect the suspend
state, MCU should set the USBCKEN bit to 1 and clear the PLL and SUSPC bits to 0 to
enable the SIE and PHY functions. The RESUME bit will be cleared when the SUSP bit
8
March 22, 2010
HT45B0K
SPI to USB Bridge
Bit 2
Bit 1
Bit 0
is set to 0. When the MCU detects the suspend mode SUSP, the resume signal RESUME
which causes MCU to wake up should be remembered and taken into consideration.
URST: USB reset indication flag
0: No USB reset event occurred.
1: USB reset event has occurred.
The USB bit is set and cleared by USB SIE. When the URST bit is set to 1, it indicates
that a USB reset event has occurred and a USB interrupt will be initiated.
RMWK: USB remote wake-up command
0: disable USB remote wake-up command
1: initiate USB remote wake-up command
The RMWK is set to 1 by MCU to force the USB host leaving the suspend mode. Set
RMWK bit to 1 to initiate the remote walk-up command. When the RMWK bit is set to 1,
a 2μs delay for clearing this bit to 0 is necessary to ensure that the RMWK command is
accepted by the SIE.
SUSP: USB suspend indication flag
0: USB leaves the suspend mode.
1: USB enters the suspend mode.
This bit is read only and set to 1 by SIE to indicate that the USB bus enters the suspend
mode.
The USB interrupt is also generated when the SUSP bit is asserted.
USR Register
The USR (USB endpoint interrupt status register) register is consisted of the endpoint request
flags (EP0IF~EP5IF) used to indicate which endpoint is accessed. When an endpoint is accessed,
the related endpoint request flag will be set to 1 by SIE and a USB interrupt will be generated if
the control bits related to the USB interrupt are enabled and the stack in the host MCU is not full.
When the active endpoint request flag is serviced, the endpoint request flag has to be cleared to 0
by application program.
USR Register
Bit
7
6
5
4
3
2
1
0
Name
R/W
POR
―
―
―
―
―
―
EP5IF
R/W
0
EP4IF
R/W
0
EP3IF
R/W
0
EP2IF
R/W
0
EP1IF
R/W
0
EP0IF
R/W
0
Bit 7~6
Bit 5~0
Rev 1.00
Unimplemented, read as “0”.
EP5IF~EP0IF: Endpoint Interrupt request flags
0: the corresponding Endpoint is not accessed.
1: the corresponding Endpoint has been accessed.
9
March 22, 2010
HT45B0K
SPI to USB Bridge
UCC Register
The UCC register is the system clock control register implemented to select the clock used by the
MCU. This register consists of USB clock control bit USBCKEN, second suspend mode control bit
SUSP2 and system clock selection bit SYSCLK. This register is also used to select which endpoint
FIFO is accessed by Endpoint FIFO Selection bits EPS2~EPS0. Further explanation on each of the
bits is given below:
UCC Register
Bit
7
6
5
4
3
2
1
0
Name
R/W
POR
―
―
―
SYSCLK
R/W
0
―
―
―
SUSP2
R/W
0
USBCKEN
R/W
0
EPS2
R/W
0
EPS1
R/W
0
EPS0
R/W
0
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2~0
Rev 1.00
Unimplemented, read as “0”.
SYSCLK: System clock input selection
0: 12MHz clock is used
1: 6MHz clock is used
This bit is used to specify the system clock oscillator frequency used by the MCU. If
a 6MHz crystal oscillator or resonator is used, this bit should be set to 1. If a 12MHz
crystal oscillator or resonator is used, this bit should be set to 0.
Unimplemented, read as “0”.
SUSP2: Suspend mode 2 control
0: optimized setting in suspend mode
1: test setting in suspend mode. The band-gap circuit is turned off.
It is strongly recommended that this bit should be set to 0 when the USB interface is in
suspend mode. Otherwise, the unpredictable results will occur.
USBCKEN: USB clock enable control
0: USB clock is disabled
1: USB clock is enabled
When the USB device receives the suspend signal sent from the USB host, the USB
clock enable control bit USBCKEN should be set to 0 to reduce the power consumption.
EPS2~EPS0: Endpoint FIFO selection
000: Endpoint 0 FIFO is selected
001: Endpoint 1 FIFO is selected
010: Endpoint 2 FIFO is selected
011: Endpoint 3 FIFO is selected
100: Endpoint 4 FIFO is selected
101: Endpoint 5 FIFO is selected
11x: reserved for further expansion and can not be used.
The EPS2~EPS0 bits are used to select which endpoint is to be accessed. If the selected
endpoint does not exist, the related functions are not available.
10
March 22, 2010
HT45B0K
SPI to USB Bridge
AWR Register
The AWR register contains the USB device address and the Remote wake-up function control bit.
The initial value of the USB device address is 00H. The address value extracted from the USB
command is to be immediately loaded into this register or not depending upon the device address
update control bit ASET in the SIES register.
AWR Register
Bit
7
6
5
4
3
2
1
0
Name
R/W
POR
UAD6
R/W
0
UAD5
R/W
0
UAD4
R/W
0
UAD3
R/W
0
UAD2
R/W
0
UAD1
R/W
0
UAD0
R/W
0
WKEN
R/W
0
Bit 7~1 UAD6~UAD0: USB device address
Bit 0
WKEN: USB device Remote Wake-up function enable control
0: disable USB remote wake-up function
1: enable USB remote wake-up function
STALL Register
The STALL register shows whether the corresponding endpoint works properly or not. As soon
as the endpoint works improperly, the related bit in the STALL register has to be set to 1 by
application program. The contents of the STALL register will be cleared by USB reset signal.
STALL Register
Bit
7
6
5
4
3
2
1
0
Name
R/W
POR
―
―
―
―
―
―
STL5
R/W
1
STL4
R/W
1
STL3
R/W
1
STL2
R/W
1
STL1
R/W
1
STL0
R/W
1
Bit 7~6
Bit 5~0
Rev 1.00
Unimplemented, read as “0”.
STL5~STL0: USB endpoint stall indication
0: the corresponding USB endpoint is not stalled.
1: the corresponding USB endpoint is stalled.
The STL bit is set by users when the related USB endpoint is stalled. These
bits are cleared by USB reset signal. For endpoint 0 the stall bit STL0 can also
be cleared by Setup Token event.
11
March 22, 2010
HT45B0K
SPI to USB Bridge
SIES Register
The SIES register is used to indicate the present signal state which the SIE receives and also control
whether the SIE changes the device address automatically or not.
SIES Register
Bit
7
6
5
4
3
2
1
0
Name
R/W
POR
NMI
R/W
0
EOT
R
0
CRCF
R/W
0
NAK
R
0
IN
R
0
OUT
R/W
0
ERR
R/W
0
ASET
R/W
0
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Rev 1.00
NMI: Endpoint 0 NAK token interrupt mask control
0: Endpoint 0 NAK token interrupt is not masked.
1: Endpoint 0 NAK token interrupt is masked.
If this bit is set to 1, the interrupt will not occur when the device sends a NAK
token to the USB host from Endpoint 0. Otherwise, when this bit is set to 0
and the device Endpoint 0 sends a NAK token to the USB host, the Endpoint 0
NAK token interrupt will be generated if the corresponding endpoint interrupt
control is enabled.
EOT: End of Transaction indication flag
0: USB transaction is in progress.
1: USB transaction has ended.
If this bit is zero, it indicates that the USB transaction is in progress. When the
level of the EOT bit changes from 0 to 1, it means that the USB transaction
has ended.
CRCF: Error indication flag during transfer
0: No USB transfer error occurs.
1: USB transfer error has occurred.
The Error conditions include CRC, PID and incomplete token errors. The
CRCF bit is set by hardware and is necessary to be cleared by firmware.
NAK: NAK signal indication flag
0: No NAK signal is transmitted.
1: NAK signal has been transmitted.
The NAK bit is used to indicate that the SIE has transmitted a NAK signal to
the USB host in response to the USB host IN or OUT token when the endpoint
was accessed.
IN: IN token indication flag for Endpoint 0
0: the received token packet is not IN token.
1: the received token packet is IN token.
The IN bit is used to indicate that for the USB endpoint 0 the current received
signal from the USB host is IN token.
OUT: OUT token indication flag for Endpoint 0
0: the received token packet is not OUT token.
1: the received token packet is OUT token.
The OUT bit is used to indicate that for the USB endpoint 0 the current
received signal from the USB host is OUT token except for the OUT zero
length token. The firmware clears this bit after the OUT data has been read.
Also, this bit will be cleared by SIE after the next valid SETUP token is
received.
ERR: Error indication flag during endpoint 0 FIFO is accessed
0: No error occurs during endpoint 0 FIFO is accessed.
12
March 22, 2010
HT45B0K
SPI to USB Bridge
Bit 0
1: Error has occurred during endpoint 0 FIFO is accessed.
The ERR bit is used to indicate that there are some errors occurred during
endpoint 0 FIFO is accessed. This bit is set by SIE and should be cleared by
firmware.
ASET: Device Address update control
0: device address is updated immediately when the AWR register is written.
1: device address is updated after the device IN token data has been read
(SETUP stage finished).
The ASET bit is used to configure the SIE to automatically update the device
address with the value stored in the AWR register. When this bit is set to 1
by firmware, the SIE will update the device address with the value stored
in the AWR register after the USB host has successfully read the data from
the device by IN token. Otherwise, when this bit is cleared to 0, the SIE will
update the device address immediately after an address is written to the AWR
register.
MISC Register
The MISC register contains the commands to control the desired endpoint FIFO action along with
the status to show the condition of the desired endpoint FIFO. The MISC register will be cleared by
a USB reset signal.
MISC Register
Bit
7
6
5
4
3
2
1
0
Name
R/W
POR
LEN0
R/W
0
READY
R
x
SETCMD
R/W
1
―
―
―
―
―
―
CLEAR
R/W
0
TX
R/W
0
REQUEST
R/W
0
Bit 7
Bit 6
Bit 5
Bit 4~3
Bit 2
Bit 1
Rev 1.00
“x” means unknown.
LEN0: zero-length packet indication flag for Endpoint 0
0: no operation.
1: a zero-length packet is sent from the USB host.
If this bit is set to 1, it indicates that a 0-sized packet is sent from a USB host. This bit
should be cleared by the application program or by the next valid SETUP token.
READY: Endpoint FIFO Ready indication flag
0: the desired endpoint FIFO is not ready.
1: the desired endpoint FIFO is ready.
This bit is used to indicate whether the desired endpoint FIFO is ready to operate or not.
SETCMD: SETUP command indication flag
0: the data in the endpoint 0 FIFO is not SETUP token.
1: the data in the endpoint 0 FIFO is SETUP token.
This bit is used to indicate whether the data in the Endpoint 0 FIFO is SETUP token or
not. It is set by hardware and cleared by firmware.
Unimplemented, read as “0”.
CLEAR: clear requested FIFO
0: no operation.
1: clear the requested endpoint FIFO.
This bit is used by MCU to clear the requested FIFO, even if the FIFO is not ready. If
user wants to clear the current requested Endpoint FIFO, the CLEAR bit should be set to
1 to generate a positive pulse with 2μs pulse width and then clear this bit to zero.
TX: Direction of data transfer between the MCU and the endpoint FIFO
13
March 22, 2010
HT45B0K
SPI to USB Bridge
Bit 0
0: the data transfer from the endpoint FIFO to the MCU
(MCU read data from the endpoint FIFO).
1: the data transfer from the MCU to the endpoint FIFO
(MCU write data to the endpoint FIFO).
This bit defines the direction of data transfer between the MCU and the endpoint FIFO.
When the TX bit is set to high, this means that the MCU desires to write data to the
endpoint FIFO. After the MCU write operation has been complete, this bit has to be
cleared to zero before terminating FIFO request to indicate the end of data transfer. For
a MCU read operation, this bit has to be cleared to zero to show that the MCU desires
to read data from the endpoint FIFO and has to be set to high before terminating FIFO
request to indicate the end of data transfer after the completion of MCU read operation.
REQUEST: FIFO request control
0: no operation.
1: Request the desired FIFO.
This bit is used to request the operation of the desired FIFO. After selecting the desired
endpoint, the FIFO can be requested by setting this bit to high. After completion, this bit
has to be cleared to zero.
The MCU can communicate with the endpoint FIFO by setting the corresponding registers, whose
addresses are listed in the following table. After reading the current data, the next data will show
after 2μs, used to check the endpoint FIFO status and responds to the MISC register, if a read/write
action is still being implemented.
Some timing constrains are listed here. By setting the MISC register, the MCU can perform
reading, writing and clearing actions. There are some examples shown in the following for the
endpoint FIFO reading, writing and clearing.
Read or Write FIFOn Table (n=0~5)
Actions
MISC Setting Flow and Status
00H → 01H → delay 2μs, check 41H (ready) or 01H (not
ready) → 00H.
02H → 03H → delay 2μs, check 43H (ready) or 03H (not
ready) → 02H.
00H → 01H → delay 2μs, check 41H → read* from
FIFOn register and check not ready (01H) → 03H →
02H.
02H → 03H → delay 2μs, check 43H → write* to FIFOn
register and check not ready (03H) → 01H → 00H.
00H → 01H → delay 2μs, check 81H → clear LEN0 (01H)
→ 03H → 02H.
02H → 03H → delay 2μs → 01H → 00H.
Check whether FIFOn can be read or not
Check whether FIFOn can be written or not
Read FIFOn sequence
Write FIFOn sequence
Read 0-sized packet sequence from FIFO0
Write 0-sized packet sequence to FIFOn
Note *: There are 2μs existing between 2 reading actions or between 2 writing actions.
R E Q U E S T
R E Q U E S T
T X
T X
R E A D Y
R E A D Y
R e a d F IF O
Rev 1.00
T im in g
14
W r ite F IF O
T im in g
March 22, 2010
HT45B0K
SPI to USB Bridge
SETIO Register
The SETIO register is used to configure the endpoint FIFO as IN pipe or OUT pipe.
SETIO Register
Bit
7
6
5
4
3
2
1
0
Name
R/W
POR
―
―
―
―
―
―
SETIO5
R/W
1
SETIO4
R/W
1
SETIO3
R/W
1
SETIO2
R/W
1
SETIO1
R/W
1
DATATG
R/W
0
Bit 7~6
Bit 5~1
Bit 0
Unimplemented, read as “0”.
SETIO5~SETIO1: Endpoint 5 FIFO ~ Endpoint FIFO1 pipe direction control.
0: the corresponding endpoint FIFO is configured as OUT pipe.
1: the corresponding endpoint FIFO is configured as IN pipe.
If the related SETIO bit is set to 1, the corresponding endpoint FIFO is configured as IN
pipe for IN token operation. Otherwise, the corresponding endpoint FIFO is configured
as OUT pipe for OUT token operation. The purpose of this function is to avoid the USB
host from abnormally sending only an IN token or OUT token and disable the related
endpoint.
DATATG: DATA0 toggle bit
0: no operation.
1: DATA0 will be sent first.
As the USB specification defined, when the USB host sends a “Set Configuration”
SETUP token, the Data pipe should send the DATA0 (Data toggle) first. Therefore,
when the USB device receives a “Set Configuration” SETUP token, user needs to set
DATATG bit to 1 and then clear it to zero after a 2μs delay to generate a positive pulse
with 2μs pulse width to make sure that the next data will send a DATA0 first.
UIC register
The UIC register is used to control the interrupt request for each endpoint. Interrupts can be enabled
or disabled independently if the corresponding endpoint FIFO pipes are enabled.
UIC Register
Bit
7
6
5
4
3
2
1
0
Name
R/W
POR
―
―
―
―
―
―
EU5I
R/W
0
EU4I
R/W
0
EU3I
R/W
0
EU2I
R/W
0
EU1I
R/W
0
EU0I
R/W
0
Bit 7~6
Bit 5~0
Rev 1.00
Unimplemented, read as “0”.
EU5I~EU0I: USB Endpoint 5 ~ Endpoint 0 interrupt control as being accessed.
0: disable the corresponding endpoint interrupt as it is accessed.
1: enable the corresponding endpoint interrupt as it is accessed.
If the related Endpoint FIFO pipe is enabled and the corresponding Endpoint interrupt is
enabled, the USB interrupt for endpoint access will occur. Then a low pulse signal will
be generated on
line to get the attentions from the host MCU.
15
March 22, 2010
HT45B0K
SPI to USB Bridge
PIPE Register
The PIPE register is used to control that the FIFO pipe for each endpoint is enabled or disable. The
endpoint access interrupt can be controlled independently by configuring the UIC register if the
corresponding Endpoint FIFO pipe is enabled.
PIPE Register
Bit
7
6
5
4
3
2
1
0
Name
R/W
POR
SUSPC
R/W
0
―
―
―
EP5E
R/W
0
EP4E
R/W
0
EP3E
R/W
0
EP2E
R/W
0
EP1E
R/W
0
―
―
―
Bit 7
Bit 6
Bit 5~1
Bit 0
SUSPC: USB PHY control in suspend mode
0: the USB PHY is enabled.
1: the USB PHY is disabled.
If the USB enters the suspend mode, user can set SUSPC bit to 1 to disable the USB
PHY for low power consumption. When the USB receives the resume signal from the
USB host, the SUSPC bit should be set to 0 to make sure that the USB PHY can work
normally.
Unimplemented, read as “0”.
EP5E~EP1E: USB Endpoint 5 ~ Endpoint 0 FIFO pipe enable control.
0: the corresponding Endpoint FIFO Pipe is disabled.
1: the corresponding Endpoint FIFO Pipe is enabled.
If the corresponding Endpoint FIFO pipe is disabled, the read/write operations to the
related Endpoint FIFO Pipe are not available. If the corresponding Endpoint FIFO
Pipe and the interrupt are both enabled, the related USB Endpoint interrupt will be
generated as the interrupt trigger events occur. Otherwise, if the Endpoint FIFO Pipe
or the Endpoint interrupt is disabled, the corresponding Endpoint interrupt will not be
generated.
Unimplemented, read as “0”.
SWRST register
The SWRST register controls the software reset operation of the device. The only one available
bit named RESET in the SWRST register is the device software reset control bit. When this bit is
equal to “0”, the device operates normally. If this bit is equal to “1”, the whole device will be reset
act just like power-on reset. When this situation occurs, all of the device registers and the circuitry
relevant to SPI interface and USB Module will be reset. The registers in this device including the
status registers and control registers will keep the POR states shown in the above USB registers
summary table after the reset condition occurs.
SWRST Register
Bit
7
6
5
4
3
2
1
0
Name
R/W
POR
―
―
―
―
―
―
―
―
―
―
―
―
―
―
―
―
―
―
―
―
―
RESET
R/W
0
Bit 7~1
Bit 0
Rev 1.00
Unimplemented, read as “0”.
RESET: device software reset
0: no action
1: device reset occurs
16
March 22, 2010
HT45B0K
SPI to USB Bridge
FIFO0~FIFO5 Registers
The FIFO0~FIFO5 Registers are used for data transactions between the USB device and the USB
host. The MCU reads data from or writes data to the FIFOs via the SPI interface to complete
data interchange. For “Interrupt transfer” it is supported by FIFO0~FIFO2 and FIFO4, while it is
supported by FIFO3 and FIFO5 for “Bulk transfer”.
FIFO0~FIFO5 Registers
Label
Type
POR
FIFO0
FIFO1
FIFO2
FIFO3
FIFO4
FIFO5
R/W
R/W
R/W
R/W
R/W
R/W
xxxx xxxx
xxxx xxxx
xxxx xxxx
xxxx xxxx
xxxx xxxx
xxxx xxxx
MISC Setting Flow and Status
Data pipe for endpoint 0, depth = 8 bytes
Data pipe for endpoint 1, depth = 8 bytes
Data pipe for endpoint 2, depth = 8 bytes
Data pipe for endpoint 3, depth = 64 bytes
Data pipe for endpoint 4, depth = 8 bytes
Data pipe for endpoint 5, depth = 64 bytes
“x” means unknown.
Rev 1.00
17
March 22, 2010
HT45B0K
SPI to USB Bridge
USB Module Suspend Mode and Wake-up
USB Suspend Mode
If there is no signal on the USB bus for over 3ms, the devices will go into a suspend mode. The
Suspend indication bit SUSP, bit 0 of the USC register, will be set to 1 and a USB interrupt will
be generated to indicate that the device should jump to the suspend state to meet the 500μA USB
suspend current specification. In order to meet the 500μA suspend current, the firmware should
disable the USB clock by clearing the USB clock enable control bit USBCKEN in the UCC register
to 0. Also the USB PLL and PHY circuitry control bits known as PLL and SUSPC should be set to
1 to disable the USB PLL and PHY function. The suspend current is about 400μA.
USB Host Wake-up
When the resume signal is asserted by the USB host, the USB device will be woken up with a USB
interrupt generated on the INT line and the Resume indication bit RESUME in the USC register
will be set. In order to make the device function properly, the application program must set the
USBCKEN bit in the UCC register to 1 and clear the PLL and SUSPC bits in the USC register
and PIPE register respectively to 0. When the resume signal is de-asserted by the USB host, the
USB device actually leaves the suspend mode and the USB host will start to communicate with the
USB device. The SUSP bit will be cleared as well as the RESUME bit when the USB device really
leaves the suspend mode. So when the MCU is detecting the Suspend bit, the Resume bit should
be stored and taken into consideration. The following diagram shows the relationship between the
SUSP and RESUME bits and INT signal.
S U S P
R E S U M E
IN T
Suspend and Host Wake-up
USB Remote Wake-up
As the device has a remote wake-up function, it can wake up the USB Host by sending a wake-up
pulse by setting the RMWK bit in the USC register to 1 for 2μs and then setting the RMWK bit to 0.
Once the USB Host receives a wake-up signal from the device, it will send a Resume signal to the
device. The timing is as follows:
S U S P
2μs (Min.)
R M W K
R E S U M E
2 .5 m s ( M in .)
IN T
Suspend and Remote Wake-up
Rev 1.00
18
March 22, 2010
HT45B0K
SPI to USB Bridge
USB Interrupt Structure
Several individual USB conditions can generate a USB interrupt. These conditions are the USB
suspended, USB resume, USB reset and USB endpoint FIFO access events. When the USB
interrupt caused by any of these conditions occurs, a low pulse will be generated on the INT line to
get the attention of the microcontroller or microprocessor.
For the USB Endpoint FIFO access event, there are the corresponding indication flags to indicate
which endpoint FIFO is accessed. As the Endpoint FIFO access flag is set, it will generate a USB
interrupt on INT line if the associated Endpoint FIFO pipe and interrupt control are both enabled.
The Endpoint FIFO access flags should be cleared by the application program. As the USB
suspended, USB resume or USB reset condition occurs, the corresponding indication flag, known
as SUSP, RESUME and URST bits, will be set and a USB interrupt will directly generated without
any associated interrupt control being enabled. The SUSP, RESUME and URST bits are read only
and set or cleared by the USB SIE.
U S C R e g is te r
S u s p e n d in d ic a tio n fla g
S U S P
R e s u m e in d ic a tio n fla g
R E S U M E
IN T
R e s e t in d ic a tio n fla g
U R S T
E n d p o in t F IF O a c c e s s
in d ic a tio n fla g E P n IF
E U n I
0
1
U IC R e g is te r
U S R
E P n E
0
1
P IP E R e g is te r
R e g is te r
USB Interrupt Structure
Rev 1.00
19
March 22, 2010
HT45B0K
SPI to USB Bridge
Application Circuit
MCU Connection
H T 4 5 B 0 K
H o s t M C U
S D O
S D I
S D O
S D I
S C K
S C K
U D P
S C S
C L K I
S C S
P C K
IN T n
IN T
V S S
V S S
V D D
V D D
U D N
V 3 3 O
USB Connection for 5V application
V C C
1
S D I
S D O
S C K
S C S
C L K I
IN T
1 6
3
4
5
6
V D
V D
V 3 3
U D
U D
D
N
0 .1 u F
V C C
1 0
D
1 1
1 .5 K
1 4
O
V C C
V C C
V C C
1 0 u F
0 .1 u F
3
4
3 3
9
V S S
V S S
V D D
U S B U S B +
V S S
2
1 3
P
U S B C O N
1
3 3
1 2
0 .1 u F
7
4 7 p F
4 7 p F
H T 4 5 B 0 K
USB Connection for 3.3V application
V C C 3 .3 V
V C C
H T 7 3 3 3
3
1 0 u F
V C C 3 .3 V
O U T
S D I
S D O
S C K
S C S
C L K I
IN T
V D
V D
V 3 3
U D
U D
N
D
V C C
V C C 3 .3 V
V C C
1 .5 K
1 0
D
0 .1 u F
1
V C C 3 .3 V
1 6
3
4
5
6
2
G N D
0 .1 u F
1
IN
0 .1 u F
V C C
1 0 u F
0 .1 u F
U S B C O N
1 1
1 4
O
1 2
P
V S S
V S S
2
3
1 3
7
1
3 3
3 3
9
4 7 p F
4
V D D
U S B U S B +
V S S
4 7 p F
H T 4 5 B 0 K
Rev 1.00
20
March 22, 2010
HT45B0K
SPI to USB Bridge
Package Information
16-pin NSOP (150mil) Outline Dimensions
1 6
A
9
B
8
1
C
C '
G
H
D
=
F
E
● MS-012
Symbol
A
Min.
Nom.
Max.
0.228
―
0.244
B
0.150
―
0.157
C
0.012
―
0.020
C’
0.386
―
0.394
D
―
―
0.069
E
―
0.050
―
F
0.004
―
0.010
G
0.016
―
0.050
H
0.007
―
0.010
α
0°
―
8°
Symbol
Rev 1.00
Dimensions in inch
Dimensions in mm
Min.
Nom.
Max.
A
5.79
―
6.20
B
3.81
―
3.99
C
0.30
―
0.51
C’
9.80
―
10.01
D
―
―
1.75
E
―
1.27
―
F
0.10
―
0.25
G
0.41
―
1.27
H
0.18
―
0.25
α
0°
―
8°
21
March 22, 2010
HT45B0K
SPI to USB Bridge
Reel Dimensions
D
T 2
A
C
B
T 1
SOP 16N (150mil)
Symbol
Rev 1.00
Description
Dimensions in mm
A
Reel Outer Diameter
330.0±1.0
B
Reel Inner Diameter
100.0±1.5
C
Spindle Hole Diameter
D
Key slit Width
T1
Space Between Flange
T2
Reel Thickness
13.0 +0.5/-0.2
2.0±0.5
16.8 +0.3/-0.2
22.2±0.2
22
March 22, 2010
HT45B0K
SPI to USB Bridge
Carrier Tape Dimensions
P 0
D
P 1
t
E
F
W
C
D 1
B 0
P
K 0
A 0
R e e l H o le
IC p a c k a g e p in 1 a n d th e r e e l h o le s
a r e lo c a te d o n th e s a m e s id e .
Symbol
Rev 1.00
Description
Dimensions in mm
W
Carrier Tape Width
16.0±0.3
P
Cavity Pitch
8.0±0.1
E
Perforation Position
1.75±0.1
F
Cavity to Perforation (Width Direction)
7.5±0.1
D
Perforation Diameter
1.55 +0.10/-0.00
D1
Cavity Hole Diameter
1.50 +0.25/-0.00
P0
Perforation Pitch
4.0±0.1
P1
Cavity to Perforation (Length Direction)
2.0±0.1
A0
Cavity Length
6.5±0.1
B0
Cavity Width
10.3±0.1
K0
Cavity Depth
2.1±0.1
t
Carrier Tape Thickness
0.30±0.05
C
Cover Tape Width
13.3±0.1
23
March 22, 2010