![](http://datasheet.mmic.net.cn/Flexipanel/USB-SPI-DIL_datasheet_99871/USB-SPI-DIL_5.png)
p5 of 9
26-Aug-10
USB-SPI
HW144-7
www.hexwax.com
Application Circuits
The following circuits are typical implementations of the
USB-SPI. Suggested component values are shown in
table 5. For initial evaluation, the Bus Powered Device
circuit is recommended.
Table 5. Suggested component values
Label
Component
R1-R2, R1x
22k resistor
R4, R5, R30, R50
4k7 resistor
R6
1k resistor
R2x
470Ω resistor
R40
100k resistor
T1, T2
P-channel Mosfet, e.g. NDS352P
D1, D2
Low Vf switching diode
LED1x
Light emitting diode
C1
1μF capacitor
C2, C3
22pF capacitor
C4, C6-C7
100nF capacitor
C8
470nF capacitor
PB1x
Pushbutton or switch
X1
12MHz parallel cut crystal
Bus Powered Device
Figure 2 is the suggested circuit when initially evaluating
USB-SPI.
R
es
et
#
P
G
D
V
dd
V
ss
TEAclipper
connector 1
5
OSC1
OSC2
D+
Vusb
Figure 2
USB-SPI
USB
C2
C3
X1
2
3
4
Vdd
Vss
Vdd
P
G
C
1
2
3
4
Vss
D-
Vss
C1
C6
C7
V
ss
C8
Reset#
Send
AllSysGo#
Vdd
Vss
R1x
PB1x
One pushbutton
circuit for each input
(Active low shown)
Tx Ind
Rx Ind
Vdd
R2x
One LED circuit
for each output
(Active low shown)
S
#
S
C
K
M
IS
O
M
O
S
I
S
us
pe
nd
#
Host
Microcontroller
S
#
S
C
K
M
IS
O
M
O
S
I
S
ht
D
n#
Vss
Vdd
B
uf
fN
ot
F
ul
l
B
uf
fE
m
pt
y
B
u
ffN
ot
F
u
ll
B
uf
fE
m
pt
y
The microcontroller sends and receives data via its SPI
pins MISO, MOSI, SCK and SS#. The Rx Buff Not Full
and Tx Buffer Full can be monitored if required for flow
control. When Rx Buffer Not Full is low, no data should
be sent to the USB-SPI. If Tx Buff Empty is high and
the microcontroller reads data from USB-SPI, then Null
Tx Char will be read.
When it ShtDn# low, the
microcontroller and the rest of the circuit should go into
a sleep state.
The pushbutton circuits allow you to apply logic 1 or
logic 0 to input pins. The LED circuits allow you to view
the state of output pins. As shown they are active low.
For commercial applications these circuits need only be
provided if required.
Oscillator X1/C2/C3 may be replaced by a low-cost
resonator, provided its frequency tolerance is greater
than 0.25%. C1 and C6 should be placed close to the
USB connector. C7 should be placed near the Vss and
Vdd pins of the USB-SPI and is required only if it would
be some distance from C6. C8 is a filter capacitor for an
internal regulator and is required.
The TEAclipper connector is for in-circuit programming
of devices where the firmware has been purchased from
HexWax. It is recommended to allow firmware updates,
even if the firmware is initially supplied pre-programmed.
Self Powered Device
A self-powered device does not need to draw power
from the USB bus. In this case, the USB-SPI can be put
into sleep mode when USB power is not available. The
sub-circuit required to do this is shown in figure 3. If the
device is self-powered, it is not necessary to enter the
sleep state if the Suspend indicate is active.
D+
Figure 3
USB-SPI
USB
1
2
3
4
Vss
D-
USB Pwr Sns
R3
Vdd
Vss
Self Power Source
R4
Vss
Both-powered Powered Device
If both self-powered and bus powered configurations are
possible, a circuit must be provided to switch over power
to USB power. An example sub-circuit is given in figure
4, where it is assumed that USB power is used when it
is available. To give self-power priority, place T2 so that
it switches the USB power line instead. D1 and D2
ensure that the two power lines are not in contention. If
the self-power source is 3.3V, the diodes will be
sufficient and T2 will not be required at all.
Figure 4
USB-SPI
Vdd
Self-Power Vdd
3.3V - 5V
R40
USB-Power Vdd
Vss
T2
R50
Self Pwr
Sns
USB Pwr
Sns
R30
D1
D2
Power Take-Off
A device should only draw current from the USB line
once USB configuration is complete and the host PC is
not is sleep mode. The AllSysGo# output (active low)
can provide such a switch using the sub-circuit shown in
figure 5. C4 / R6 provide a slow switch-on to prevent
inrush current exceeding USB power limitations. 1μF
and 100nF smoothing capacitors are recommended on
both self and USB power lines. The Low Pwr output