0% found this document useful (0 votes)
891 views41 pages

STM32F0 User Manual

STM32F0 User Manual

Uploaded by

andrestv93
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
891 views41 pages

STM32F0 User Manual

STM32F0 User Manual

Uploaded by

andrestv93
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

UM1525

User manual
STM32F0DISCOVERY
Discovery kit for STM32 F0 microcontrollers
Introduction
The STM32F0DISCOVERY helps you to discover the STM32 F0 Cortex-M0 features and
to develop your applications easily. It is based on STM32F051R8T6, an STM32 F0 series
32-bit ARM Cortex microcontroller, and includes an ST-LINK/V2 embedded debug tool,
LEDs, push buttons and a prototyping board.

May 2012

Figure 1.

STM32F0DISCOVERY

Table 1.

Applicable tools
Type

Part number

Evaluation tools

STM32F0DISCOVERY

Doc ID 022910 Rev 2

1/41
www.st.com

Contents

UM1525

Contents
1

Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Quick start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1

Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.2

System requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.3

Development toolchain supporting the STM32F0DISCOVERY . . . . . . . . . 7

2.4

Order code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

Hardware and layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

4.1

STM32F051R8T6 microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

4.2

Embedded ST-LINK/V2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.2.1

Using ST-LINK/V2 to program/debug the STM32 F0 on board . . . . . . . 15

4.2.2

Using ST-LINK/V2 to program/debug an external STM32 application . . 16

4.3

Power supply and power selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

4.4

LEDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

4.5

Push buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

4.6

JP2 (Idd) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

4.7

OSC clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.7.1

OSC clock supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

4.7.2

OSC 32 KHz clock supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

4.8

Solder bridges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

4.9

Extension connectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

Connecting modules on the prototyping board . . . . . . . . . . . . . . . . . . 27


5.1

Mikroelektronica accessory boards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

5.2

ST MEMS adapter boards, standard DIL24 socket . . . . . . . . . . . . . . . . 30

5.3

Arduino shield boards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

Mechanical drawing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

Electrical schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

2/41

Doc ID 022910 Rev 2

UM1525

Contents

Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

Doc ID 022910 Rev 2

3/41

List of tables

UM1525

List of tables
Table 1.
Table 2.
Table 3.
Table 4.
Table 5.
Table 6.
Table 7.
Table 8.
Table 9.
Table 10.
Table 11.
Table 12.

4/41

