You are on page 1of 3

V I S H AY S E M I C O N D U C T O R S

www.vishay.com

Optocouplers Application Note 05

Optocoupler as Optical Isolator for SPI Bus System


By Dimitrij Martins and Achim M. Kruck

INTRODUCTION OPTICAL ISOLATION


The serial peripheral interface (SPI) bus as shown in Fig. 1 is In case of electrical noise, coupling effects, or level shifting
a synchronous serial, four-wire, multi-user bus with a clock requirements, an optocoupler is a perfect solution for
frequency up to a few MHz. The application areas are isolating a master and slave. Due to galvanic isolation, an
inter-chip communication in audio and measurement, LCD optocoupler helps to break up ground loops and reduce the
displays, SD cards, etc. The SPI bus consists of four lines: a noise due to optical light transmission across an isolation
serial clock line (SCLK), master output slave input (MOSI), barrier. It can also restore the signal logic level and further
master input slave output (MISO), and optional slave select be used for signal level transforming between different
(SS). voltage levels, e.g. from 5 V to 3.3 V.
One channel is required for the serial clock line (SCLK), one
SCLK for the forward data transmission (MOSI), one for the
backward data transmission (MISO), and one channel for
MOSI the slave select line (SS) as shown in Fig. 1.
Master Slave
MISO DESIGN CONSIDERATIONS
When the slave select line (SS) is pulled down to the logic
SS
“L” stage, a voltage divider is formed by the pull-up resistor
(RP) and the internal NMOS drain source junction. The
Fig. 1 - 1 Master - 1 Slave SPI Connection output voltage (VO) is the voltage drop of the open drain
output (VOL), as shown in Fig. 3.
Each line is uni-directional. The master selects a slave by
pulling the slave select (SS) line to the logic “L” stage and VCC
can communicate with the chosen slave.
In case of more than one slave, each slave needs its own VRP
RP
slave select (SS) line.
VO
SCLK D VOL

MOSI
S
MISO
Master Slave 1 Fig. 3 - Voltage Divider
APPLICATION NOTE

SS1
For the logic “H” stage, pull-up resistors (RP, as shown in
Fig. 4) are required and can be calculated with Equation 1
below:
V CC - V OL
R P = --------------------------- (1)
I OL
Slave 2

SS2

Fig. 2 - 1 Master - 2 Slaves SPI Connection

Revision: 31-Aug-2023 1 Document Number: 80052


For technical questions, contact: optocoupleranswers@vishay.com
THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT NOTICE. THE PRODUCTS DESCRIBED HEREIN AND THIS DOCUMENT
ARE SUBJECT TO SPECIFIC DISCLAIMERS, SET FORTH AT www.vishay.com/doc?91000
Application Note 05
www.vishay.com
Vishay Semiconductors

Optocoupler as Optical Isolator for SPI Bus System

EXAMPLE CIRCUIT
X1 X3
1 VCC1 VCC2 1
2 GND1 GND2 2

Isolation

RP1

RP2

RP4
RP3

R3
R4

R2

R1
GND1 SCLK (forward) GND2
OC1
A1 VCC

X2 C1 VO1 X4
1 SCLK/IN C1 SCLK/OUT 1
2 MOSI/IN C2 VO2 MOSI/OUT 2
3 MISO/OUT MISO/IN 3
4 SS/IN A2 GND SS/OUT 4

MOSI (forward)
GND2
OC2 MISO (backward)
VCC NC

VE A
C2
VO C

GND NC

OC3
GND1 NC VCC

A VE
C3
C VO

NC GND

SS (forward)
GND2

Fig. 4 - Example Schematic for Optical SPI Isolator

Fig. 4 depicts an exemplary optical SPI isolator circuit. V CC1 - V F


Vishay’s 10 MBd high speed optocouplers are used: a R 1 = R 2 = R 4 = -------------------------- (2)
IF
single channel VOH260A (1) for OC2 (MISO (forward)) and
OC3 (SS (forward)), and a dual-channel VOH263A (2) for
OC1 (SCLK / MOSI (forward)). Both are available in V CC2 - V F
APPLICATION NOTE

DIP-8 and SOIC-8 packages, named as VOIH060A (3) and R 3 = -------------------------- (3)
IF
VOIH063A (4).
By assuming that SCLK/IN (X2), MOSI/IN (X2), MISO/IN (X4), According to the datasheet figure “Voltage vs. Forward
and SS/IN (X2) are at the logic “L” stage (saturation voltage Current”, (1) a voltage drop (VF) of 1.35 V is caused by a
drop of connected devices at X2 and X4 is neglected), the forward current (IF) of 10 mA through the input LED, as
resistors R1, R2, R3, and R4 set the forward current (IF) shown in Fig. 5.
through the emitter LEDs of the optocoupler (OC1, OC2, and
OC3) inputs and can be calculated with Equations 2 and 3:
Notes
(1) www.vishay.com/ppg?80354
(2) www.vishay.com/ppg?80355
(3) www.vishay.com/ppg?80356
(4) www.vishay.com/ppg?80357

