STM32 F042 X 4
STM32 F042 X 4
Features
Core: ARM 32-bit Cortex-M0 CPU,
frequency up to 48 MHz LQFP48 7x7 mm UFQFPN48 7x7 mm WLCSP36 TSSOP20
LQFP32 7x7 mm UFQFPN32 5x5 mm 2.6x2.7 mm 6.5x4.4 mm
Memories UFQFPN28 4x4 mm
16 to 32 Kbytes of Flash memory
Nine timers
6 Kbytes of SRAM with HW parity
One 16-bit advanced-control timer for six
CRC calculation unit channel PWM output
Reset and power management One 32-bit and four 16-bit timers, with up to
Digital and I/Os supply: VDD = 2 V to 3.6 V four IC/OC, OCN, usable for IR control
Analog supply: VDDA = from VDD to 3.6 V decoding
Selected I/Os: VDDIO2 = 1.65 V to 3.6 V Independent and system watchdog timers
Power-on/Power down reset (POR/PDR) SysTick timer
Programmable voltage detector (PVD) Communication interfaces
Low power modes: Sleep, Stop, Standby One I2C interface supporting Fast Mode
VBAT supply for RTC and backup registers Plus (1 Mbit/s) with 20 mA current sink,
SMBus/PMBus and wakeup
Clock management
Two USARTs supporting master
4 to 32 MHz crystal oscillator synchronous SPI and modem control, one
32 kHz oscillator for RTC with calibration with ISO7816 interface, LIN, IrDA, auto
Internal 8 MHz RC with x6 PLL option baud rate detection and wakeup feature
Internal 40 kHz RC oscillator Two SPIs (18 Mbit/s) with 4 to 16
Internal 48 MHz oscillator with automatic programmable bit frames, one with I2S
trimming based on ext. synchronization interface multiplexed
Up to 38 fast I/Os CAN interface
All mappable on external interrupt vectors USB 2.0 full-speed interface, able to run
from internal 48 MHz oscillator and with
Up to 24 I/Os with 5 V tolerant capability
BCD and LPM support
and 8 with independent supply VDDIO2
HDMI CEC, wakeup on header reception
5-channel DMA controller
Serial wire debug (SWD)
One 12-bit, 1.0 s ADC (up to 10 channels)
Conversion range: 0 to 3.6 V 96-bit unique ID
Separate analog supply: 2.4 V to 3.6 V All packages ECOPACK2
Up to 14 capacitive sensing channels for Table 1. Device summary
touchkey, linear and rotary touch sensors Reference Part number
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3 Functional overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.1 ARM-Cortex-M0 core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.2 Memories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3 Boot modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.4 Cyclic redundancy check calculation unit (CRC) . . . . . . . . . . . . . . . . . . . 14
3.5 Power management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.5.1 Power supply schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.5.2 Power supply supervisors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.5.3 Voltage regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.5.4 Low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.6 Clocks and startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.7 General-purpose inputs/outputs (GPIOs) . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.8 Direct memory access controller (DMA) . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.9 Interrupts and events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.9.1 Nested vectored interrupt controller (NVIC) . . . . . . . . . . . . . . . . . . . . . . 18
3.9.2 Extended interrupt/event controller (EXTI) . . . . . . . . . . . . . . . . . . . . . . 18
3.10 Analog-to-digital converter (ADC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.10.1 Temperature sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.10.2 Internal voltage reference (VREFINT) . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.10.3 VBAT battery voltage monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.11 Touch sensing controller (TSC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.12 Timers and watchdogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.12.1 Advanced-control timer (TIM1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.12.2 General-purpose timers (TIM2, 3, 14, 16, 17) . . . . . . . . . . . . . . . . . . . . 22
3.12.3 Independent watchdog (IWDG) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.12.4 System window watchdog (WWDG) . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.12.5 SysTick timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.13 Real-time clock (RTC) and backup registers . . . . . . . . . . . . . . . . . . . . . . 23
3.14 Inter-integrated circuit interface (I2C) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5 Memory mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
6 Electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.1 Parameter conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.1.1 Minimum and maximum values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.1.2 Typical values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.1.3 Typical curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.1.4 Loading capacitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.1.5 Pin input voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.1.6 Power supply scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6.1.7 Current consumption measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
6.2 Absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
6.3 Operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
6.3.1 General operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
6.3.2 Operating conditions at power-up / power-down . . . . . . . . . . . . . . . . . . 48
6.3.3 Embedded reset and power control block characteristics . . . . . . . . . . . 49
6.3.4 Embedded reference voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.3.5 Supply current characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.3.6 Wakeup time from low-power mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
6.3.7 External clock source characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
6.3.8 Internal clock source characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
6.3.9 PLL characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.3.10 Memory characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.3.11 EMC characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
6.3.12 Electrical sensitivity characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
7 Package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
7.1 LQFP48 package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
7.2 UFQFPN48 package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
7.3 WLCSP36 package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
7.4 LQFP32 package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
7.5 UFQFPN32 package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
7.6 UFQFPN28 package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
7.7 TSSOP20 package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
7.8 Thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .112
7.8.1 Reference document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
7.8.2 Selecting the product temperature range . . . . . . . . . . . . . . . . . . . . . . 112
List of tables
List of figures
1 Introduction
This datasheet provides the ordering information and mechanical device characteristics of
the STM32F042x4/x6 microcontrollers.
This document should be read in conjunction with the STM32F0xxxx reference manual
(RM0091). The reference manual is available from the STMicroelectronics website
www.st.com.
For information on the ARM Cortex-M0 core, please refer to the Cortex-M0 Technical
Reference Manual, available from the www.arm.com website.
2 Description
Comm. USART 2
interfaces CAN 1
USB 1
CEC 1
12-bit ADC 1 1
(number of channels) (9 ext. + 3 int.) (10 ext. + 3 int.)
26
GPIOs 16 24 30 38
28
Capacitive sensing 13
7 11 14 14
channels 14
Max. CPU frequency 48 MHz
Operating voltage 2.0 to 3.6 V
Ambient operating temperature: -40C to 85C / -40C to 105C
Operating temperature
Junction temperature: -40C to 105C / -40C to 125C
LQFP32 LQFP48
Packages TSSOP20 UQFPN28 WLCSP36
UQFPN32 UFQFPN48
1. The SPI interfaces can be used either in SPI mode or in I2S audio mode.
32:(5
6:&/. 6HULDO:LUH
6:',2 'HEXJ 92/75(* 9'' WR9
DV$) 9'' 9WR9 966
2EO
PHPRU\
LQWHUIDFH
)ODVK*3/
)ODVK
8SWR.%
#9''
&257(;0&38 ELW
I0$; 0+] 6833/<
9'',22.,1
683(59,6,21
325 1567
65$0
%XVPDWUL[
FRQWUROOHU
65$0
.% 5HVHW 9''$
,QW 3253'5 966$
19,& #9''$
9''
+6, 39'
5&0+]
+6,
5&0+] #9''$
3//&/. #9''
3//
/6,
*3'0$ 5&N+] ;7$/26& 26&B,1
FKDQQHOV +6, 0+] 26&B287
5&0+]
,QG:LQGRZ:'*
57&LQWHUIDFH
3)>@ *3,2SRUW) &56
6<1&
&5& FKDQQHOV
3$' 3:07,0(5 FRPSOFKDQQHOV
JURXSVRI 7RXFK
$QDORJ %5.(75LQSXWDV$)
FKDQQHOV 6HQVLQJ
VZLWFKHV
&RQWUROOHU $+% 7,0(5ELW FK(75DV$)
6<1&
$3%
7,0(5 FK(75DV$)
$) (;7,7:.83
7,0(5 FKDQQHODV$)
86%
'' 86%
3+<
#9'',2 FKDQQHO
65$0% 7,0(5
FRPSO%5.DV$)
65$0% :LQGRZ:'* FKDQQHO
7,0(5
FRPSO%5.DV$)
[
$'LQSXW ELW$'& ,)
9''$
966$
#9''$
3 Functional overview
3.2 Memories
The device has the following features:
6 Kbytes of embedded SRAM accessed (read/write) at CPU clock speed with 0 wait
states and featuring embedded parity checking with exception generation for fail-critical
applications.
The non-volatile memory is divided into two arrays:
16 to 32 Kbytes of embedded Flash memory for programs and data
Option bytes
The option bytes are used to write-protect the memory (with 4 KB granularity) and/or
readout-protect the whole memory with the following options:
Level 0: no readout protection
Level 1: memory readout protection, the Flash memory cannot be read from or
written to if either debug features are connected or boot in RAM is selected
Level 2: chip readout protection, debug features (Cortex -M0 serial wire) and
boot in RAM selection disabled
threshold. The interrupt service routine can then generate a warning message and/or put
the MCU into a safe state. The PVD is enabled by software.
$+%FRUHPHPRU\'0$
+&/. &RUWH[)&/.IUHHUXQFORFN
35(',9 6: 6<6&/.
&RUWH[
3//65& 3//08/ +6,
V\VWHPWLPHU
+6,
3// 3&/. $3%
3//&/. SHULSKHUDOV
[[
+6(
[
+35( 335(
&66 335(
[[ 7,0
26&B287 +6(
0+]
+6(26& 86$576:
26&B,1 3&/.
/6( 6<6&/.
86$57
+6,
/6(
26&B,1 57&&/.
N+] /6( 57&
/6(26& 86%6:
26&B287
+6,
57&6(/ 86%
3//&/.
N+] /6, ,:'*
/6,5&
3//12',9
0+]5& +6, $'&
3//&/. +6, DV\QFKURQRXV
0&235( FORFNLQSXW
0DLQFORFN +6,
RXWSXW +6,
+6,
0&2 +6( /HJHQG
6<6&/. FORFNWUHHHOHPHQW
/6, EODFN
/6( ZKLWH FORFNWUHHFRQWUROHOHPHQW
WR7,0
0&2 FORFNOLQH
FRQWUROOLQH
06Y9
The I/O configuration can be locked if needed following a specific sequence in order to
avoid spurious writing to the I/Os registers.
sensor, voltage reference, VBAT voltage measurement) channels and performs conversions
in single-shot or scan modes. In scan mode, automatic conversion is performed on a
selected group of analog inputs.
The ADC can be served by the DMA controller.
An analog watchdog feature allows very precise monitoring of the converted voltage of one,
some or all selected channels. An interrupt is generated when the converted voltage is
outside the programmed thresholds.
G1 3 3 3 3 3
G2 3 3 3 3 3
1
G3 2 2 1 0
2
G4 3 3 3 1 1
G5 3 3 3 3 0
Number of capacitive 13
14 14 11 7
sensing channels 14
can also be seen as a complete general-purpose timer. The four independent channels can
be used for:
input capture
output compare
PWM generation (edge or center-aligned modes)
one-pulse mode output
If configured as a standard 16-bit timer, it has the same features as the TIMx timer. If
configured as the 16-bit PWM generator, it has full modulation capability (0-100%).
The counter can be frozen in debug mode.
Many features are shared with those of the standard timers which have the same
architecture. The advanced control timer can therefore work together with the other timers
via the Timer Link feature for synchronization or event chaining.
TIM2, TIM3
STM32F042x4/x6 devices feature two synchronizable 4-channel general-purpose timers.
TIM2 is based on a 32-bit auto-reload up/downcounter and a 16-bit prescaler. TIM3 is based
on a 16-bit auto-reload up/downcounter and a 16-bit prescaler. They feature 4 independent
channels each for input capture/output compare, PWM or one-pulse mode output. This
gives up to 12 input captures/output compares/PWMs on the largest packages.
The TIM2 and TIM3 general-purpose timers can work together or with the TIM1 advanced-
control timer via the Timer Link feature for synchronization or event chaining.
TIM2 and TIM3 both have independent DMA request generation.
These timers are capable of handling quadrature (incremental) encoder signals and the
digital outputs from 1 to 3 hall-effect sensors.
Their counters can be frozen in debug mode.
TIM14
This timer is based on a 16-bit auto-reload upcounter and a 16-bit prescaler.
TIM14 features one single channel for input capture/output compare, PWM or one-pulse
mode output.
Its counter can be frozen in debug mode.
TIM16 and TIM17 have a complementary output with dead-time generation and
independent DMA request generation.
Their counters can be frozen in debug mode.
The RTC is an independent BCD timer/counter. Its main features are the following:
calendar with subseconds, seconds, minutes, hours (12 or 24 format), week day, date,
month, year, in BCD (binary-coded decimal) format
automatic correction for 28, 29 (leap year), 30, and 31 day of the month
programmable alarm with wake up from Stop and Standby mode capability
on-the-fly correction from 1 to 32767 RTC clock pulses. This can be used to
synchronize the RTC with a master clock
digital calibration circuit with 1 ppm resolution, to compensate for quartz crystal
inaccuracy
two anti-tamper detection pins with programmable filter. The MCU can be woken up
from Stop and Standby modes on tamper event detection
timestamp feature which can be used to save the calendar content. This function can
be triggered by an event on the timestamp pin, or by a tamper event. The MCU can be
woken up from Stop and Standby modes on timestamp event detection
reference clock detection: a more precise second source clock (50 or 60 Hz) can be
used to enhance the calendar precision
The RTC clock sources can be:
a 32.768 kHz external crystal
a resonator or oscillator
the internal low-power RC oscillator (typical frequency of 40 kHz)
the high-speed external clock divided by 32
In addition, I2C1 provides hardware support for SMBUS 2.0 and PMBUS 1.1: ARP
capability, Host notify protocol, hardware CRC (PEC) generation/verification, timeouts
verifications and ALERT protocol management. I2C1 also has a clock domain independent
from the CPU clock, allowing the I2C1 to wake up the MCU from Stop mode on address
match.
The I2C peripheral can be served by the DMA controller.
Modbus communication X -
Auto baud rate detection X -
Driver Enable X X
1. X = supported.
added support for USB 2.0 Link Power Management. It has software-configurable endpoint
setting with packet memory up-to 1 KB (the last 256 byte are used for CAN peripheral if
enabled) and suspend/resume support. It requires a precise 48 MHz clock which can be
generated from the internal main PLL (the clock source must use an HSE crystal oscillator)
or by the internal 48 MHz oscillator in automatic trimming mode. The synchronization for this
oscillator can be taken from the USB data stream itself (SOF signalization) which allows
crystal-less operation.
3)%227
7RSYLHZ
3$
3$
9''
966
3%
3%
3%
3%
3%
3%
3%
9%$7 9'',2
3& 966
3&26&B,1 3$
3&26&B287 3$
3)26&B,1 3$
3)26&B287 3$
1567
/4)3 3$
966$ 3$
9''$ 3%
3$ 3%
3$ 3%
3$ 3%
3%
3%
3%
3%
966
9''
3$
3$
3$
3$
3$
3%
,2VXSSOLHGIURP9'',2
06Y9
7RSYLHZ
3$
3$
9''
966
3%
3%
3%
3%
3%
3%
3%
9%$7 9'',2
3& 966
3&26&B,1 3$
3&26&B287 3$
3)26&B,1 3$
3)26&B287 3$
1567
8)4)31 3$
966$ 3$
9''$ 3%
3$ 3%
([SRVHGSDG
3$ 3%
3$ 3%
3%
3%
3%
3%
966
9''
3$
3$
3$
3$
3$
3%
,2VXSSOLHGIURP9'',2
06Y9
7RSYLHZ
,2VXSSOLHGIURP9'',2
:/&63
06Y9
1. The above figure shows the package in top view, changing from bottom view in the previous document
versions.
3$
966
3%
3%
3%
3%
3%
7RSYLHZ
9'' 3$
3)26&B,1 3$
3)26&B287 3$
1567 3$
9''$
/4)3 3$
3$ 3$
3$ 3$
3$ 9'',2
3%
3%
966
3$
3$
3$
3$
3$
,2VXSSOLHGIURP9'',2 06Y9
3)%227
7RSYLHZ
3$
3%
3%
3%
3%
3%
3%
9'' 3$
3)26&B,1 3$
3)26&B287 3$
1567 3$
9''$ 8)4)31 3$
3$ 3$
3$ ([SRVHGSDG 3$
3$ 9'',2
966
3%
3%
3%
3$
3$
3$
3$
3$
,2VXSSOLHGIURP9'',2
06Y9
7RSYLHZ
3$
3$
3%
3%
3%
3%
3%
3%%227 3$
3)26&B,1 3$>3$@
3)26&B287 3$>3$@
1567 8)4)31 9'',2
9''$ 9''
3$ 966
3$ 3%
3%
3$
3$
3$
3$
3$
3$
,2VXSSOLHGIURP9'',2
06Y9
1. Pin pair PA11/12 can be remapped in place of pin pair PA9/10 using the SYSCFG_CFGR1 register.
7RSYLHZ
76623
3%%227 3$
3)26&B,1 3$
3)26&B287 3$>3$@
1567 3$>3$@
9''$ 9''
3$ 966
3$ 3%
3$ 3$
3$ 3$
3$ 3$
06Y9
1. Pin pair PA11/12 can be remapped in place of pin pair PA9/10 using the SYSCFG_CFGR1 register.
Unless otherwise specified in brackets below the pin name, the pin function during and
Pin name
after reset is the same as the actual pin name
S Supply pin
Pin type I/O Input / output pin
FT 5 V-tolerant I/O
FTf 5 V-tolerant I/O, FM+ capable
TTa 3.3 V-tolerant I/O directly connected to ADC
I/O structure TC Standard 3.3 V I/O
RST Bidirectional reset pin with embedded weak pull-up resistor
Unless otherwise specified by a note, all I/Os are set as floating inputs during and after
Notes
reset.
Alternate
Functions selected through GPIOx_AFR registers
Pin functions
functions Additional
Functions directly selected/enabled through peripheral registers
functions
I/O structure
Pin name
UFQFPN32
UFQFPN28
TSSPOP20
Notes
Pin
WLCSP36
LQFP32
(function upon
type Additional
reset) Alternate function
functions
I/O structure
Pin name
UFQFPN32
UFQFPN28
TSSPOP20
Notes
Pin
WLCSP36
LQFP32
(function upon
type Additional
reset) Alternate function
functions
SPI1_NSS, I2S1_WS,
TIM14_CH1,
14 C3 10 10 10 10 PA4 I/O TTa - TSC_G2_IO1, ADC_IN4
USART2_CK
USB_NOE
SPI1_SCK, I2S1_CK,
CEC,
15 D3 11 11 11 11 PA5 I/O TTa - ADC_IN5
TIM2_CH1_ETR,
TSC_G2_IO2
SPI1_MISO, I2S1_MCK,
TIM3_CH1, TIM1_BKIN,
16 E3 12 12 12 12 PA6 I/O TTa - TIM16_CH1, ADC_IN6
TSC_G2_IO3,
EVENTOUT
SPI1_MOSI, I2S1_SD,
TIM3_CH2, TIM14_CH1,
TIM1_CH1N,
17 F4 13 13 13 13 PA7 I/O TTa - ADC_IN7
TIM17_CH1,
TSC_G2_IO4,
EVENTOUT
TIM3_CH3,
TIM1_CH2N,
18 F3 14 14 14 - PB0 I/O TTa - ADC_IN8
TSC_G3_IO2,
EVENTOUT
TIM3_CH4, TIM14_CH1,
19 F2 15 15 15 14 PB1 I/O TTa - TIM1_CH3N, ADC_IN9
TSC_G3_IO3
20 D2 - 16 - - PB2 I/O FT - TSC_G3_IO4 -
SPI2_SCK, CEC,
21 - - - - - PB10 I/O FTf - TSC_SYNC, TIM2_CH3, -
I2C1_SCL
TIM2_CH4,
22 - - - - - PB11 I/O FTf - EVENTOUT, -
I2C1_SDA
23 F1 16 0 16 15 VSS S - - Ground
24 - - - 17 16 VDD S - - Digital power supply
TIM1_BKIN, SPI2_NSS,
25 - - - - - PB12 I/O FT - -
EVENTOUT
I/O structure
Pin name
UFQFPN32
UFQFPN28
TSSPOP20
Notes
Pin
WLCSP36
LQFP32
(function upon
type Additional
reset) Alternate function
functions
SPI2_SCK,
26 - - - - - PB13 I/O FTf - TIM1_CH1N, -
I2C1_SCL
SPI2_MISO,
27 - - - - - PB14 I/O FTf - TIM1_CH2N, -
I2C1_SDA
SPI2_MOSI, WKUP7,
28 - - - - - PB15 I/O FT -
TIM1_CH3N RTC_REFIN
USART1_CK,
(4) TIM1_CH1,
29 E2 18 18 - - PA8 I/O FT -
EVENTOUT, MCO,
CRS_SYNC
USART1_TX,
(4) TIM1_CH2,
30 D1 19 19 19 17 PA9 I/O FTf -
TSC_G4_IO1,
I2C1_SCL
USART1_RX,
TIM1_CH3,
(4)
31 C1 20 20 20 18 PA10 I/O FTf TIM17_BKIN, -
TSC_G4_IO2,
I2C1_SDA
CAN_RX,
USART1_CTS,
TIM1_CH4,
32 C2 21 21 19(5) 17(5) PA11 I/O FTf (4)
USB_DM
TSC_G4_IO3,
EVENTOUT,
I2C1_SCL
CAN_TX,USART1_RTS,
TIM1_ETR,
33 A1 22 22 20(5) 18(5) PA12 I/O FTf (4)
TSC_G4_IO4, USB_DP
EVENTOUT,
I2C1_SDA
(4) IR_OUT, SWDIO
34 B1 23 23 21 19 PA13 I/O FT (6) -
USB_NOE
35 - - - - - VSS S - - Ground
36 E1 17 17 18 16 VDDIO2 S - - Digital power supply
(4)
37 B2 24 24 22 20 PA14 I/O FT (6) USART2_TX, SWCLK -
I/O structure
Pin name
UFQFPN32
UFQFPN28
TSSPOP20
Notes
Pin
WLCSP36
LQFP32
(function upon
type Additional
reset) Alternate function
functions
SPI1_NSS, I2S1_WS,
USART2_RX,
(4)
38 A2 25 25 23 - PA15 I/O FT TIM2_CH1_ETR, -
EVENTOUT,
USB_NOE
SPI1_SCK, I2S1_CK,
TIM2_CH2,
39 B3 26 26 24 - PB3 I/O FT - -
TSC_G5_IO1,
EVENTOUT
SPI1_MISO, I2S1_MCK,
TIM17_BKIN,
40 A3 27 27 25 - PB4 I/O FT - TIM3_CH1, -
TSC_G5_IO2,
EVENTOUT
SPI1_MOSI, I2S1_SD,
I2C1_SMBA,
41 E6 28 28 26 - PB5 I/O FT - WKUP6
TIM16_BKIN,
TIM3_CH2
I2C1_SCL,
USART1_TX,
42 C4 29 29 27 - PB6 I/O FTf - -
TIM16_CH1N,
TSC_G5_I03
I2C1_SDA,
USART1_RX,
43 A4 30 30 28 - PB7 I/O FTf - -
TIM17_CH1N,
TSC_G5_IO4
Boot memory
44 - - 31 - - PF11-BOOT0 I/O FT - -
selection
I2C1_SCL, CEC,
TIM16_CH1, Boot memory
- B4 31 - 1 1 PB8-BOOT0 I/O FTf -
TSC_SYNC, selection
CAN_RX
I2C1_SCL, CEC,
TIM16_CH1,
45 - - 32 - - PB8 I/O FTf - -
TSC_SYNC,
CAN_RX
I/O structure
Pin name
UFQFPN32
UFQFPN28
TSSPOP20
Notes
Pin
WLCSP36
LQFP32
(function upon
type Additional
reset) Alternate function
functions
SPI2_NSS,
I2C1_SDA, IR_OUT,
46 - - - - - PB9 I/O FTf - TIM17_CH1, -
EVENTOUT,
CAN_TX
47 - 32 0 - - VSS S - - Ground
48 A5 1 1 - - VDD S - - Digital power supply
1. PC13, PC14 and PC15 are supplied through the power switch. Since the switch only sinks a limited amount of current
(3 mA), the use of GPIOs PC13 to PC15 in output mode is limited:
- The speed should not exceed 2 MHz with a maximum load of 30 pF.
- These GPIOs must not be used as current sources (e.g. to drive an LED).
2. After the first RTC domain power-up, PC13, PC14 and PC15 operate as GPIOs. Their function then depends on the
content of the RTC registers which are not reset by the system reset. For details on how to manage these GPIOs, refer to
the RTC domain and RTC register descriptions in the reference manual.
3. Distinct VSSA pin is only available on 48-pin packages. On all other packages, the pin number corresponds to the VSS
pin to which VSSA pad of the silicon die is connected.
4. PA8, PA9, PA10, PA11, PA12, PA13, PA14 and PA15 I/Os are supplied by VDDIO2.
5. Pin pair PA11/12 can be remapped in place of pin pair PA9/10 using SYSCFG_CFGR1 register.
6. After reset, these pins are configured as SWDIO and SWCLK alternate functions, and the internal pull-up on the SWDIO
pin and the internal pull-down on the SWCLK pin are activated.
STM32F042x4 STM32F042x6
Table 15. Alternate functions selected through GPIOB_AFR registers for port B
STM32F042x4 STM32F042x6
Pin name AF0 AF1 AF2 AF3 AF4 AF5
5 Memory mapping
To the difference of STM32F042x6 memory map in Figure 10, the two bottom code memory
spaces of STM32F042x4 end at 0x0000 3FFF and 0x0800 3FFF, respectively.
[))))))))
[))
5HVHUYHG
$+%
[
[(
&RUWH[0LQWHUQDO
[( SHULSKHUDOV
5HVHUYHG
5HVHUYHG
[&
[))
$+%
5HVHUYHG
[
5HVHUYHG
[$
[
5HVHUYHG
6\VWHPPHPRU\
[
5HVHUYHG
[)))&
$3%
[
[
5HVHUYHG
5HVHUYHG
[ 3HULSKHUDOV
[
5HVHUYHG
)ODVKPHPRU\
[ 65$0
[
5HVHUYHG
&2'(
[
)ODVKV\VWHP
PHPRU\RU65$0
[
GHSHQGLQJRQ%227
FRQILJXUDWLRQ
[
06Y9
6 Electrical characteristics
Figure 11. Pin loading conditions Figure 12. Pin input voltage
0&8SLQ 0&8SLQ
& S) 9,1
069 069
9%$7
%DFNXSFLUFXLWU\
9 /6(57&
%DFNXSUHJLVWHUV
3RZHUVZLWFK
9'' 9&25(
[9''
5HJXODWRU
9'',2
287
/HYHOVKLIWHU
.HUQHOORJLF
[Q) ,2 &38'LJLWDO
*3,2V ORJLF
[) ,1 0HPRULHV
[966
9'',2
9'',2
9'',2
287
/HYHOVKLIWHU
Q)
) ,2
*3,2V ORJLF
,1
966
9''$
9''$
966$
06Y9
Caution: Each power supply pair (VDD/VSS, VDDA/VSSA etc.) must be decoupled with filtering ceramic
capacitors as shown above. These capacitors must be placed as close as possible to, or
below, the appropriate pins on the underside of the PCB to ensure the good functionality of
the device.
,
''B9%$7
9 %$7
, ''
9 ''
9 '',2
, ''$
9 ''$
069
IVDD Total current into sum of all VDD power lines (source)(1) 120
(1)
IVSS Total current out of sum of all VSS ground lines (sink) -120
(1)
IVDD(PIN) Maximum current into each VDD power pin (source) 100
IVSS(PIN) Maximum current out of each VSS ground pin (sink)(1) -100
Output current sunk by any I/O and control pin 25
IIO(PIN)
Output current source by any I/O and control pin -25
(2)
Total output current sunk by sum of all I/Os and control pins 80
IIO(PIN) Total output current sourced by sum of all I/Os and control pins(2) -80 mA
Total output current sourced by sum of all I/Os supplied by VDDIO2 -40
Injected current on FT and FTf pins -5/+0(4)
IINJ(PIN)(3) Injected current on TC and RST pin 5
Injected current on TTa pins(5) 5
IINJ(PIN) Total injected current (sum of all I/O and control pins)(6) 25
1. All main power (VDD, VDDA) and ground (VSS, VSSA) pins must always be connected to the external power supply, in the
permitted range.
2. This current consumption must be correctly distributed over all I/Os and control pins. The total output current must not be
sunk/sourced between two consecutive power supply pins referring to high pin count QFP packages.
3. A positive injection is induced by VIN > VDDIOx while a negative injection is induced by VIN < VSS. IINJ(PIN) must never be
exceeded. Refer to Table 18: Voltage characteristics for the maximum allowed input voltage values.
4. Positive injection is not possible on these I/Os and does not occur for input voltages lower than the specified maximum
value.
5. On these I/Os, a positive injection is induced by VIN > VDDA. Negative injection disturbs the analog performance of the
device. See note (2) below Table 56: ADC accuracy.
6. When several inputs are submitted to a current injection, the maximum IINJ(PIN) is the absolute sum of the positive and
negative injected currents (instantaneous values).
VREFINT Internal reference voltage 40 C < TA < +105 C 1.16 1.2 1.25 V
ADC_IN17 buffer startup
tSTART - - - 10(1) s
time
ADC sampling time when
tS_vrefint reading the internal - 4(1) - - s
reference voltage
Internal reference voltage
VREFINT spread over the VDDA = 3 V - - 10(1) mV
temperature range
Table 26. Typical and maximum current consumption from VDD supply at VDD = 3.6 V
All peripherals enabled(1) All peripherals disabled
Parameter
Symbol
HSI48 48 MHz 20.3 23.2 23.4 24.6 12.7 14.4 14.4 14.7
48 MHz 20.2 22.9 23.0 23.9 12.6 14.1 14.3 14.4
code executing from Flash memory
HSE bypass,
Supply current in Run mode,
HSE bypass, 8 MHz 3.9 5.2 5.3 5.6 2.6 3.1 3.2 3.3
IDD PLL off 1 MHz 0.9 1.3 1.5 1.8 0.7 1.0 1.1 1.3 mA
Table 26. Typical and maximum current consumption from VDD supply at VDD = 3.6 V (continued)
Parameter All peripherals enabled(1) All peripherals disabled
Symbol
HSI48 48 MHz 19.3 21.9 22.1 23.7 11.9 13.4 13.6 13.7
(3) 22.1(3) 13.3(3) 13.7(3)
48 MHz 19.2 21.8 22.0 11.7 13.5
HSE bypass,
Supply current in Run mode,
PLL on
24 MHz 10.3 12.6 13.0 13.4 6.2 8.0 8.2 8.3
HSE bypass, 8 MHz 3.6 4.1 4.3 4.4 2.0 2.1 2.1 2.5
PLL off 1 MHz 0.8 0.9 0.9 1.1 0.4 0.5 0.6 0.8
48 MHz 19.5 22.0 22.1 22.5 11.8 13.6 13.8 13.9
HSI clock,
32 MHz 13.5 16.3 16.4 16.6 8.0 8.8 9.1 9.9
PLL on
24 MHz 10.5 12.8 13.0 13.8 6.5 8.0 8.1 8.4
HSI clock,
8 MHz 3.7 4.7 5.0 5.3 2.1 2.3 2.4 3.0
PLL off
IDD mA
HSI48 48 MHz 12.4 15.1 16.3 16.7 3.0 3.2 3.3 3.4
48 MHz 12.3 15.0(3) 16.0 16.2(3) 2.9 3.2(3) 3.3 3.4(3)
HSE bypass,
Supply current in Sleep mode
HSE bypass, 8 MHz 2.3 3.0 3.1 3.2 0.7 0.8 0.8 0.9
PLL off 1 MHz 0.4 0.4 0.4 0.6 0.1 0.3 0.3 0.4
48 MHz 12.4 15.3 15.7 15.9 3.0 3.0 3.2 3.4
HSI clock,
32 MHz 8.6 10.7 11.3 11.6 2.1 2.2 2.2 2.5
PLL on
24 MHz 6.6 8.4 8.7 8.9 1.6 1.6 1.7 1.9
HSI clock,
8 MHz 2.4 3.2 3.4 3.6 0.6 0.8 0.9 1.0
PLL off
1. USB is kept disabled as this IP functions only with a 48 MHz clock.
2. Data based on characterization results, not tested in production unless otherwise specified.
3. Data based on characterization results and tested in production (using one common test limit for sum of IDD and IDDA).
Table 27. Typical and maximum current consumption from the VDDA supply
VDDA = 2.4 V VDDA = 3.6 V
Para- Conditions
Symbol (1) fHCLK Max @ TA(2) Max @ TA(2) Unit
meter
Typ Typ
25 C 85 C 105 C 25 C 85 C 105 C
HSI48 48 MHz 309 325 332 342 317 334 338 344
(3) (3) (3)
48 MHz 148 167 176 179 161 181 193 197(3)
HSE
Supply
bypass, 32 MHz 102 119 124 126 111 128 135 137
current in
PLL on
Run or 24 MHz 80 95 99 100 88 102 106 108
Sleep
HSE 8 MHz 2.7 3.7 4.2 4.5 3.5 4.7 5.2 5.5
mode,
bypass,
IDDA code 1 MHz 2.7 3.7 4.2 4.2 3.6 4.7 5.2 5.5 A
PLL off
executing
from 48 MHz 220 242 251 254 242 264 275 279
Flash HSI clock,
32 MHz 173 193 200 202 191 211 219 221
memory PLL on
or RAM 24 MHz 151 169 175 177 167 184 191 193
HSI clock,
8 MHz 72 82 85 85 82 92 95 95
PLL off
1. Current consumption from the VDDA supply is independent of whether the digital peripherals are enabled or disabled, being
in Run or Sleep mode or executing from Flash memory or RAM. Furthermore, when the PLL is off, IDDA is independent from
the frequency.
2. Data based on characterization results, not tested in production unless otherwise specified.
3. Data based on characterization results and tested in production (using one common test limit for sum of IDD and IDDA).
Table 28. Typical and maximum consumption in Stop and Standby modes
Typ @VDD (VDD = VDDA) Max(1)
Parameter
Symbol
Unit
Conditions
TA = TA = TA =
2.0 V 2.4 V 2.7 V 3.0 V 3.3 V 3.6 V
25C 85C 105C
Regulator in run
mode, all 14.3 14.5 14.6 14.7 14.8 14.9 21.0 47.0 64.0
Supply oscillators OFF
current in
Stop mode Regulator in low-
power mode, all 2.9 3.1 3.2 3.3 3.4 3.5 6.5 32.0 44.0
IDD oscillators OFF
current in Regulator in
Stop mode low-power
mode, all 2.0 2.1 2.2 2.4 2.5 2.7 3.5 3.5 4.5
oscillators
OFF A
current in Regulator in
Stop mode low-power
mode, all 1.3 1.3 1.3 1.4 1.4 1.5 - - -
oscillators
OFF
Table 29. Typical and maximum current consumption from the VBAT supply
Typ @ VBAT Max(1)
1.65 V
2.7 V
TA = TA = TA =
1.8 V
2.4 V
3.3 V
3.6 V
25 C 85 C 105 C
Table 30. Typical current consumption, code executing from Flash memory,
running from HSE 8 MHz crystal
Typical consumption in Typical consumption in
Run mode Sleep mode
Symbol Parameter fHCLK Unit
Peripherals Peripherals Peripherals Peripherals
enabled disabled enabled disabled
trigger circuits used to discriminate the input value. Unless this specific configuration is
required by the application, this supply current consumption can be avoided by configuring
these I/Os in analog mode. This is notably the case of ADC input pins which should be
configured as analog inputs.
Caution: Any floating input pin can also settle to an intermediate voltage level or switch inadvertently,
as a result of external electromagnetic noise. To avoid current consumption related to
floating pins, they must either be configured in analog mode, or forced internally to a definite
digital value. This can be done either by using pull-up/down resistors or by configuring the
pins in output mode.
I/O dynamic current consumption
In addition to the internal peripheral current consumption measured previously (see
Table 32: Peripheral current consumption), the I/Os used by an application also contribute
to the current consumption. When an I/O pin switches, it uses the current from the I/O
supply voltage to supply the I/O pin circuitry and to charge/discharge the capacitive load
(internal or external) connected to the pin:
I SW = V DDIOx f SW C
where
ISW is the current sunk by a switching I/O to charge/discharge the capacitive load
VDDIOx is the I/O supply voltage
fSW is the I/O switching frequency
C is the total capacitance seen by the I/O pin: C = CINT + CEXT + CS
CS is the PCB board capacitance including the pad pin.
The test pin is configured in push-pull output mode and is toggled by software at a fixed
frequency.
4 MHz 0.07
8 MHz 0.15
VDDIOx = 3.3 V
C =CINT 16 MHz 0.31
24 MHz 0.53
48 MHz 0.92
4 MHz 0.18
4 MHz 0.66
VDDIOx = 2.4 V
CEXT = 47 pF 8 MHz 1.43
C = CINT + CEXT+ CS 16 MHz 2.45
C = Cint
24 MHz 4.97
1. CS = 7 pF (estimated value).
BusMatrix(1) 2.2
CRC 1.9
DMA 5.1
Flash memory interface 15.0
GPIOA 8.2
AHB GPIOB 7.7 A/MHz
GPIOC 2.1
GPIOF 1.8
SRAM 1.1
TSC 4.9
All AHB peripherals 49.8
Regulator in run
3.2 3.1 2.9 2.9 2.8 5
Wakeup from Stop mode
tWUSTOP
mode Regulator in low
7.0 5.8 5.2 4.9 4.6 9
power mode
s
Wakeup from
tWUSTANDBY - 60.4 55.6 53.5 52 51 -
Standby mode
Wakeup from Sleep
tWUSLEEP - 4 SYSCLK cycles -
mode
WZ+6(+
9+6(+
9+6(/
WU+6( W
WI+6( WZ+6(/
7+6(
069
WZ/6(+
9/6(+
9/6(/
WU/6( W
WI/6( WZ/6(/
7/6(
069
For CL1 and CL2, it is recommended to use high-quality external ceramic capacitors in the
5 pF to 20 pF range (Typ.), designed for high-frequency applications, and selected to match
the requirements of the crystal or resonator (see Figure 17). CL1 and CL2 are usually the
same size. The crystal manufacturer typically specifies a load capacitance which is the
series combination of CL1 and CL2. PCB and MCU pin capacitance must be included (10 pF
can be used as a rough estimate of the combined pin and board capacitance) when sizing
CL1 and CL2.
Note: For information on selecting the crystal, refer to the application note AN2867 Oscillator
design guide for ST microcontrollers available from the ST website www.st.com.
5HVRQDWRUZLWKLQWHJUDWHG
FDSDFLWRUV
&/
26&B,1 I+6(
%LDV
0+] FRQWUROOHG
UHVRQDWRU 5) JDLQ
5(;7 26&B287
&/
069
LSEDRV[1:0]=00
- 0.5 0.9
lower driving capability
LSEDRV[1:0]= 01
- - 1
medium low driving capability
IDD LSE current consumption A
LSEDRV[1:0] = 10
- - 1.3
medium high driving capability
LSEDRV[1:0]=11
- - 1.6
higher driving capability
LSEDRV[1:0]=00
5 - -
lower driving capability
LSEDRV[1:0]= 01
8 - -
Oscillator medium low driving capability
gm A/V
transconductance LSEDRV[1:0] = 10
15 - -
medium high driving capability
LSEDRV[1:0]=11
25 - -
higher driving capability
tSU(LSE)(3) Startup time VDDIOx is stabilized - 2 - s
1. Refer to the note and caution paragraphs below the table, and to the application note AN2867 Oscillator design guide for
ST microcontrollers.
2. Guaranteed by design, not tested in production.
3. tSU(LSE) is the startup time measured from the moment it is enabled (by software) to a stabilized 32.768 kHz oscillation is
reached. This value is measured for a standard crystal and it can vary significantly with the crystal manufacturer
Note: For information on selecting the crystal, refer to the application note AN2867 Oscillator
design guide for ST microcontrollers available from the ST website www.st.com.
5HVRQDWRUZLWKLQWHJUDWHG
FDSDFLWRUV
&/
26&B,1 I/6(
N+] 'ULYH
UHVRQDWRU SURJUDPPDEOH
DPSOLILHU
26&B287
&/
069
Note: An external resistor is not required between OSC32_IN and OSC32_OUT and it is forbidden
to add one.
Figure 19. HSI oscillator accuracy characterization results for soldered parts
."9
.*/
5<$>
"
069
-!8
-).
4 ;#=
!
-36
TA = 25 C -2.8 - 2.9 %
tsu(HSI48) HSI48 oscillator startup time - - - 6(2) s
HSI48 oscillator power
IDDA(HSI48) - - 312 350(2) A
consumption
1. VDDA = 3.3 V, TA = 40 to 105 C unless otherwise specified.
2. Guaranteed by design, not tested in production.
3. Data based on characterization results, not tested in production.
-).
4 ;#=
!
-36
Software recommendations
The software flowchart must include the management of runaway conditions such as:
Corrupted program counter
Unexpected reset
Critical Data corruption (for example control registers)
Prequalification trials
Most of the common failures (unexpected reset and program counter corruption) can be
reproduced by manually forcing a low state on the NRST pin or the Oscillator pins for 1
second.
To complete these trials, ESD stress can be applied directly on the device, over the range of
specification values. When unexpected behavior is detected, the software can be hardened
to prevent unrecoverable errors occurring (see application note AN1015).
0.1 to 30 MHz -9
VDD = 3.6 V, TA = 25 C,
LQFP48 package 30 to 130 MHz 9 dBV
SEMI Peak level
compliant with 130 MHz to 1 GHz 17
IEC 61967-2
EMI Level 3 -
Static latch-up
Two complementary static tests are required on six parts to assess the latch-up
performance:
A supply overvoltage is applied to each power supply pin.
A current injection is applied to each input, output and configurable I/O pin.
These tests are compliant with EIA/JESD 78A IC latch-up standard.
Weak pull-down
RPD equivalent VIN = VDDIOx 25 40 55 k
resistor(3)
CIO I/O pin capacitance - - 5 - pF
1. Data based on design simulation only. Not tested in production.
2. The leakage could be higher than the maximum value, if negative current is injected on adjacent pins. Refer to Table 49:
I/O current injection susceptibility.
3. Pull-up and pull-down resistors are designed with a true resistance in series with a switchable PMOS/NMOS. This
PMOS/NMOS contribution to the series resistance is minimal (~10% order).
All I/Os are CMOS- and TTL-compliant (no software configuration required). Their
characteristics cover more than the strict CMOS-technology or TTL parameters. The
coverage of these requirements is shown in Figure 22 for standard I/Os, and in Figure 23 for
5 V tolerant I/Os. The following curves are design simulation results, not tested in
production.
7(67('5$1*(
77/VWDQGDUGUHTXLUHPHQW
HQW
HTX LUHP
QG DUGU
6VWD
9,19 &02
[
9 '',2
9 ,+PLQ
',2[
81'(),1(',13875$1*(
9'
9,+PLQ
9'',2[
9,/PD[ XLUHPHQW
77/VWDQGDUGUHTXLUHPHQW
& 0 2 6 V WDQGDUGUHT
9'',2[
9,/PD[
7(67('5$1*(
9'',2[9
06Y9
Figure 23. Five volt tolerant (FT and FTf) I/O input characteristics
7(67('5$1*(
77/VWDQGDUGUHTXLUHPHQW
HQW
HTX LUHP
QG DUGU
6VWD
9,19 &02
[
9 '',2
81'(),1(',13875$1*(
9 ,+PLQ
'',2[
9
9,+PLQ
'',2[
9
9,/PD[ 77/VWDQGDUGUHTXLUHPHQW
XLUHPHQW
WD QGDUGUHT
[
&026V
9'',2
9,/PD[
7(67('5$1*(
9'',2[9
06Y9
VOL Output low level voltage for an I/O pin CMOS port(2) - 0.4
|IIO| = 8 mA V
VOH Output high level voltage for an I/O pin VDDIOx 2.7 V VDDIOx0.4 -
VOL Output low level voltage for an I/O pin TTL port(2) - 0.4
|IIO| = 8 mA V
VOH Output high level voltage for an I/O pin VDDIOx 2.7 V 2.4 -
VOL(3) Output low level voltage for an I/O pin |IIO| = 20 mA - 1.3
V
VOH(3) Output high level voltage for an I/O pin VDDIOx 2.7 V VDDIOx1.3 -
VOL(3) Output low level voltage for an I/O pin |IIO| = 6 mA - 0.4
V
VOH(3) Output high level voltage for an I/O pin VDDIOx 2 V VDDIOx0.4 -
VOL(4) Output low level voltage for an I/O pin - 0.4 V
|IIO| = 4 mA
VOH(4) Output high level voltage for an I/O pin VDDIOx0.4 - V
|IIO| = 20 mA
- 0.4 V
VOLFm+(3)
Output low level voltage for an FTf I/O pin in VDDIOx 2.7 V
Fm+ mode
|IIO| = 10 mA - 0.4 V
1. The IIO current sourced or sunk by the device must always respect the absolute maximum rating specified in Table 18:
Voltage characteristics, and the sum of the currents sourced or sunk by all the I/Os (I/O ports and control pins) must always
respect the absolute maximum ratings IIO.
2. TTL and CMOS outputs are compatible with JEDEC standards JESD36 and JESD52.
3. Data based on characterization results. Not tested in production.
4. Data based on characterization results. Not tested in production.
Input/output AC characteristics
The definition and values of input/output AC characteristics are given in Figure 24 and
Table 52, respectively. Unless otherwise specified, the parameters given are derived from
tests performed under the ambient temperature and supply voltage conditions summarized
in Table 21: General operating conditions.
W U,2RXW W I,2RXW
069
([WHUQDO 9 ''
UHVHWFLUFXLW
5 38
1567 ,QWHUQDOUHVHW
)LOWHU
)
069
fADC = 14 MHz,
- - 823 kHz
fTRIG(2) External trigger frequency 12-bit resolution
12-bit resolution - - 17 1/fADC
VAIN Conversion voltage range - 0 - VDDA V
See Equation 1 and
RAIN(2) External input impedance - - 50 k
Table 55 for details
Sampling switch
RADC(2) - - - 1 k
resistance
Internal sample and hold
CADC(2) - - - 8 pF
capacitor
fADC = 14 MHz 5.9 s
tCAL(2)(3) Calibration time
- 83 1/fADC
1.5 ADC 1.5 ADC
ADC clock = HSI14 cycles + 2 - cycles + 3
fPCLK cycles fPCLK cycles
ADC_DR register ready
WLATENCY(2)(4) fPCLK
latency ADC clock = PCLK/2 - 4.5 -
cycle
fPCLK
ADC clock = PCLK/4 - 8.5 -
cycle
fADC = fPCLK/2 = 14 MHz 0.196 s
fADC = fPCLK/2 5.5 1/fPCLK
tlatr(2) Trigger conversion latency fADC = fPCLK/4 = 12 MHz 0.219 s
fADC = fPCLK/4 10.5 1/fPCLK
fADC = fHSI14 = 14 MHz 0.179 - 0.250 s
ADC jitter on trigger
JitterADC fADC = fHSI14 - 1 - 1/fHSI14
conversion
fADC = 14 MHz 0.107 - 17.1 s
tS(2) Sampling time
- 1.5 - 239.5 1/fADC
tSTAB(2) Stabilization time - 14 1/fADC
fADC = 14 MHz,
1 - 18 s
Total conversion time 12-bit resolution
tCONV(2)
(including sampling time) 14 to 252 (tS for sampling +12.5 for
12-bit resolution 1/fADC
successive approximation)
1. During conversion of the sampled value (12.5 x ADC clock period), an additional consumption of 100 A on IDDA and 60 A
on IDD should be taken into account.
2. Guaranteed by design, not tested in production.
3. Specified value includes only ADC timing. It does not include the latency of the register access.
4. This parameter specify latency for transfer of the conversion result to the ADC_DR register. EOC flag is set at this time.
The formula above (Equation 1) is used to determine the maximum external impedance
allowed for an error below 1/4 of LSB. Here N = 12 (from 12-bit resolution).
2. ADC Accuracy vs. Negative Injection Current: Injecting negative current on any of the standard (non-robust) analog input
pins should be avoided as this significantly reduces the accuracy of the conversion being performed on another analog
input. It is recommended to add a Schottky diode (pin to ground) to standard analog pins which may potentially inject
negative current.
Any positive injection current within the limits specified for IINJ(PIN) and IINJ(PIN) in Section 6.3.14 does not affect the ADC
accuracy.
3. Better performance may be achieved in restricted VDDA, frequency and temperature ranges.
4. Data based on characterization results, not tested in production.
966$
(* ([DPSOHRIDQDFWXDOWUDQVIHUFXUYH
7KHLGHDOWUDQVIHUFXUYH
(QGSRLQWFRUUHODWLRQOLQH
(7 7RWDO8QDMXVWHG(UURUPD[LPXPGHYLDWLRQ
EHWZHHQWKHDFWXDODQGLGHDOWUDQVIHUFXUYHV
(7 (2 2IIVHW(UURUPD[LPXPGHYLDWLRQ
EHWZHHQWKHILUVWDFWXDOWUDQVLWLRQDQGWKHILUVW
LGHDORQH
(* *DLQ(UURUGHYLDWLRQEHWZHHQWKHODVW
(2 (/
LGHDOWUDQVLWLRQDQGWKHODVWDFWXDORQH
(' 'LIIHUHQWLDO/LQHDULW\(UURUPD[LPXP
GHYLDWLRQEHWZHHQDFWXDOVWHSVDQGWKHLGHDORQHV
('
(/ ,QWHJUDO/LQHDULW\(UURUPD[LPXPGHYLDWLRQ
EHWZHHQDQ\DFWXDOWUDQVLWLRQDQGWKHHQGSRLQW
/6%,'($/
FRUUHODWLRQOLQH
9''$
069
9''$
6DPSOHDQGKROG$'&
97
FRQYHUWHU
069
1. Refer to Table 54: ADC characteristics for the values of RAIN, RADC and CADC.
2. Cparasitic represents the capacitance of the PCB (dependent on soldering and PCB layout quality) plus the
pad capacitance (roughly 7 pF). A high Cparasitic value will downgrade conversion accuracy. To remedy
this, fADC should be reduced.
- - 1 - tTIMxCLK
tres(TIM) Timer resolution time
fTIMxCLK = 48 MHz - 20.8 - ns
Timer external clock - - fTIMxCLK/2 - MHz
fEXT frequency on CH1 to
CH4 fTIMxCLK = 48 MHz - 24 - MHz
/4 0 0.1 409.6
/8 1 0.2 819.2
/16 2 0.4 1638.4
/32 3 0.8 3276.8 ms
/64 4 1.6 6553.6
/128 5 3.2 13107.2
/256 6 or 7 6.4 26214.4
1. These timings are given for a 40 kHz clock but the microcontroller internal RC frequency can vary from 30
to 60 kHz. Moreover, given an exact RC oscillator frequency, the exact timings still depend on the phasing
of the APB interface clock versus the LSI clock so that there is always a full RC period of uncertainty.
1 0 0.0853 5.4613
2 1 0.1706 10.9226
ms
4 2 0.3413 21.8453
8 3 0.6826 43.6906
SPI/I2S characteristics
Unless otherwise specified, the parameters given in Table 63 for SPI or in Table 64 for I2S
are derived from tests performed under the ambient temperature, fPCLKx frequency and
supply voltage conditions summarized in Table 21: General operating conditions.
Refer to Section 6.3.14: I/O port characteristics for more details on the input/output alternate
function characteristics (NSS, SCK, MOSI, MISO for SPI and WS, CK, SD for I2S).
166LQSXW
W68166 WF6&. WK166
&3+$
6&.,QSXW
&32/
WZ6&.+
&3+$ WZ6&./
&32/
W962 WK62 WU6&. WGLV62
WD62 WI6&.
WK6,
DLF
166LQSXW
&3+$
&32/ WZ6&.+
&3+$ WZ6&./
&32/
WU6&.
WY62 WK62 WGLV62
WD62 WI6&.
0,62
06%287 %,7287 /6%287
287387
WVX6, WK6,
026,
,1387 06%,1 %,7,1 /6%,1
DLE
1. Measurement points are done at CMOS levels: 0.3 VDD and 0.7 VDD.
+LJK
166LQSXW
WF6&.
6&.2XWSXW
&3+$
&32/
&3+$
&32/
6&.2XWSXW
&3+$
&32/
&3+$
&32/
WZ6&.+ WU6&.
WVX0, WZ6&./ WI6&.
0,62
,13 87 06%,1 %,7,1 /6%,1
WK0,
026,
06%287 % , 7287 /6%287
287387
WY02 WK02
DLF
1. Measurement points are done at CMOS levels: 0.3 VDD and 0.7 VDD.
WF&.
&32/
&.,QSXW
&32/
WZ&.+ WZ&./ WK:6
:6LQSXW
06Y9
1. Measurement points are done at CMOS levels: 0.3 VDDIOx and 0.7 VDDIOx.
2. LSB transmit/receive of the previously transmitted byte. No LSB transmit/receive is sent before the first
byte.
WI&. WU&.
WF&.
&.RXWSXW
&32/
WZ&.+
&32/
WY:6 WZ&./ WK:6
:6RXWSXW
WY6'B07 WK6'B07
06Y9
USB characteristics
The STM32F042x4/x6 USB interface is fully compliant with the USB specification version
2.0 and is USB-IF certified (for Full-speed device operation).
7 Package information
3%!4).'
0,!.%
#
!
!
!
C
MM
'!5'% 0,!.%
CCC #
$ +
!
,
$ ,
$
B
%
%
0).
)$%.4)&)#!4)/.
E "?-%?6
A - - 1.600 - - 0.0630
A1 0.050 - 0.150 0.0020 - 0.0059
A2 1.350 1.400 1.450 0.0531 0.0551 0.0571
b 0.170 0.220 0.270 0.0067 0.0087 0.0106
c 0.090 - 0.200 0.0035 - 0.0079
D 8.800 9.000 9.200 0.3465 0.3543 0.3622
D1 6.800 7.000 7.200 0.2677 0.2756 0.2835
D3 - 5.500 - - 0.2165 -
E 8.800 9.000 9.200 0.3465 0.3543 0.3622
E1 6.800 7.000 7.200 0.2677 0.2756 0.2835
E3 - 5.500 - - 0.2165 -
e - 0.500 - - 0.0197 -
L 0.450 0.600 0.750 0.0177 0.0236 0.0295
L1 - 1.000 - - 0.0394 -
k 0 3.5 7 0 3.5 7
ccc - - 0.080 - - 0.0031
1. Values in inches are converted from mm and rounded to 4 decimal digits.
AID
Device marking
The following figure gives an example of topside marking orientation versus pin 1 identifier
location.
3URGXFWLGHQWLILFDWLRQ 670)
&7
'DWHFRGH
< ::
5HYLVLRQFRGH
5
06Y9
1. Parts marked as "ES", "E" or accompanied by an Engineering Sample notification letter, are not yet
qualified and therefore not yet ready to be used in production and any consequences deriving from such
usage will not be at ST charge. In no event, ST will be liable for any customer usage of these engineering
samples in production. ST Quality has to be contacted prior to any decision to use these Engineering
Samples to run qualification activity.
$
( (
7 6HDWLQJ
SODQH
GGG $
H E
'HWDLO<
'
<
([SRVHGSDG
DUHD '
/
&[
SLQFRUQHU 5W\S
( 'HWDLO=
=
$%B0(B9
!"?&0?6
Device marking
The following figure gives an example of topside marking orientation versus pin 1 identifier
location.
3URGXFWLGHQWLILFDWLRQ 670)
&8
'DWHFRGH
< ::
5HYLVLRQFRGH
5
06Y9
1. Parts marked as "ES", "E" or accompanied by an Engineering Sample notification letter, are not yet
qualified and therefore not yet ready to be used in production and any consequences deriving from such
usage will not be at ST charge. In no event, ST will be liable for any customer usage of these engineering
samples in production. ST Quality has to be contacted prior to any decision to use these Engineering
Samples to run qualification activity.
$ *
'HWDLO$
H
H
)
$
$
$
%XPSVLGH 6LGHYLHZ
;
<
$
%XPS
$
RULHQWDWLRQ HHH = $
UHIHUHQFH
DDD = =
EEDOOV E
6HDWLQJSODQH
FFF = ; <
GGG =
:DIHUEDFNVLGH 'HWDLO$
URWDWHG
>Ds
F - 0.3025 - - 0.0119 -
G - 0.3515 - - 0.0138 -
aaa - - 0.100 - - 0.0039
bbb - - 0.100 - - 0.0039
ccc - - 0.100 - - 0.0039
ddd - - 0.050 - - 0.0020
eee - - 0.050 - - 0.0020
1. Values in inches are converted from mm and rounded to 4 decimal digits.
2. Back side coating.
3. Dimension is measured at the maximum bump diameter parallel to primary datum Z.
'SDG
'VP 069
Pitch 0.4 mm
260 m max. (circular)
Dpad
220 m recommended
Dsm 300 m min. (for 260 m diameter pad)
PCB pad design Non-solder mask defined via underbump allowed
Device marking
The following figure gives an example of topside marking orientation versus ball A1 identifier
location.
'RW
3URGXFWLGHQWLILFDWLRQ )7
5HYLVLRQFRGH
5
'DWHFRGH
< ::
06Y9
1. Parts marked as "ES", "E" or accompanied by an Engineering Sample notification letter, are not yet
qualified and therefore not yet ready to be used in production and any consequences deriving from such
usage will not be at ST charge. In no event, ST will be liable for any customer usage of these engineering
samples in production. ST Quality has to be contacted prior to any decision to use these Engineering
Samples to run qualification activity.
3%!4).'
0,!.%
# !
!
C
!
MM
'!5'% 0,!.%
CCC #
+
$
,
!
$
,
$
B
%
%
0).
)$%.4)&)#!4)/.
E 7@.&@7
A - - 1.600 - - 0.0630
A1 0.050 - 0.150 0.0020 - 0.0059
A2 1.350 1.400 1.450 0.0531 0.0551 0.0571
b 0.300 0.370 0.450 0.0118 0.0146 0.0177
c 0.090 - 0.200 0.0035 - 0.0079
D 8.800 9.000 9.200 0.3465 0.3543 0.3622
D1 6.800 7.000 7.200 0.2677 0.2756 0.2835
D3 - 5.600 - - 0.2205 -
E 8.800 9.000 9.200 0.3465 0.3543 0.3622
E1 6.800 7.000 7.200 0.2677 0.2756 0.2835
E3 - 5.600 - - 0.2205 -
e - 0.800 - - 0.0315 -
L 0.450 0.600 0.750 0.0177 0.0236 0.0295
L1 - 1.000 - - 0.0394 -
k 0 3.5 7 0 3.5 7
ccc - - 0.100 - - 0.0039
1. Values in inches are converted from mm and rounded to 4 decimal digits.
6?&0?6
Device marking
The following figure gives an example of topside marking orientation versus pin 1 identifier
location.
3URGXFWLGHQWLILFDWLRQ 670)
.7
'DWHFRGH
< ::
3LQLGHQWLILFDWLRQ
5HYLVLRQFRGH
5
06Y9
1. Parts marked as "ES", "E" or accompanied by an Engineering Sample notification letter, are not yet
qualified and therefore not yet ready to be used in production and any consequences deriving from such
usage will not be at ST charge. In no event, ST will be liable for any customer usage of these engineering
samples in production. ST Quality has to be contacted prior to any decision to use these Engineering
Samples to run qualification activity.
'
GGG &
H $
&
$
6($7,1*
3/$1(
'
E
( E
( (
/
' /
3,1,GHQWLILHU
!"?-%?6
$%B)3B9
Device marking
The following figure gives an example of topside marking orientation versus pin 1 identifier
location.
3URGXFWLGHQWLILFDWLRQ
).
'DWHFRGH
< :: 5HYLVLRQFRGH
5
'RWSLQ
06Y9
1. Parts marked as "ES", "E" or accompanied by an Engineering Sample notification letter, are not yet
qualified and therefore not yet ready to be used in production and any consequences deriving from such
usage will not be at ST charge. In no event, ST will be liable for any customer usage of these engineering
samples in production. ST Quality has to be contacted prior to any decision to use these Engineering
Samples to run qualification activity.
' 'HWDLO<
'
'
(
'HWDLO=
!"?-%?6
$%B)3B9
Device marking
The following figure gives an example of topside marking orientation versus pin 1 identifier
location.
3URGXFWLGHQWLILFDWLRQ )*
'DWHFRGH
< :: 5 5HYLVLRQFRGH
'RW
06Y9
1. Parts marked as "ES", "E" or accompanied by an Engineering Sample notification letter, are not yet
qualified and therefore not yet ready to be used in production and any consequences deriving from such
usage will not be at ST charge. In no event, ST will be liable for any customer usage of these engineering
samples in production. ST Quality has to be contacted prior to any decision to use these Engineering
Samples to run qualification activity.
^d/E'
W>E 'h'W>E
W/E
/Ed/&/d/KE
>
>
zDs
A - - 1.200 - - 0.0472
A1 0.050 - 0.150 0.0020 - 0.0059
A2 0.800 1.000 1.050 0.0315 0.0394 0.0413
b 0.190 - 0.300 0.0075 - 0.0118
c 0.090 - 0.200 0.0035 - 0.0079
(2)
D 6.400 6.500 6.600 0.2520 0.2559 0.2598
E 6.200 6.400 6.600 0.2441 0.2520 0.2598
E1(3) 4.300 4.400 4.500 0.1693 0.1732 0.1772
e - 0.650 - - 0.0256 -
L 0.450 0.600 0.750 0.0177 0.0236 0.0295
L1 - 1.000 - - 0.0394 -
k 0 - 8 0 - 8
aaa - - 0.100 - - 0.0039
1. Values in inches are converted from mm and rounded to four decimal digits.
2. Dimension D does not include mold flash, protrusions or gate burrs. Mold flash, protrusions or gate burrs
shall not exceed 0.15mm per side.
3. Dimension E1 does not include interlead flash or protrusions. Interlead flash or protrusions shall not
exceed 0.25mm per side.
Device marking
The following figure gives an example of topside marking orientation versus pin 1 identifier
location.
3URGXFWLGHQWLILFDWLRQ ))3
'DWHFRGH
3LQLGHQWLILHU
< :: 5 5HYLVLRQFRGH
06Y9
1. Parts marked as "ES", "E" or accompanied by an Engineering Sample notification letter, are not yet
qualified and therefore not yet ready to be used in production and any consequences deriving from such
usage will not be at ST charge. In no event, ST will be liable for any customer usage of these engineering
samples in production. ST Quality has to be contacted prior to any decision to use these Engineering
Samples to run qualification activity.
8 Part numbering
For a list of available options (memory, package, and so on) or for further information on any
aspect of this device, please contact your nearest ST sales office.
Device family
STM32 = ARM-based 32-bit microcontroller
Product type
F = General-purpose
Sub-family
042 = STM32F042xx
Pin count
F = 20 pins
G = 28 pins
K = 32 pins
T = 36 pins
C = 48 pins
Package
P = TSSOP
T = LQFP
U = UFQFPN
Y = WLCSP
Temperature range
6 = 40 to 85 C
7 = 40 to 105 C
Options
xxx = code ID of programmed parts (includes packing type)
TR = tape and reel packing
blank = tray packing
9 Revision history
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 STs 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.
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.