
Getting started with the STEVAL-SPIN3202 evaluation board,
advanced BLDC controller with embedded STM32 MCU
Introduction
The STEVAL-SPIN3202 3-phase brushless DC motor driver board is based on the STSPIN32F0A 3phase controller with integrated STM32 MCU.
It implements a single shunt resistor current reading topology and provides an easy-to-use solution for
device evaluation in different applications such as home appliances, fans, drones and power tools.
The board is designed for the sensored or sensorless six-step algorithm and Field Oriented Control with
single shunt current sensing.
Figure 1: STEVAL-SPIN3202 evaluation board

Contents
1 Hardware and software requirements ............................................ 5
2 Getting started ................................................................................. 6
2.1 Hardware description and configuration ............................................ 6
2.2 Circuit description .............................................................................. 8
2.2.1 STEP/FOC selection .......................................................................... 8
2.2.2 Hall/encoder_connector motor speed sensor .................................... 9
2.2.3 Overcurrent detection and current sensing measurement ................. 9
2.2.4 Bus voltage sensing circuit ............................................................... 10
2.2.5 Hardware user interface ................................................................... 10
2.2.6 Debug ............................................................................................... 10
2.2.7 Bill of materials ................................................................................. 11
2.2.8 Schematic diagrams ......................................................................... 15
3 Revision history ............................................................................ 19

List of tables
Table 1: Hardware setting jumpers ............................................................................................................. 7
Table 2: Connectors, jumpers and test points ............................................................................................ 7
Table 3: Hall/encoder connector (J4) .......................................................................................................... 9
Table 4: Overcurrent thresholds ................................................................................................................. 9
Table 5: STEVAL-SPIN3202 bill of materials ........................................................................................... 11
Table 6: Document revision history .......................................................................................................... 19

List of figures
Figure 1: STEVAL-SPIN3202 evaluation board ......................................................................................... 1
Figure 2: STEVAL-SPIN3202 evaluation board: jumper and connector positions ..................................... 6
Figure 3: STEVAL-SPIN3202 schematic (1 of 4) ..................................................................................... 15
Figure 4: STEVAL-SPIN3202 schematic (2 of 4) ..................................................................................... 16
Figure 5: STEVAL-SPIN3202 schematic (3 of 4) ..................................................................................... 17
Figure 6: STEVAL-SPIN3202 schematic (4 of 4) ..................................................................................... 18

Hardware and software requirements
1 Hardware and software requirements
Using the STEVAL-SPIN3202 evaluation board requires the following software and
hardware:
a Windows ® PC (XP, Vista 7 , Windows 8, Windows 10 ) to install the software
package;
a mini-B USB cable to connect the STEVAL-SPIN3202 evaluation board to the PC;
the STSW-SPIN3202 firmware example or the STM32 PMSM six-step software
development kit (STSW-STM32100) (both available on www.st.com);
a 3-phase brushless DC motor with compatible voltage and current ratings;
an external DC power supply.

2 Getting started
To use the board:
1. Check the jumper position according to the target configuration (see Section 2.2.1:
"STEP/FOC selection")
2. Connect the motor to J3 connector taking care of the motor phases sequence
3. Supply the board via J2 connector input 1 and 2; the DL1 (red) LED turns on
4. Connect the board to the PC through the USB cable
5. Develop your application using the code examples provided. The STSW-SPIN3202
firmware example also provides pre-compiled binaries that are ready-to-use.
The board maximum ratings are:
power stage supply voltage (VS) from 6.7 V to 45 V;
motor phase current up to 15 Arms.
2.1 Hardware description and configuration
Figure 2: STEVAL-SPIN3202 evaluation board: jumper and connector positions

Table 1: Hardware setting jumpers
Selection of VREG connected to V motor
Selection motor power supply connected to DC power supply
Selection Hall encoder supply to USB (1)/VDD (3) power supply
Selection reset of ST-LINK (U4)
Selection PA0 connected to Hall 1
Selection PA1 connected to Hall 2
Selection PA2 connected to Hall 3
Selection mode 6STEP(1)/FOC (3)
Selection PA0 connected to OUT U
Selection PA1 connected to OUT V
Selection PA2 connected to OUT W
Table 2: Connectors, jumpers and test points
Device main power supply (VM)
3-phase BLDC motor phase connection
Hallsensors/encoder connector
Hall sensors/encoder supply
UART (ST-LINK Virtual COM)
Bootloader UART connector
12 V voltage regulator output
Speed potentiometer output