Revision: 31-Aug-2023 2 Document Number: 80052


For technical questions, contact: optocoupleranswers@vishay.com
THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT NOTICE. THE PRODUCTS DESCRIBED HEREIN AND THIS DOCUMENT
ARE SUBJECT TO SPECIFIC DISCLAIMERS, SET FORTH AT www.vishay.com/doc?91000
Application Note 05
www.vishay.com
Vishay Semiconductors

Optocoupler as Optical Isolator for SPI Bus System

optocoupler OC2 output VO is also at the logic “H” stage.


Axis Title When MISO/IN (X4) is at the logic “L” stage, forward current
100 10000
(IF) is flowing through the emitter LED (A / C) and the
Tamb = -40 °C optocoupler OC2 output VO is also at the logic “L” stage.
Tamb = 25 °C When SS/IN (X2) is at the logic “H” stage, no forward current
IF - Forward Current (mA)

10
Tamb = 85 °C 1000
(IF) is flowing through the emitter LED (A / C) and the
optocoupler OC3 output VO is also at the logic “H” stage.

2nd line
1st line
2nd line

1 Tamb = 110 °C When SS/IN (X2) is at logic “L” stage, forward current (IF) is
flowing through the emitter LED (A / C) and the optocoupler
100 OC3 output VO is also at the logic “L” stage.
0.1
RECOMMENDED PARTS

0.01 10
TABLE1 - OPTICAL SPI ISOLATOR
0.8 1.0 1.2 1.4 1.6 1.8 IDENTIFIER COMMENT
VF - Forward Voltage (V) X1 Pin header, 2 circuits
Fig. 5 - VOH260A Datasheet – VF vs. IF X2 Pin header, 4 circuits
X3 Pin header, 2 circuits
By using 5 V as the supply voltage (VCC1, VCC2), values for X4 Pin header, 4 circuits
the resistors R1, R2, R3, and R4 can be calculated using R1 365 Ω resistance
Equations 4 and 5:
R2 365 Ω resistance
5 V - 1.35 V (1) R3 365 Ω resistance
R 1 = R 2 = R 4 = -------------------------------- = 365 Ω (4)
10 mA R4 365 Ω resistance
RP1 350 Ω resistance (1)
5 V - 1.35 V (1) RP2 350 Ω resistance (1)
R 3 = -------------------------------- = 365 Ω (5)
10 mA RP3 350 Ω resistance (1)
RP4 350 Ω resistance (1)
The capacitors C1, C2, and C3 stabilize the power supply C1 100 nF capacitance
and should be placed as close as possible to the C2 100 nF capacitance
optocouplers OC1, OC2, and OC3. C3 100 nF capacitance
Note 10 MBd (dual) high speed optocoupler
(1) The closest value to a resistor E series can be chosen OC1
VOH263A
10 MBd (single) high speed optocoupler
OC2
TRANSMISSION VOH260A
When SCLK/IN (X2) is at the logic “H” stage, no forward 10 MBd (single) high speed optocoupler
OC3
current (IF) is flowing through the emitter LED (A1 / C1) and VOH260A
the optocoupler OC1 output VO1 is also at the logic “H” Note
stage. When SCLK/IN (X2) is at the logic “L” stage, forward (1) Recommended load resistance

current (IF) is flowing through the emitter LED (A1 / C1) and
APPLICATION NOTE

the optocoupler OC1 output VO1 is also at the logic “L” CONCLUSION
stage. It can be seen that by using Vishay’s 10 MBd high speed
When MOSI/IN (X2) is at the logic “H” stage, no forward optocoupler series, it is easily possible to galvanically isolate
current (IF) is flowing through the emitter LED (A2 / C2) and SPI bus systems. Ground loops and electrical noise can be
the optocoupler OC1 output VO2 is also at the logic “H” eliminated due to long term proven and robust optical
stage. isolation technology.
When MOSI/IN (X2) is at the logic “L” stage, forward current Choosing Vishay’s small and compact SOIC-8 package
(IF) is flowing through the emitter LED (A2 / C2) and the saves board space. The availability of dual-channel, high
optocoupler OC1 output VO2 is also at the logic “L” stage. speed optocouplers in one package provides additional
When MISO/IN (X4) is at the logic “H” stage, no forward board space savings.
current (IF) is flowing through the emitter LED (A / C) and the

Revision: 31-Aug-2023 3 Document Number: 80052


For technical questions, contact: optocoupleranswers@vishay.com
THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT NOTICE. THE PRODUCTS DESCRIBED HEREIN AND THIS DOCUMENT
ARE SUBJECT TO SPECIFIC DISCLAIMERS, SET FORTH AT www.vishay.com/doc?91000

You might also like