Applicable tools. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
ON/OFF conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Jumper states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Debug connector CN3 (SWD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Solder bridge settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
MCU pin description versus board function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Connecting using mikroBUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Connecting using IDC10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Connecting with a DIL24 board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Supported MEMS adapter boards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Connecting with Arduino shields. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

Doc ID 022910 Rev 2

UM1525

List of figures

List of figures
Figure 1.
Figure 2.
Figure 3.
Figure 4.
Figure 5.
Figure 6.
Figure 7.
Figure 8.
Figure 9.
Figure 10.
Figure 11.
Figure 12.
Figure 13.
Figure 14.
Figure 15.
Figure 16.

STM32F0DISCOVERY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Hardware block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Top layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Bottom layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
STM32F051R8T6 package. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
STM32F051R8T6 block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Typical configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
STM32F0DISCOVERY connections image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
ST-LINK connections image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Using IDC10 and mikroBUS connectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
DIL24 socket connections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Arduino shield board connections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
STM32F0DISCOVERY mechanical drawing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
STM32F0DISCOVERY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
ST-LINK/V2 (SWD only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
MCU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

Doc ID 022910 Rev 2

5/41

Conventions

UM1525

Conventions
Table 2 provides the definition of some conventions used in the present document.
Table 2.

ON/OFF conventions

Convention

Definition

Jumper JP1 ON

Jumper fitted

Jumper JP1 OFF

Jumper not fitted

Solder bridge SBx ON

SBx connections closed by solder

Solder bridge SBx OFF SBx connections left open

6/41

Doc ID 022910 Rev 2

UM1525

Quick start

Quick start
The STM32F0DISCOVERY is a low-cost and easy-to-use development kit to quickly
evaluate and start development with an STM32 F0 series microcontroller.
Before installing and using the product, please accept the Evaluation Product License
Agreement from www.st.com/stm32f0discovery.
For more information on the STM32F0DISCOVERY and for demonstration software, visit
www.st.com/stm32f0discovery.

2.1

Getting started
Follow the sequence below to configure the STM32F0DISCOVERY board and launch the
DISCOVER application:

2.2

2.3

2.4

1.

Check jumper position on the board, JP2 on, CN2 on (Discovery selected).

2.

Connect the STM32F0DISCOVERY board to a PC with a USB cable type A to mini-B


through USB connector CN1 to power the board. Red LED LD1 (PWR) and LD2 (COM)
light up and green LED LD3 blinks.

3.

Press user button B1 (bottom left corner of the board).

4.

Observe how the green LED LD3 blinking changes according to USER button B1
clicks.

5.

Each click on USER button B1 is confirmed by the blue LED LD4.

6.

To study or modify the DISCOVER project related to this demo, visit


www.st.com/stm32f0discovery and follow the tutorial.

7.

Discover the STM32F0 features, download and execute programs proposed in the list
of projects.

8.

Develop your own application using available examples.

System requirements

Windows PC (XP, Vista, 7)

USB type A to Mini-B USB cable

Development toolchain supporting the STM32F0DISCOVERY

Altium, TASKING VX-toolset

ARM, Atollic TrueSTUDIO

IAR, EWARM (IAR Embedded Workbench)

Keil, MDK-ARM

Order code
To order the STM32F0 Discovery kit, use the order code STM32F0DISCOVERY.

Doc ID 022910 Rev 2

7/41

Features

UM1525

Features
The STM32F0DISCOVERY kit offers the following features:

8/41

STM32F051R8T6 microcontroller featuring 64 KB Flash, 8 KB RAM in an LQFP64


package

On-board ST-LINK/V2 with selection mode switch to use the kit as a standalone
ST-LINK/V2 (with SWD connector for programming and debugging)

Board power supply: through USB bus or from an external 5 V supply voltage

External application power supply: 3 V and 5 V

Four LEDs:

LD1 (red) for 3.3 V power on

LD2 (red/green) for USB communication

LD3 (green) for PC9 output

LD4 (blue) for PC8 output

Two push buttons (user and reset)

Extension header for LQFP64 I/Os for quick connection to prototyping board and easy
probing.

An additional board is provided with the kit which can be connected to the extension
connector for even easier prototyping and probing.

A large number of free ready-to-run application firmware examples are available on


www.st.com/stm32f0discovery to support quick evaluation and development.

Doc ID 022910 Rev 2

UM1525

Hardware and layout


The STM32F0DISCOVERY is designed around the STM32F051R8T6 microcontroller in a
64-pin LQFP package.
Figure 2 illustrates the connections between the STM32F051R8T6 and its peripherals (STLINK/V2, push button, LEDs and connectors).
Figure 3 and Figure 4 help you to locate these features on the STM32F0DISCOVERY.
Hardware block diagram

-INI
53"

%MBEDDED
34 ,).+6
37$

34-&24
)/

)/

)/

2%3%4

,%$
,$ 0#

"
234

,%$
,$ 0#

"
53%2