2.2 Circuit description
The STEVAL-SPIN3202 evaluation board provides a complete single-shunt six-step
solution consisting of an STSPIN32F0A (advanced BLDC controller with an embedded
STM32 MCU) and a triple half-bridge power stage with the NMOS STD140N6F7.
The STSPIN32F0A autonomously generates all the required supply voltages starting from
the motor supply: the internal DC/DC buck converter provides 3.3 V and the internal linear
regulator provides 12 V for the gate drivers.
The current feedback signal conditioning is performed through the operational amplifiers
embedded in the device and an internal comparator performs overcurrent protection via the
shunt resistor.
Two user buttons, two LEDs and a trimmer are available to implement simple user
interfaces (e.g., starting/stopping the motor and set target speed).
The STEVAL-SPIN3202 evaluation board supports the quadrature encoder and digital Hall
sensors for motor position feedback. It also provides the circuitry to sense the motor BEMF
(sensorless operation).
The board includes an ST-LINK-V2 which allows the user to debug and download firmware
without any extra hardware.
The board also supports sensored or sensorless Field Oriented Control algorithm with
single-shunt sensing.
2.2.1 STEP/FOC selection
The user can select between six-step and Field Oriented Control modes by selecting
different jumpers on the board.
By default, the six-step mode is selected as per the following configuration:
jumper connected on J12 open and jumper J11 closed;
jumper connected on JP8 between pin 1 and 2 (6 STEP position).
The Field Oriented Control mode is selected as follows:
jumper connected on J12 closed and remove jumper from J11;
jumper connected on JP8 between pin 2 and 3 (FOC position).

2.2.2 Hall/encoder_connector motor speed sensor
The STEVAL-SPIN3202 evaluation board supports the digital Hall and quadrature encoder
sensors as motor position feedback.
The sensors can be connected to the STSPIN32F0A by closing jumpers JP5, JP6 and JP7
(open by default).
When JP5, JP6 and JP7 are closed (Hall/encoder mode), JP9, JP10 and
JP11should be respectively open (BEMF sensing mode).
The Hall sensor/encoder should be connected to J4 as per the following table.
Table 3: Hall/encoder connector (J4)
Hall sensor 1/encoder out A+
Hall sensor 2/encoder out B+
Hall sensor 3/encoder zero feedback
A protection resistor of 1 kΩ is mounted in series with the sensor outputs.
For sensors requiring an external pull-up, three 10 kΩ resistors are already mounted on the
output lines and connected to the VDD voltage. On the same lines, a footprint for pull-down
resistors is also available.
The jumper JP3 selects the power supply for the sensor supply voltage:
jumper between pin 1 and pin 2: Hall sensors powered by V
USB
(5 V)
jumper between pin 1 and pin 2: Hall sensors powered by VDD (3.3 V)
2.2.3 Overcurrent detection and current sensing measurement
The STEVAL-SPIN3202 evaluation board implements overcurrent protection based on the
STSPIN32F0A integrated OC comparator.
The shunt resistor measures the load current. Resistors R26 and R27 bring the voltage
signal to the OC_COMP pin. When the peak current flowing though the shunt exceeds the
selected threshold, the integrated comparator is triggered and all the high side power
switches are disabled.
The current threshold of the STEVAL-SPIN3202 varies according to the STSPIN32F0A OC
threshold as listed in the following table.
Table 4: Overcurrent thresholds

2.2.4 Bus voltage sensing circuit
The STEVAL-SPIN3202 evaluation board provides the bus voltage sensing. This signal is
set through a voltage divider by the motor supply voltage (VBUS, R10 and R16) and sent to
the PB1 GPIO (the ADC channel 9) of the embedded MCU. The signal is also available on
the TP6.
2.2.5 Hardware user interface
The board provides the following hardware user interface:
potentiometer (R6 setting, for example, the target speed)
switch SW1 (to reset STSPIN32F0A MCU and ST-LINK V2)
switch SW2 (user button 1)
Switch SW3 (user button 2)
LED DL3 (user LED 1, turned on when the user 1 button is pressed too)
LED DL4 (user LED 2, turned on when the user 2 button is pressed too)
2.2.6 Debug
The STEVAL-SPIN3202 evaluation board embeds an ST-LINK/V2-1
debugger/programmer.
The ST-LINK features:
USB software re-enumeration
virtual com port interface on USB connected to the STSPIN32F0A (UART1) PB6/PB7
pins
mass storage interface on USB
The ST-LINK is supplied by the host PC through the USB cable connected to the board.
The LED LD1 provides ST-LINK communication status information:
Red LED flashing slowly: at power-on before USB initialization
Red LED flashing quickly: following the first successful communication between the
PC and ST-LINK/V2-1 (enumeration)
Red LED ON: the initialization between the PC and ST-LINK/V2-1 is complete
Green LED ON: successful target communication initialization
Red/green LED flashing: during communication with target
Green ON: communication successfully completed
The reset function is activated by removing the jumper J8.

2.2.7 Bill of materials
Table 5: STEVAL-SPIN3202 bill of materials
C1, C5,
C7, C8,
C9, C11,
C19, C20,
C26, C27,
C28, C29,
C33, C34,
C37
22µF 63V ±20%
L8.3_W8.3_H9.
5
220µF 63V
±20%
L13.5_W13.5_H
15
220UF_63V_RADIAL_D12.5_H
22_P5

D2, D9,
D10, D11,
D12, D13,
D14
JUMPER1
JUMPER2
JUMPER3
JUMPER4
JUMPER5
JUMPER6
22µH 0.6A
±20%
L3_W3_H1.5

R2, R7,
R8, R62,
R63, R67,
R73
100K 1/2W 0.1
L9.5_W4.9_H9.
5
R9, R14,
R43, R50,
R51, R52
R13, R45,
R46, R47,
R53, R54,
R55, R65,
R71
R17, R22,
R31, R35,
R39, R41
R18, R23,
R32, R36,
R40, R42

430483025816
L6.2_W6.2_H2.
5
TP1, TP2,
TP3, TP4,
TP5, TP7,
TP10,
TP11,
TP13,
TP14
TP6, TP8,
TP9, TP12,
TP15
STSPIN32F0A
VFQFPN48_L7_
W7_P.5
NX3225GD 8MHz EXS00ACG04874

2.2.8 Schematic diagrams
Figure 3: STEVAL-SPIN3202 schematic (1 of 4)
RESE T
2RESU
1RESU
BOURNS
3386G-1-104LF
SPEED
VM
VREG
VDD
VDD
VDD
VDD
VDD
VDD
VDD
VDD
OP2P
OP2N
OP1N
OP1P
UART1_TX
OP3P
UART1_RX
OP3N
PF0
PF1
PA0
PA1
PA2
CURR ENT_REF
PA4
PA5
PA3
GPIO_BEM F
PB1
OP1O
OP3O
OCCOMPSWD_IO
SWD_CLK
PA15
NRST
LSU
HSU
LSV
HSV
LSW
HSW
OUTU
OUTV
OUTW
NRST
PF0
PF1
PA3
OP2O
PA15
PA5
SWD_CLK
+
C2
22UF
R7
100R
C11
100NF
DL1
RED
J9
6130021112
1
1
2
TP2
1
SW3
43048302581
6
1
3
4
2
C8 100NF
R1
39K
R13
10K
R5
120R
C7 100NF
JP1
OPEN
1 2
SW1
43048302581
6
1
3
4
2
C12
1NF
TP1
1
J10
6130021112
1
1
2
U1
STSPIN32F0A
OP2P1OP2N2OP2O3PF04PF15VRE G1 26NRST7VM8SW9VDD A10PA011PA1
12
PA2
13
PA3
14
PA4
15
PA5
16
PA6
17
PA7
18
PB1
19
TES T MODE
20
OP1O
21
OP1N
22
OP 1P
23
OCC OM P
24
HSW
25
OUT W
26
VBOO T W
27
LSW
28
HSV
29
VBOO T V
31
LSV
32
OUT V
30
OUT U
34
LSU
36
HSU
33
VBOO T U
35
PA13
37
PA14
38
PA15
39
PB6
40
PB7
41
BOO T0
42
RESE RVED
43
GND
44
OP3P
45
OP3N
46
OP3O
47
VDD
48
EPAD
TP4
1
C9 100NF
D1
STPS0560 Z
C3
220NF
R14
0R
R3
330R
R8
100R
L1 22uH
744 040 322 20
R4
120R
C14
4.7NF
SW2
43048302581
6
1
3
4
2
DL3
YELLOW
R2
100R
JUMPER6
TP3
1
C10
47UF
C13
1NF
+
C4
10UF
TP9
TPSMD-1MM
1
C6
3.3NF
R6
100K
1
3
2
C1
100NF
DL4
YELLOW
C5
100NF