(EADER

Figure 2.

(EADER

Hardware and layout

-36

Doc ID 022910 Rev 2

9/41

Hardware and layout


Figure 3.

UM1525

Top layout

(red/green LED) LD2


COM

LD1 (red LED)


PWR

ST-LINK/V2

5V power supply
input output

3V power supply
input output
CN3
SWD connector

CN2
ST-LINK/DISCOVERY
selector

JP2
IDD measurement
SB1 (VBAT)

SB3 (B1-USER)
B2 reset button

STM32F051R8T6

SB4 (B2-RESET)
B1 user button
(green LED) LD3
LD4 (blue LED)

MS30024V1

Note:

10/41

Pin 1 of CN2, CN3, P1 and P2 connectors are identified by a square.

Doc ID 022910 Rev 2

UM1525
Figure 4.

Hardware and layout


Bottom layout

SB5, SB7, SB9, SB11


(RESERVED)

SB6, SB8, SB10, SB12


(DEFAULT)
SB13 (STM_RST)

SB14, SB15 (RX, TX)


SB16, SB17 (X2 crystal)
SB18 (MCO)
SB19 (NRST)
SB20, SB21 (X3 crystal)

SB22 (T_SWO)

MS30025V1

Doc ID 022910 Rev 2

11/41

Hardware and layout

4.1

UM1525

STM32F051R8T6 microcontroller
This 32-bit low- and medium-density advanced ARM MCU with a high-performance ARM
Cortex-M0 32-bit RISC core has 64 Kbytes Flash, 8 Kbytes RAM, RTC, timers, ADC,
DAC, comparators and communication interfaces.
Figure 5.

STM32F051R8T6 package

34-&24
+BYTE OF &LASH MEMORY
+BYTES OF 2!-

,1&0 X MM

-36

The STM32 F0 delivers 32-bit performance and STM32 DNA essentials into applications
typically addressed by 8- or 16-bit microcontrollers. It benefits from the combination of realtime performance, low-power operation, advanced architecture and peripherals associated
to the STM32 ecosystem, which has made the STM32 a reference in the market. Now all
this is accessible for cost-sensitive applications. The STM32 F0 offers unparalleled flexibility
and scalability for home entertainment products, appliances, and industrial equipment.
This device provides the following benefits.

Superior code execution for better performance and excellent code efficiency for
reduced embedded memory usage

High-performance connectivity and advanced analog peripherals to support a wide


range of applications

Flexible clock options and low power modes with fast wake-up for low power
consumption

It has the following key features:

Core and operating conditions

ARM Cortex-M0 0.9 DMIPS/MHz up to 48 MHz

1.8/2.0 to 3.6 V supply range

High-performance connectivity

12/41

6 Mbit/s USART

18 Mbit/s SPI with 4- to 16-bit data frame

1 Mbit/s IC fast-mode plus

HDMI CEC

Enhanced control

1x 16-bit 3-phase PWM motor control timer

5x 16-bit PWM timers

1x 16-bit basic timer

1x 32-bit PWM timer

12 MHz I/O toggling

Doc ID 022910 Rev 2

UM1525

3ERIAL 7IRE
$EBUG

6$$

FLASH OBL
)NTERFACE

37#,+
37$!4
AS !&

STM32F051R8T6 block diagram

.6)#

'0 $-!
CHANNELS

"US-ATRIX

.6)#

32!-

#/24%8 - #05
F(#,+ -(Z

CONTROLLER

Figure 6.

Hardware and layout

0/7%2
6/,4 2%'
6 4 / 6

&,!3(
+"
BITS

6$$ TO 6
633

6$$
0/2
2ESET

32! +"

6$$!

)NT

3500,9
350%26)3)/.
0/2 0$2

$$

06$

2# (3 -(Z
2# (3 -(Z

.234
6$$!

6$$!

6$$

2# ,3

84!, /3#
-(Z

0,,

/3#). 0&
/3#/54 0&

)77$'

0!;=

'0)/ PORT !

0";=

'0)/ PORT "

0#;=

'0)/ PORT #

0$

'0)/ PORT $

0&;=

'0)/ PORT &

GROUPS OF
CHANNELS

!(" DECODER

2%3%4
#,/#+
#/.42/,

!("0#,+
!0"0#,+
!$##,+
#%##,+
53!24#,+
(#,+
&#,+

#2#

#ONTROLLER

-/3)3$
-)3/-#+
3#+#+
.3373 AS !&
-/3) -)3/
3#+ .33
AS !&

84!, K(Z
"ACKUP
REG

%84)4
7+50

77$'

4!-0%2 24#
!,!2- /54

24# INTERFACE