Figure 4: STEVAL-SPIN3202 schematic (2 of 4)
12345
S1751-46R
R60
NP
R27
OUTU
10R
R39
10K
R53
1
TP13
HO
220NF
C39NP220µF
M3
1
D4
R23
62R
10R
R17
NP
R61
HOLE_3.2MM_6
HO
680R
R49
R41
10R
VM
LSV
1
2
HSU
SENSEP
C23
C22
_6
4148WS
00
3
220NF
LE_3.2MM
3
N2
D8
N-MOS
1K
R56
2
OUTW
1
TP11
OPTICAL_TARGET
220µF
VBUS
2
C41
JP7
OPEN
3
220µF
VUSB
10PF
J4
GX_3xx
61300511121
10PF
M6
2
_6
0.02R
HO
R42
62R
2
Q1
10K
R55
D5
4148WS
JP2
Q6
N-MOS
2
LE_3.2MM
M4
C16
VDD
C17
1
R18
62R
1
1
1
R58
1K
000
PA2
2
4148WS
LE_3.2MM
PA1
TP10
4148WS
680R
CLOSE
N-MOS
1
N-MOS
LSU
JUMPER1
M8
LSW
VBUS
R57
1K
M2
1
J3
691213510003
2
2
D7
C24
10PF
2
1
_6
DL2
RED
S1751-46R
3
1
1
R36
62R
D6
4148WS
C40
1
M1
Q5
VBUS
VDD
OPTICAL_TARGET
N-MOS
Q2
R40
62R
680R
R48
PA0
R31
10R
S1751-46R
4148WS
J2
691213510002
TP7
3
D3
2
62R
R32
2
Q3
61300311121JP3
C38
220µF
NP
3
1
J1
691213510002
R26
0.02R
JP5
OPEN
Q4
SENSEN
N1
R11
M5
R22
10R
3
OUTV
C25
220NF
1
3
2
1
OPTICAL_TARGET
M7
JP6
OPEN
10R
R35
HSV
1
VBUS
S1751-46R
10K
R54
2
N-MOS
HSW
NP
R59

Figure 5: STEVAL-SPIN3202 schematic (3 of 4)
+
-
-
+
OC Comp
OCREF
OC
+
-
+
-
VBUS
Feedback
6 STEP FOC
R12 5.6K 15K
Jumper 4
Jumper 3
CLOSEDOPEN
1-2 2-3
Jumper 5 OPENCLOSED
VBU S VD D
VDD
VDD
VDD
VDD
OP1 O
OP1 N
OP1 P
OP2 O
OP2 N
OP2 P
OP3 N
OP3 O
OP3 P
OCC OM P
PB1
SEN SE N
SEN SE P
CURR EN T_R EF
GPIO _BE M F
PA0
PA1
PA2
OUT U
OUT V
OUT W
PA4
SEN SE P
TP1 2
TPS MD -1M M
1
D2
BAT 30K FILM
R24
2.2K
R25
2.2K
R28
2.2K
C43
68PF
R15
8.2K
R20 1 .2K
J12
1
2
TP8
TPS MD -1M M
1
JP8
6130031112 1
1
3
2
R19
15K
D9
BAT 30K FILM
D11
BAT 30K FILM
JUM PE R5
JP1 1
CLO SE
12
C44
68PF
JUM PE R3
D10
BAT 30K FILM
TP1 5
TPS MD -1M M
1
R16
9.31K
C21
220P F
J11
1
2
D14
BAT 30K FILM
JUM PE R4
TP6
TPS MD -1M M
1
JP9
CLO SE
1
2
R29
1K
D13
BAT 30K FILM
R34
18K
R44
4.7K
R21
NP
R9
0R
C18
4.7N F
D12
BAT 30K FILM
R33
560R
R38 18K
R10
169K
R45
10K
R47
10K
R46
10K
C42
68PF
R12 5 .6K
JP1 0
CLO SE
1
2
C19
100N F
C15 100PF
R37
33K

Figure 6: STEVAL-SPIN3202 schematic (4 of 4)
TX
RX
D-
D+
STLINKFW LOAD
3V3_STLIN K
3V3_STLIN K
VDD
3V3_S TLINK
3V3_STLINK
VUSB
3V3_STLINK
VUSB
VUSB
3V3_STLINK
VDD
UART1_TX
UART1_RX
SWD_IO
SWD_CLK
NRST
R75
4.7K
TP14
S1751-46R
1
C29
100NF
JUMPER2
J8
6130021112
1
1
2
C36
10PF
R62 100R
R71 10K
J6
1
234
C32
10NF
R65
10K
U3
LD3985M 33R
GND
2
OUT
5
VIN1BYPAS S4INH IB IT
3
R51 0R
J5
6510051612
1
USB _VCC
1
USB DM
2
USB DP
3
USB _GN D
5
SHELL6SHELL
7
SHE LL
8
ID
4
SHELL
9
R73
100R
TP16
1
R63 100R
R66
36K
C37
100NF
R50 0R
C34 100NF
R30
100K
R68
2.7K
U4
STM32F103 CBT6
PB743PB642PB5
41
PB4/JNTRST
40
PB3/JTDO
39
PA0-WKUP10PA1
11
PA212PA3
13
PA414PA515PA616PA717PA8
29
PA930PA10
31
PA1132PA12
33
PA13
34
PB018PB1
19
PB2/BOOT1
20
PB8
45
PB9
46
PB10
21
PB1122PB12
25
PB13
26
PB1427PB15
28
PC13-TAMPER-RTC
2
PC14-OSC32_IN
3
PC15-OSC32_OUT
4
VSS_1
23
OSCIN/PD0
5
NRST
7
OSCOUT/PD1
6
VSSA
8
VSS_235VSS_3
47
VBAT
1
PA1437PA15
38
VDD_1
24
BOOT0
44
VDD_348VDD_2
36
VDDA
9
R52 0R
C35
10PF
X1
8MHz
C33
100NF
JP4
OPEN
1
2
Q7
NPN
1
2
3
R69
4.7K
C31
1UF
C27
100NF
U2
USBLC6-2SC6
I/O1# 11GND
2
VBU S
5
I/O2# 4
4
I/O1# 6
6
I/O2# 3
3
R74
4.7K
R67
100R
R43
0R
C26
100NF
R72 NP
C28
100NF
TP5
S1751-46R
1
C20
100NF
R64
1.5K
R70 100K
TP17
1
J7
6130021112
1
1
2
C30
1UF
RED-GREEN
LD1
K1
A1
K2
A2
USB_DP
USB_DM
USB_RENU M
SWDIO
STLINK_TX
STLINK_RX
T_NR ST
LED_STLINK
LED_STLINK
FM_S WCLK
USB_DM
USB_RENUM
USB_DP
FM_S WDIO
T_JTC K
T_JTC K
T_JTCK
T_JTM S
T_JTMS
T_NR ST

3 Revision history
Table 6: Document revision history

IMPORTANT NOTICE – PLEASE READ CAREFULLY
STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, enhancements, modifications , and
improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST
products before placing orders. ST products are sold pursuant to ST’s terms and conditions of sale in place at the time of order
acknowledgement.
Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the
design of Purchasers’ products.
No license, express or implied, to any intellectual property right is granted by ST herein.
Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product.
ST and the ST logo are trademarks of ST. All other product or service names are the property of their respective owners.
Information in this document supersedes and replaces information previously supplied in any prior versions of this document.
© 2017 STMicroelectronics – All rights reserved