STMicroelectronics STM32F042G4 Manual

STMicroelectronics STM32F042G4 Manual

Arm-based 32-bit mcu, up to 32 kb flash, crystal-less usb fs 2.0, can, 8 timers, adc & comm. interfaces, 2.0 - 3.6 v
Hide thumbs Also See for STM32F042G4:
Table of Contents

Advertisement

Quick Links

®
ARM
-based 32-bit MCU, up to 32 KB Flash, crystal-less USB
FS 2.0, CAN, 8 timers, ADC & comm. interfaces, 2.0 - 3.6 V
Features
 Core: ARM
32-bit Cortex
frequency up to 48 MHz
 Memories
– 16 to 32 Kbytes of Flash memory
– 6 Kbytes of SRAM with HW parity
 CRC calculation unit
 Reset and power management
– Digital and I/Os supply: V
– Analog supply: V
– Selected I/Os: V
– Power-on/Power down reset (POR/PDR)
– Programmable voltage detector (PVD)
– Low power modes: Sleep, Stop, Standby
– V
supply for RTC and backup registers
BAT
 Clock management
– 4 to 32 MHz crystal oscillator
– 32 kHz oscillator for RTC with calibration
– Internal 8 MHz RC with x6 PLL option
– Internal 40 kHz RC oscillator
– Internal 48 MHz oscillator with automatic
trimming based on ext. synchronization
 Up to 37 fast I/Os
– All mappable on external interrupt vectors
– Up to 37 I/Os with 5 V tolerant capability
and 8 with independent supply V
 5-channel DMA controller
 One 12-bit, 1.0 μs ADC (up to 10 channels)
– Conversion range: 0 to 3.6 V
– Separate analog supply: 2.4 V to 3.6 V
 Up to 14 capacitive sensing channels for
touchkey, linear and rotary touch sensors
 Calendar RTC with alarm and periodic wakeup
from Stop/Standby
April 2014
This is information on a product in full production.
-M0 CPU,
= 2 V to 3.6 V
DD
= V
to 3.6 V
DDA
DD
= 1.65 V to 3.6 V
DDIO2
DDIO2
DocID025832 Rev 2
UFQFPN48 7x7
LQFP48 7x7
UFQFPN32 5x5
LQFP32 5x5
UFQFPN28 4x4
 Nine timers
– One 16-bit advanced-control timer for six
channel PWM output
– One 32-bit and four 16-bit timers, with up to
four IC/OC, OCN, usable for IR control
decoding
– Independent and system watchdog timers
– SysTick timer
 Communication interfaces
2
– One I
C interface supporting Fast Mode
Plus (1 Mbit/s) with 20 mA current sink,
SMBus/PMBus and wakeup
– Two USARTs supporting master
synchronous SPI and modem control; one
with ISO7816 interface, LIN, IrDA, auto
baud rate detection and wakeup feature
– Two SPIs (18 Mbit/s) with four to 16
programmable bit frames, one with I
interface multiplexed
– CAN interface
– USB 2.0 full-speed interface, able to run
from internal 48 MHz oscillator and with
BCD and LPM support
 HDMI CEC, wakeup on header reception
 Serial wire debug (SWD)
 96-bit unique ID
 All packages ECOPACK

Table 1. Device summary

Reference
STM32F042F4, STM32F042G4,
STM32F042K4, STM32F042T4,
STM32F042C4
STM32F042xx
STM32F042F6, STM32F042G6,
STM32F042K6, STM32F042T6,
STM32F042C6
STM32F042x
-
Datasheet
production data
WLCSP36
TSSOP20
2
S
2
Part number
www.st.com
1/117

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32F042G4 and is the answer not in the manual?

Questions and answers

Summary of Contents for STMicroelectronics STM32F042G4

  • Page 1: Table 1. Device Summary

     Up to 14 capacitive sensing channels for Table 1. Device summary touchkey, linear and rotary touch sensors Reference Part number  Calendar RTC with alarm and periodic wakeup STM32F042F4, STM32F042G4, from Stop/Standby STM32F042K4, STM32F042T4, STM32F042C4 STM32F042xx STM32F042F6, STM32F042G6, STM32F042K6, STM32F042T6,...
  • Page 2: Table Of Contents

    Contents STM32F042xx Contents Introduction ..........9 Description .
  • Page 3 STM32F042xx Contents 3.15 Universal synchronous/asynchronous receiver transmitters (USART) . . 25 3.16 Serial peripheral interface (SPI)/Inter-integrated sound interfaces (I S) . 26 3.17 High-definition multimedia interface (HDMI) - consumer electronics control (CEC) ........27 3.18 Controller area network (CAN) .
  • Page 4 Contents STM32F042xx 6.3.13 I/O current injection characteristics ......75 6.3.14 I/O port characteristics ........76 6.3.15 NRST pin characteristics .
  • Page 5 STM32F042xx List of tables List of tables Table 1. Device summary ............1 Table 2.
  • Page 6 List of tables STM32F042xx Table 48. Electrical sensitivities ........... . . 75 Table 49.
  • Page 7 STM32F042xx List of figures List of figures Figure 1. Block diagram ............12 Figure 2.
  • Page 8 List of figures STM32F042xx Figure 49. UFQFPN28 package top view ..........111 Figure 50.
  • Page 9: Introduction

    This datasheet provides the ordering information and mechanical device characteristics of the STM32F042x microcontrollers. This document should be read in conjunction with the STM32F0xxxx reference manual (RM0091). The reference manual is available from the STMicroelectronics website at www.st.com.  ...
  • Page 10: Description

    Description STM32F042xx Description   The STM32F042x microcontrollers incorporate the high-performance ARM Cortex 32-bit RISC core operating at a 48 MHz frequency, high-speed embedded memories (up to 32 Kbytes of Flash memory and 6 Kbytes of SRAM), and an extensive range of enhanced peripherals and I/Os.
  • Page 11: Table 2. Stm32F042X Device Features And Peripheral Counts

    STM32F042xx Description Table 2. STM32F042x device features and peripheral counts Peripheral STM32F042Fx STM32F042G STM32F042K STM32F042T STM32F042C Flash (Kbytes) SRAM (Kbytes) Advanced 1 (16-bit) control Timers 4 (16-bit) General purpose 1 (32-bit) SPI [I2S] 1 [1] 2 [1] USART Comm. interfaces 12-bit ADC (number of channels) (9 ext.
  • Page 12: Figure 1. Block Diagram

    Description STM32F042xx Figure 1. Block diagram 12/117 DocID025832 Rev 2...
  • Page 13: Functional Overview

    STM32F042xx Functional overview Functional overview ® ® Cortex -M0 core with embedded Flash and SRAM   The ARM Cortex -M0 processor is the latest generation of ARM processors for embedded systems. It has been developed to provide a low-cost platform that meets the needs of MCU implementation, with a reduced pin count and low-power consumption, while delivering outstanding computational performance and an advanced system response to interrupts.
  • Page 14: Cyclic Redundancy Check Calculation Unit (Crc)

    Functional overview STM32F042xx Cyclic redundancy check calculation unit (CRC) The CRC (cyclic redundancy check) calculation unit is used to get a CRC code from a 32-bit data word and a CRC-32 (Ethernet) polynomial. Among other applications, CRC-based techniques are used to verify data transmission or storage integrity.
  • Page 15: Voltage Regulator

    STM32F042xx Functional overview 3.5.3 Voltage regulator The regulator has two operating modes and it is always enabled after reset.  Main (MR) is used in normal operating mode (Run).  Low power (LPR) can be used in Stop mode where the power demand is reduced. In Standby mode, it is put in power down mode.
  • Page 16: Clocks And Startup

    Functional overview STM32F042xx Clocks and startup System clock selection is performed on startup, however the internal RC 8 MHz oscillator is selected as default CPU clock on reset. An external 4-32 MHz clock can be selected, in which case it is monitored for failure. If failure is detected, the system automatically switches back to the internal RC oscillator.
  • Page 17: General-Purpose Inputs/Outputs (Gpios)

    STM32F042xx Functional overview Figure 2. Clock tree General-purpose inputs/outputs (GPIOs) Each of the GPIO pins can be configured by software as output (push-pull or open-drain), as input (with or without pull-up or pull-down) or as peripheral alternate function. Most of the GPIO pins are shared with digital or analog alternate functions.
  • Page 18: Direct Memory Access Controller (Dma)

    Functional overview STM32F042xx The I/O configuration can be locked if needed following a specific sequence in order to avoid spurious writing to the I/Os registers. Direct memory access controller (DMA) The 5-channel general-purpose DMAs manage memory-to-memory, peripheral-to-memory and memory-to-peripheral transfers. The DMA supports circular buffer management, removing the need for user code intervention when the controller reaches the end of the buffer.
  • Page 19: Temperature Sensor

    STM32F042xx Functional overview 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.
  • Page 20: Vbat

    Functional overview STM32F042xx 3.10.3 battery voltage monitoring This embedded hardware feature allows the application to measure the V battery voltage using the internal ADC channel ADC_IN18. As the V voltage may be higher than V and thus outside the ADC input range, the V pin is internally connected to a bridge divider by 2.
  • Page 21: Timers And Watchdogs

    STM32F042xx Functional overview Table 6. No. of capacitive sensing channels available on STM32F042x devices Number of capacitive sensing channels STM32F042Cx STM32F042Kx Analog I/O group STM32F042Tx STM32F042Gx STM32F042Fx LQPF48 LQFP32 WLCSP36 UQFPN28 TSSOP20 UQFPN48 UQFPN32 Number of capacitive sensing channels 3.12 Timers and watchdogs The STM32F042x devices include up to five general-purpose timers and an advanced control timer.
  • Page 22: Advanced-Control Timer (Tim1)

    Functional overview STM32F042xx 3.12.1 Advanced-control timer (TIM1) The advanced-control timer (TIM1) can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs with programmable inserted dead times. It can also be seen as a complete general-purpose timer. The four independent channels can be used for: ...
  • Page 23: Independent Watchdog (Iwdg)

    STM32F042xx Functional overview They each have a single channel for input capture/output compare, PWM or one-pulse mode output. The TIM16 and TIM17 timers can work together via the Timer Link feature for synchronization or event chaining. TIM16 and TIM17 have a complementary output with dead-time generation and independent DMA request generation.
  • Page 24: Inter-Integrated Circuit Interfaces (I 2 C)

    Functional overview STM32F042xx 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.  Automatically correction for 28, 29 (leap year), 30, and 31 day of the month. ...
  • Page 25: Universal Synchronous/Asynchronous Receiver Transmitters (Usart)

    STM32F042xx Functional overview from the CPU clock, allowing the I2C1 to wake up the MCU from Stop mode on address match. The I2C interface can be served by the DMA controller. Table 9. STM32F042x I C implementation I2C features I2C1 7-bit addressing mode 10-bit addressing mode Standard mode (up to 100 kbit/s)
  • Page 26: Serial Peripheral Interface (Spi)/Inter-Integrated Sound Interfaces (I 2 S)

    Functional overview STM32F042xx Table 10. STM32F042x USART implementation (continued) USART modes/features USART1 USART2 LIN mode Dual clock domain and wakeup from Stop mode Receiver timeout interrupt Modbus communication Auto baud rate detection Driver Enable 1. X = supported. 2. USART1_CK is not available on 20/28 pin packages. Another source of clock (for example timer output programmed to the desired clock frequency) is needed to clock the card.
  • Page 27: High-Definition Multimedia Interface (Hdmi) - Consumer

    STM32F042xx Functional overview 3.17 High-definition multimedia interface (HDMI) - consumer electronics control (CEC) The device embeds a HDMI-CEC controller that provides hardware support for the Consumer Electronics Control (CEC) protocol (Supplement 1 to the HDMI standard). This protocol provides high-level control functions between all audiovisual products in an environment.
  • Page 28: Pinouts And Pin Descriptions

    Pinouts and pin descriptions STM32F042xx Pinouts and pin descriptions Figure 3. LQFP48 48-pin package pinout (top view) Figure 4. UFQFPN48 48-pin package pinout (top view) 28/117 DocID025832 Rev 2...
  • Page 29: Figure 5. Wlcsp36 36-Pin Package Ball-Out

    STM32F042xx Pinouts and pin descriptions Figure 5. WLCSP36 36-pin package ball-out Figure 6. LQFP32 32-pin package pinout (top view) DocID025832 Rev 2 29/117...
  • Page 30: Figure 7. Ufqfpn32 32-Pin Package Pinout (Top View)

    Pinouts and pin descriptions STM32F042xx Figure 7. UFQFPN32 32-pin package pinout (top view) Figure 8. UQFPN28 28-pin package (top view) 1. Pin pair PA11/12 can be remapped instead of pin pair PA9/10 using the SYSCFG_CFGR1 register. 30/117 DocID025832 Rev 2...
  • Page 31: Figure 9. Tssop20 20-Pin Package (Top View)

    STM32F042xx Pinouts and pin descriptions Figure 9. TSSOP20 20-pin package (top view) 1. Pin pair PA11/12 can be remapped instead of pin pair PA9/10 using the SYSCFG_CFGR1 register. DocID025832 Rev 2 31/117...
  • Page 32: Table 12. Legend/Abbreviations Used In The Pinout Table

    Pinouts and pin descriptions STM32F042xx Table 12. Legend/abbreviations used in the pinout table Name Abbreviation Definition 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 Supply pin Pin type Input only pin...
  • Page 33: Table 13. Stm32F042X Pin Definitions

    STM32F042xx Pinouts and pin descriptions Table 13. STM32F042x pin definitions Pin numbers Pin functions Pin name (function after Additional type Alternate function reset) functions VBAT Backup power supply WKUP2, RTC_TAMP1, PC13 RTC_TS, RTC_OUT PC14- OSC32_IN OSC32_IN (PC14) PC15- OSC32_OUT OSC32_OUT (PC15) CRS_ SYNC PF0-OSC_IN...
  • Page 34 Pinouts and pin descriptions STM32F042xx Table 13. STM32F042x pin definitions (continued) Pin numbers Pin functions Pin name (function after Additional type reset) Alternate function functions SPI1_NSS, I2S1_WS, TIM14_CH1, TSC_G2_IO1, ADC_IN4 USART2_CK USB_NOE SPI1_SCK, I2S1_CK, CEC, ADC_IN5 TIM2_CH1_ETR, TSC_G2_IO2 SPI1_MISO, I2S1_MCK, TIM3_CH1, TIM1_BKIN, TIM16_CH1, ADC_IN6...
  • Page 35 STM32F042xx Pinouts and pin descriptions Table 13. STM32F042x pin definitions (continued) Pin numbers Pin functions Pin name (function after Additional type reset) Alternate function functions SPI2_SCK, PB13 TIM1_CH1N, I2C1_SCL SPI2_MISO, PB14 TIM1_CH2N, I2C1_SDA SPI2_MOSI, WKUP7, PB15 TIM1_CH3N RTC_REFIN USART1_CK, TIM1_CH1, EVENTOUT, MCO, CRS_SYNC USART1_TX,...
  • Page 36 Pinouts and pin descriptions STM32F042xx Table 13. STM32F042x pin definitions (continued) Pin numbers Pin functions Pin name (function after Additional type reset) Alternate function functions PA14 USART2_TX, SWCLK SPI1_NSS, I2S1_WS, USART2_RX, PA15 TIM2_CH1_ETR, EVENTOUT, USB_NOE SPI1_SCK, I2S1_CK, TIM2_CH2, TSC_G5_IO1, EVENTOUT SPI1_MISO, I2S1_MCK, TIM17_BKIN, TIM3_CH1,...
  • Page 37 STM32F042xx Pinouts and pin descriptions Table 13. STM32F042x pin definitions (continued) Pin numbers Pin functions Pin name (function after Additional type reset) Alternate function functions SPI2_NSS, I2C1_SDA, IR_OUT, TIM17_CH1, EVENTOUT, CAN_TX Ground 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.
  • Page 38: Table 14. Alternate Functions Selected Through Gpioa_Afr Registers For Port A

    Table 14. Alternate functions selected through GPIOA_AFR registers for port A Pin name USART2_CTS TIM2_CH1_ETR TSC_G1_IO1 EVENTOUT USART2_RTS TIM2_CH2 TSC_G1_IO2 USART2_TX TIM2_CH3 TSC_G1_IO3 USART2_RX TIM2_CH4 TSC_G1_IO4 SPI1_NSS, I2S1_WS USART2_CK USB_NOE TSC_G2_IO1 TIM14_CH1 SPI1_SCK, I2S1_CK TIM2_CH1_ETR TSC_G2_IO2 SPI1_MISO, I2S1_MCK TIM3_CH1 TIM1_BKIN TSC_G2_IO3 TIM16_CH1 EVENTOUT...
  • Page 39: Table 15. Alternate Functions Selected Through Gpiob_Afr Registers For Port B

    Table 15. Alternate functions selected through GPIOB_AFR registers for port B Pin name EVENTOUT TIM3_CH3 TIM1_CH2N TSC_G3_IO2 TIM14_CH1 TIM3_CH4 TIM1_CH3N TSC_G3_IO3 TSC_G3_IO4 SPI1_SCK, I2S1_CK EVENTOUT TIM2_CH2 TSC_G5_IO1 SPI1_MISO, I2S1_MCK TIM3_CH1 EVENTOUT TSC_G5_IO2 TIM17_BKIN SPI1_MOSI, I2S1_SD TIM3_CH2 TIM16_BKIN I2C1_SMBA USART1_TX I2C1_SCL TIM16_CH1N TSC_G5_IO3 USART1_RX...
  • Page 40: Table 16. Alternate Functions Selected Through Gpiof_Afr Registers For Port F

    Pinouts and pin descriptions STM32F042xx Table 16. Alternate functions selected through GPIOF_AFR registers for port F Pin name CRS_SYNC I2C1_SDA I2C1_SCL 40/117 DocID025832 Rev 2...
  • Page 41: Memory Mapping

    STM32F042xx Memory mapping Memory mapping Figure 10. STM32F042x memory map DocID025832 Rev 2 41/117...
  • Page 42: Table 17. Stm32F042X Peripheral Register Boundary Addresses

    Memory mapping STM32F042xx Table 17. STM32F042x peripheral register boundary addresses Boundary address Size Peripheral 0x4800 1800 - 0x5FFF FFFF ~384 MB Reserved 0x4800 1400 - 0x4800 17FF 1 KB GPIOF 0x4800 0C00 - 0x4800 13FF 2 KB Reserved AHB2 0x4800 0800 - 0x4800 0BFF 1 KB GPIOC 0x4800 0400 - 0x4800 07FF...
  • Page 43 STM32F042xx Memory mapping Table 17. STM32F042x peripheral register boundary addresses (continued) Boundary address Size Peripheral 0x4000 7C00 - 0x4000 7FFF 1 KB Reserved 0x4000 7800 - 0x4000 7BFF 1 KB 0x4000 7400 - 0x4000 77FF 1 KB Reserved 0x4000 7000 - 0x4000 73FF 1 KB 0x4000 6C00 - 0x4000 6FFF 1 KB...
  • Page 44: Electrical Characteristics

    Electrical characteristics STM32F042xx Electrical characteristics Parameter conditions Unless otherwise specified, all voltages are referenced to V 6.1.1 Minimum and maximum values Unless otherwise specified, the minimum and maximum values are guaranteed in the worst conditions of ambient temperature, supply voltage and frequencies by tests in production on 100% of the devices with an ambient temperature at T = 25 °C and T max (given by...
  • Page 45: Power Supply Scheme

    STM32F042xx Electrical characteristics 6.1.6 Power supply scheme Figure 13. Power supply scheme Caution: Each power supply pair (V 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.
  • Page 46: Current Consumption Measurement

    Electrical characteristics STM32F042xx 6.1.7 Current consumption measurement Figure 14. Current consumption measurement scheme 46/117 DocID025832 Rev 2...
  • Page 47: Absolute Maximum Ratings

    STM32F042xx Electrical characteristics Absolute maximum ratings Stresses above the absolute maximum ratings listed in Table 18: Voltage characteristics, Table 19: Current characteristics Table 20: Thermal characteristics may cause permanent damage to the device. These are stress ratings only and functional operation of the device at these conditions is not implied.
  • Page 48: Table 19. Current Characteristics

    Electrical characteristics STM32F042xx Table 19. Current characteristics Symbol Ratings Max. Unit I Total current into sum of all VDD power lines (source) I Total current out of sum of all VSS ground lines (sink) -120 Maximum current into each VDD power pin (source) VDD(PIN) Maximum current out of each VSS ground pin (sink) -100...
  • Page 49: Operating Conditions

    STM32F042xx Electrical characteristics Operating conditions 6.3.1 General operating conditions Table 21. General operating conditions Symbol Parameter Conditions Unit Internal AHB clock frequency HCLK Internal APB clock frequency PCLK Standard operating voltage Must not be supplied if V I/O supply voltage 1.65 DDIO2 is not present...
  • Page 50: Operating Conditions At Power-Up / Power-Down

    Electrical characteristics STM32F042xx 6.3.2 Operating conditions at power-up / power-down The parameters given in Table 22 are derived from tests performed under the ambient temperature condition summarized in Table Table 22. Operating conditions at power-up / power-down Symbol Parameter Conditions Unit ...
  • Page 51: Embedded Reference Voltage

    STM32F042xx Electrical characteristics Table 24. Programmable voltage detector characteristics (continued) Symbol Parameter Conditions Unit Rising edge 2.47 2.58 2.69 PVD threshold 4 PVD4 Falling edge 2.37 2.48 2.59 Rising edge 2.57 2.68 2.79 PVD threshold 5 PVD5 Falling edge 2.47 2.58 2.69 Rising edge...
  • Page 52: Supply Current Characteristics

    Electrical characteristics STM32F042xx 6.3.5 Supply current characteristics The current consumption is a function of several parameters and factors such as the operating voltage, ambient temperature, I/O pin loading, device software configuration, operating frequencies, I/O pin switching rate, program location in memory and executed binary code.
  • Page 53 STM32F042xx Electrical characteristics Table 26. Typical and maximum current consumption from V supply at V = 3.6 V (continued) All peripherals enabled All peripherals disabled Max @ T Max @ T Conditions Unit HCLK 25 °C 85 °C 105 °C 25 °C 85 °C 105 °C HSI48...
  • Page 54 Electrical characteristics STM32F042xx Table 27. Typical and maximum current consumption from the V supply = 2.4 V = 3.6 V Para- Conditions Symbol Unit Max @ T Max @ T HCLK meter 25 °C 85 °C 105 °C 25 °C 85 °C 105 °C HSI48 48 MHz 48 MHz...
  • Page 55: Table 28. Typical And Maximum Consumption In Stop And Standby Modes

    STM32F042xx Electrical characteristics Table 28. Typical and maximum consumption in Stop and Standby modes Typ @V Conditions 25°C 85°C 105°C Regulator in stop 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 Regulator in low- Stop mode power mode, all 32.0...
  • Page 56: Table 29. Typical And Maximum Current Consumption From The Vbat Supply

    Electrical characteristics STM32F042xx Table 29. Typical and maximum current consumption from the V supply Typ @ V Symbol Parameter Conditions Unit 25 °C 85 °C 105 °C LSE & RTC ON; “Xtal mode”: lower driving capability; LSEDRV[1:0] = '00' domain μA VBAT supply...
  • Page 57: Table 30. Typical Current Consumption, Code Executing From Flash, Running From Hse

    STM32F042xx Electrical characteristics Table 30. Typical current consumption, code executing from Flash, running from HSE 8 MHz crystal Typical consumption Typical consumption in Run mode in Sleep mode Symbol Parameter Unit HCLK Peripherals Peripherals Peripherals Peripherals enabled disabled enabled disabled 48 MHz 20.7 12.8...
  • Page 58 Electrical characteristics STM32F042xx I/O system current consumption The current consumption of the I/O system has two components: static and dynamic. I/O static current consumption All the I/Os used as inputs with pull-up generate current consumption when the pin is externally held low. The value of this current consumption can be simply computed by using the pull-up/pull-down resistors values given in Table 50: I/O static characteristics.
  • Page 59: Table 31. Switching Output I/O Current Consumption

    STM32F042xx Electrical characteristics Table 31. Switching output I/O current consumption I/O toggling Symbol Parameter Conditions Unit frequency (f 4 MHz 0.07 8 MHz 0.15 = 3.3 V DDIOx 16 MHz 0.31 C =C 24 MHz 0.53 48 MHz 0.92 4 MHz 0.18 8 MHz 0.37...
  • Page 60: Table 32. Peripheral Current Consumption

    Electrical characteristics STM32F042xx On-chip peripheral current consumption The current consumption of the on-chip peripherals is given in Table 32. The MCU is placed under the following conditions:  All I/O pins are in analog mode  All peripherals are disabled unless otherwise mentioned ...
  • Page 61 STM32F042xx Electrical characteristics Table 32. Peripheral current consumption (continued) Peripheral Typical consumption at 25 °C Unit APB-Bridge 13.8 DEBUG (MCU debug feature) I2C1 SPI1 SPI2 SYSCFG μA/MHz TIM1 16.0 TIM2 17.6 TIM3 12.5 TIM14 TIM16 TIM17 USART1 18.6 USART2 WWDG ALL APB Peripherals 153.8 1.
  • Page 62: Wakeup Time From Low-Power Mode

    Electrical characteristics STM32F042xx 6.3.6 Wakeup time from low-power mode The wakeup times given in Table 33 are the latency between the event and the execution of the first user instruction. The device goes in low-power mode after the WFE (Wait For Event) instruction, in the case of a WFI (Wait For Interruption) instruction, 16 CPU cycles must be added to the following timings due to the interrupt latency in the Cortex M0 architecture.
  • Page 63: External Clock Source Characteristics

    STM32F042xx Electrical characteristics 6.3.7 External clock source characteristics High-speed external user clock generated from an external source In bypass mode the HSE oscillator is switched off and the input pin is a standard GPIO. The external clock signal has to respect the I/O characteristics in Section 6.3.14.
  • Page 64: Table 35. Low-Speed External User Clock Characteristics

    Electrical characteristics STM32F042xx Low-speed external user clock generated from an external source In bypass mode the LSE oscillator is switched off and the input pin is a standard GPIO. The external clock signal has to respect the I/O characteristics in Section 6.3.14.
  • Page 65: Table 36. Hse Oscillator Characteristics

    STM32F042xx Electrical characteristics High-speed external clock generated from a crystal/ceramic resonator The high-speed external (HSE) clock can be supplied with a 4 to 32 MHz crystal/ceramic resonator oscillator. All the information given in this paragraph are based on design simulation results obtained with typical external components specified in Table 36.
  • Page 66: Figure 17. Typical Application With An 8 Mhz Crystal

    Electrical characteristics STM32F042xx Figure 17. Typical application with an 8 MHz crystal 1. R value depends on the crystal characteristics. 66/117 DocID025832 Rev 2...
  • Page 67: Table 37. Lse Oscillator Characteristics (F Lse = 32.768 Khz)

    STM32F042xx Electrical characteristics Low-speed external clock generated from a crystal resonator The low-speed external (LSE) clock can be supplied with a 32.768 kHz crystal resonator oscillator. All the information given in this paragraph are based on design simulation results obtained with typical external components specified in Table 37.
  • Page 68: Figure 18. Typical Application With A 32.768 Khz Crystal

    Electrical characteristics STM32F042xx Figure 18. Typical application with a 32.768 kHz crystal Note: An external resistor is not required between OSC32_IN and OSC32_OUT and it is forbidden to add one. 68/117 DocID025832 Rev 2...
  • Page 69: Internal Clock Source Characteristics

    STM32F042xx Electrical characteristics 6.3.8 Internal clock source characteristics The parameters given in Table 38 are derived from tests performed under ambient temperature and supply voltage conditions summarized in Table 21: General operating conditions. The provided curves are characterization results, not tested in production. High-speed internal (HSI) RC oscillator Table 38.
  • Page 70: Table 39. Hsi14 Oscillator Characteristics

    Electrical characteristics STM32F042xx High-speed internal 14 MHz (HSI14) RC oscillator (dedicated to ADC) Table 39. HSI14 oscillator characteristics Symbol Parameter Conditions Unit Frequency HSI14 TRIM HSI14 user-trimming step DuCy Duty cycle (HSI14) = –40 to 105 °C –4.2 = –10 to 85 °C –3.2 Accuracy of the HSI14 HSI14...
  • Page 71: Table 40. Hsi48 Oscillator Characteristics

    STM32F042xx Electrical characteristics High-speed internal 48 MHz (HSI48) RC oscillator Table 40. HSI48 oscillator characteristics Symbol Parameter Conditions Unit Frequency HSI48 TRIM HSI48 user-trimming step 0.09 0.14 DuCy Duty cycle (HSI48) = –40 to 105 °C -4.9 = –10 to 85 °C -4.1 Accuracy of the HSI48 HSI48...
  • Page 72: Pll Characteristics

    Electrical characteristics STM32F042xx Low-speed internal (LSI) RC oscillator Table 41. LSI oscillator characteristics Symbol Parameter Unit Frequency LSI oscillator startup time μs su(LSI) LSI oscillator power consumption 0.75 μA DDA(LSI) 1. V = 3.3 V, T = –40 to 105 °C unless otherwise specified. 2.
  • Page 73: Memory Characteristics

    STM32F042xx Electrical characteristics 6.3.10 Memory characteristics Flash memory The characteristics are given at T = –40 to 105 °C unless otherwise specified. Table 43. Flash memory characteristics Symbol Parameter Conditions Unit –40 to +105 °C 16-bit programming time T 53.5 μs prog –40 to +105 °C...
  • Page 74: Table 45. Ems Characteristics

    Electrical characteristics STM32F042xx Table 45. EMS characteristics Level/ Symbol Parameter Conditions Class 3.3 V, LQFP48, T +25 °C, Voltage limits to be applied on any I/O pin 48 MHz, FESD HCLK to induce a functional disturbance conforming to IEC 61000-4-2 3.3 V, LQFP48, T +25°C, Fast transient voltage burst limits to be...
  • Page 75: Electrical Sensitivity Characteristics

    STM32F042xx Electrical characteristics 6.3.12 Electrical sensitivity characteristics Based on three different tests (ESD, LU) using specific measurement methods, the device is stressed in order to determine its performance in terms of electrical sensitivity. Electrostatic discharge (ESD) Electrostatic discharges (a positive then a negative pulse separated by 1 second) are applied to the pins of each sample according to each pin combination.
  • Page 76: I/O Port Characteristics

    Electrical characteristics STM32F042xx Functional susceptibility to I/O current injection While a simple application is executed on the device, the device is stressed by injecting current into the I/O pins programmed in floating input mode. While current is injected into the I/O pin, one at a time, the device is checked for functional failures. The failure is indicated by an out of range parameter: ADC error above a certain limit (higher than 5 LSB TUE), out of conventional limits of induced leakage current on adjacent pins (out of the -5 μA/+0 μA range) or other functional failure (for example reset occurrence or...
  • Page 77 STM32F042xx Electrical characteristics Table 50. I/O static characteristics (continued) Symbol Parameter Conditions Unit TC, FT and FTf I/O   0.1 TTa in digital mode      DDIOx TTa in digital mode Input leakage      μA DDIOx current...
  • Page 78: Figure 22. Tc And Tta I/O Input Characteristics

    Electrical characteristics STM32F042xx 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 5 V tolerant I/Os.
  • Page 79: Figure 23. Five Volt Tolerant (Ft And Ftf) I/O Input Characteristics

    STM32F042xx Electrical characteristics Figure 23. Five volt tolerant (FT and FTf) I/O input characteristics TESTED RANGE TTL standard requirement TTL standard requirement TTL standard requirement TESTED RANGE DDIOx MS32131V3 DocID025832 Rev 2 79/117...
  • Page 80: Table 51. Output Voltage Characteristics

    Electrical characteristics STM32F042xx Output driving current The GPIOs (general purpose input/outputs) can sink or source up to +/-8 mA, and sink or source up to +/- 20 mA (with a relaxed V In the user application, the number of I/O pins which can drive current must be limited to respect the absolute maximum rating specified in Section 6.2:...
  • Page 81: Table 52. I/O Ac Characteristics

    STM32F042xx Electrical characteristics Input/output AC characteristics The definition and values of input/output AC characteristics are given in Figure 24 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.
  • Page 82: Nrst Pin Characteristics

    Electrical characteristics STM32F042xx (1)(2) Table 52. I/O AC characteristics (continued) OSPEEDRy Symbol Parameter Conditions Unit [1:0] value Maximum frequency max(IO)out  Output fall time = 50 pF, V f(IO)out DDIOx Output rise time r(IO)out configuration Maximum frequency max(IO)out  Output fall time = 50 pF, V f(IO)out DDIOx...
  • Page 83: 12-Bit Adc Characteristics

    STM32F042xx Electrical characteristics Table 53. NRST pin characteristics (continued) Symbol Parameter Conditions Unit NRST Schmitt trigger voltage hys(NRST) hysteresis Weak pull-up equivalent  k resistor NRST input filtered pulse F(NRST) 2.7 < V < 3.6 NRST input not filtered pulse NF(NRST) 2.0 <...
  • Page 84 Electrical characteristics STM32F042xx Table 54. ADC characteristics (continued) Symbol Parameter Conditions Unit = 14 MHz External trigger frequency TRIG Conversion voltage range Equation 1 External input impedance k Table 55 for details Sampling switch k resistance Internal sample and hold capacitor = 14 MHz μs...
  • Page 85: Table 55. Rain Max For F Adc = 14 Mhz

    STM32F042xx Electrical characteristics 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). Table 55. R max for f = 14 MHz (cycles) (μs) max (k)
  • Page 86: Figure 26. Adc Accuracy Characteristics

    Electrical characteristics STM32F042xx Figure 26. ADC accuracy characteristics Figure 27. Typical connection diagram using the ADC 1. Refer to Table 54: ADC characteristics for the values of R and C 2. C represents the capacitance of the PCB (dependent on soldering and PCB layout quality) plus the parasitic pad capacitance (roughly 7 pF).
  • Page 87: Temperature Sensor Characteristics

    STM32F042xx Electrical characteristics 6.3.17 Temperature sensor characteristics Table 57. TS characteristics Symbol Parameter Unit   1   2 linearity with temperature °C SENSE Avg_Slope Average slope mV/°C Voltage at 30 °C (5 °C) 1.34 1.43 1.52 Startup time μs START ADC sampling time when reading the...
  • Page 88: Communication Interfaces

    Electrical characteristics STM32F042xx Table 59. TIMx characteristics (continued) Symbol Parameter Conditions Unit 65536 × 65536 Maximum possible count TIMxCLK MAX_COUNT with 32-bit counter = 48 MHz 89.48 TIMxCLK Table 60. IWDG min/max timeout period at 40 kHz (LSI) Min timeout RL[11:0]= Max timeout RL[11:0]= Prescaler divider PR[2:0] bits...
  • Page 89: Table 62. I2C Analog Filter Characteristics

    STM32F042xx Electrical characteristics All I2C SDA and SCL I/Os embed an analog filter. Refer to the table below for the analog filter characteristics: Table 62. I2C analog filter characteristics Symbol Parameter Unit Maximum pulse width of spikes that are suppressed by the analog filter 1.
  • Page 90: Table 63. Spi Characteristics

    Electrical characteristics STM32F042xx SPI/I S characteristics Unless otherwise specified, the parameters given in Table 63 for SPI or in Table 64 for I are derived from tests performed under the ambient temperature, f frequency and PCLKx supply voltage conditions summarized in Table 21: General operating conditions.
  • Page 91: Figure 28. Spi Timing Diagram - Slave Mode And Cpha = 0

    STM32F042xx Electrical characteristics Figure 28. SPI timing diagram - slave mode and CPHA = 0 Figure 29. SPI timing diagram - slave mode and CPHA = 1 1. Measurement points are done at CMOS levels: 0.3 V and 0.7 V DocID025832 Rev 2 91/117...
  • Page 92: Table 64. I 2 S Characteristics

    Electrical characteristics STM32F042xx Figure 30. SPI timing diagram - master mode 1. Measurement points are done at CMOS levels: 0.3 V and 0.7 V Table 64. I S characteristics Symbol Parameter Conditions Unit Master mode (data: 16 bits, Audio 1.597 1.601 frequency = 48 kHz) S clock frequency...
  • Page 93: Figure 31. I2S Slave Timing Diagram (Philips Protocol)

    STM32F042xx Electrical characteristics Table 64. I S characteristics (continued) Symbol Parameter Conditions Unit Data input setup time Master receiver su(SD_MR) Data input setup time Slave receiver su(SD_SR) Master receiver h(SD_MR) Data input hold time Slave receiver h(SD_SR) Data output valid time v(SD_ST) Slave transmitter (after enable edge) Data output hold time...
  • Page 94: Figure 32. I2S Master Timing Diagram (Philips Protocol)

    Electrical characteristics STM32F042xx Figure 32. I2S master timing diagram (Philips protocol) 1. Data based on characterization results, not tested in production. 2. LSB transmit/receive of the previously transmitted byte. No LSB transmit/receive is sent before the first byte. CAN (controller area network) interface Refer to Section 6.3.14: I/O port characteristics for more details on the input/output alternate...
  • Page 95: Package Characteristics

    STM32F042xx Package characteristics Package characteristics Package mechanical data In order to meet environmental requirements, ST offers these devices in different grades of   ECOPACK packages, depending on their level of environmental compliance. ECOPACK specifications, grade definitions and product status are available at: www.st.com. ...
  • Page 96: Figure 34. Lqfp48 Recommended Footprint

    Package characteristics STM32F042xx Table 65. LQFP48 – 7 mm x 7 mm low-profile quad flat package mechanical data millimeters inches Symbol 0.090 0.200 0.0035 0.0079 8.800 9.000 9.200 0.3465 0.3543 0.3622 6.800 7.000 7.200 0.2677 0.2756 0.2835 5.500 0.2165 8.800 9.000 9.200 0.3465...
  • Page 97: Figure 35. Lqfp48 Package Top View

    STM32F042xx Package characteristics Marking of engineering samples for LQFP48 The following figure shows the engineering sample marking for the LQFP48 package. Only the information field containing the engineering sample marking is shown. Figure 35. LQFP48 package top view 1. Samples marked “ES” are to be considered as “Engineering Samples”: i.e. they are intended to be sent to customer for electrical compatibility evaluation and may be used to start customer qualification where specifically authorized by ST in writing.
  • Page 98: Figure 36. Ufqfpn48 - 7 Mm X 7 Mm, 0.5 Mm Pitch, Package Outline

    Package characteristics STM32F042xx Figure 36. UFQFPN48 – 7 mm x 7 mm, 0.5 mm pitch, package outline 1. Drawing is not to scale. 2. All leads/pads should also be soldered to the PCB to improve the lead/pad solder joint life. 3.
  • Page 99: Table 66. Ufqfpn48 - 7 Mm X 7 Mm, 0.5 Mm Pitch, Package Mechanical Data

    STM32F042xx Package characteristics Table 66. UFQFPN48 – 7 mm x 7 mm, 0.5 mm pitch, package mechanical data millimeters inches Symbol 0.500 0.550 0.600 0.0197 0.0217 0.0236 0.000 0.020 0.050 0.0000 0.0008 0.0020 6.900 7.000 7.100 0.2717 0.2756 0.2795 6.900 7.000 7.100 0.2717...
  • Page 100: Figure 38. Ufqfpn48 Package Top View

    Package characteristics STM32F042xx Marking of engineering samples for UFQFPN48 The following figure shows the engineering sample marking for the UFQFPN48 package. Only the information field containing the engineering sample marking is shown. Figure 38. UFQFPN48 package top view 1. Samples marked “ES” are to be considered as “Engineering Samples”: i.e. they are intended to be sent to customer for electrical compatibility evaluation and may be used to start customer qualification where specifically authorized by ST in writing.
  • Page 101: Figure 39. Wlcsp36 - 0.4 Mm Pitch, Package Outline

    STM32F042xx Package characteristics Figure 39. WLCSP36 - 0.4 mm pitch, package outline 1. Drawing is not to scale. DocID025832 Rev 2 101/117...
  • Page 102: Table 67. Wlcsp36, 0.4 Mm Pitch, Package Mechanical Data

    Package characteristics STM32F042xx Table 67. WLCSP36, 0.4 mm pitch, package mechanical data millimeters inches Symbol 0.555 0.525 0.585 0.0219 0.0207 0.0230 0.175 0.0069 0.380 0.0150 0.025 0.0010 0.250 0.220 0.280 0.0098 0.0087 0.0110 2.605 2.570 2.640 0.1026 0.1012 0.1039 2.703 2.668 2.738 0.1064...
  • Page 103: Figure 40. Wlcsp36 Package Top View

    STM32F042xx Package characteristics Marking of engineering samples for WLCSP36 The following figure shows the engineering sample marking for the WLCSP36 package. Only the information field containing the engineering sample marking is shown. Figure 40. WLCSP36 package top view 1. Samples marked “E” are to be considered as “Engineering Samples”: i.e. they are intended to be sent to customer for electrical compatibility evaluation and may be used to start customer qualification where specifically authorized by ST in writing.
  • Page 104: Table 68. Lqfp32 - 7 Mm X 7 Mm 32-Pin Low-Profile Quad Flat Package Mechanical Data

    Package characteristics STM32F042xx Figure 41. LQFP32 – 7 mm x 7 mm 32-pin low-profile quad flat package outline 1. Drawing is not to scale. Table 68. LQFP32 – 7 mm x 7 mm 32-pin low-profile quad flat package mechanical data millimeters inches Symbol...
  • Page 105: Figure 42. Lqfp32 Recommended Footprint

    STM32F042xx Package characteristics Table 68. LQFP32 – 7 mm x 7 mm 32-pin low-profile quad flat package mechanical data millimeters inches Symbol 6.800 7.000 7.200 0.2677 0.2756 0.2835 5.600 0.2205 8.800 9.000 9.200 0.3465 0.3543 0.3622 6.800 7.000 7.200 0.2677 0.2756 0.2835 5.600...
  • Page 106: Figure 43. Lqfp32 Package Top View

    Package characteristics STM32F042xx Marking of engineering samples for LQFP32 The following figure shows the engineering sample marking for the LQFP32 package. Only the information field containing the engineering sample marking is shown. Figure 43. LQFP32 package top view 1. Samples marked “ES” are to be considered as “Engineering Samples”: i.e. they are intended to be sent to customer for electrical compatibility evaluation and may be used to start customer qualification where specifically authorized by ST in writing.
  • Page 107: Table 69. Ufqfpn32 - 5 X 5 Mm, 32-Lead Ultra Thin Fine Pitch Quad Flat No-Lead Package

    STM32F042xx Package characteristics Figure 44. UFQFPN32 - 5 x 5 mm, 32-lead ultra thin fine pitch quad flat no-lead package outline Seating plane ddd C Pin # 1 ID R = 0.30 Bottom view A0B8_ME 1. Drawing is not to scale. 2.
  • Page 108: Figure 45. Ufqfpn32 Recommended Footprint

    Package characteristics STM32F042xx Figure 45. UFQFPN32 recommended footprint 1. Drawing is not to scale. 2. Dimensions are in millimeters. Marking of engineering samples for UFQFPN32 The following figure shows the engineering sample marking for the UFQFPN32 package. Only the information field containing the engineering sample marking is shown. Figure 46.
  • Page 109: Table 70. Ufqfpn28 - 4 X 4 Mm, 28-Lead Ultra Thin Fine Pitch Quad Flat No-Lead Package

    STM32F042xx Package characteristics Figure 47. UFQFPN28 - 4 x 4 mm, 28-lead ultra thin fine pitch quad flat no-lead package outline 1. Drawing is not to scale. 2. Dimensions are in millimeters. 3. All leads/pads should also be soldered to the PCB to improve the lead/pad solder joint life. Table 70.
  • Page 110: Figure 48. Ufqfpn28 Recommended Footprint

    Package characteristics STM32F042xx Figure 48. UFQFPN28 recommended footprint 1. Dimensions are in millimeters 2. All leads/pads should also be soldered to the PCB to improve the lead/pad solder joint life. 110/117 DocID025832 Rev 2...
  • Page 111: Figure 49. Ufqfpn28 Package Top View

    STM32F042xx Package characteristics Marking of engineering samples for UFQFPN28 The following figure shows the engineering sample marking for the UFQFPN28 package. Only the information field containing the engineering sample marking is shown. Figure 49. UFQFPN28 package top view 1. Samples marked “E” are to be considered as “Engineering Samples”: i.e. they are intended to be sent to customer for electrical compatibility evaluation and may be used to start customer qualification where specifically authorized by ST in writing.
  • Page 112: Table 71. Tssop20 - 20-Pin Thin Shrink Small Outline Package Mechanical Data

    Package characteristics STM32F042xx Figure 50. TSSOP20 - 20-pin thin shrink small outline 1. Drawing is not to scale. Table 71. TSSOP20 – 20-pin thin shrink small outline package mechanical data millimeters inches Symbol 0.0472 0.05 0.15 0.002 0.0059 1.05 0.0315 0.0394 0.0413 0.19...
  • Page 113: Figure 51. Tssop20 Recommended Footprint

    STM32F042xx Package characteristics Figure 51. TSSOP20 recommended footprint 1. Dimensions are in millimeters. Marking of engineering samples for TSSOP20 The following figure shows the engineering sample marking for the TSSOP20 package. Only the information field containing the engineering sample marking is shown. Figure 52.
  • Page 114: Thermal Characteristics

    Package characteristics STM32F042xx Thermal characteristics The maximum chip junction temperature (T max) must never exceed the values given in Table 21: General operating conditions. The maximum chip-junction temperature, T max, in degrees Celsius, may be calculated using the following equation: max x ...
  • Page 115: Part Numbering

    STM32F042xx Part numbering 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. Table 73. Ordering information scheme Example: STM32 F Device family STM32 = ARM-based 32-bit microcontroller Product type...
  • Page 116: Revision History

    Revision history STM32F042xx Revision history Table 74. Document revision history Date Revision Changes 25-Feb-2014 Initial release. Updated: – The document status to Datasheet - production data, – Table 10: STM32F042x USART implementation: added one table footnote. – Figure 3: LQFP48 48-pin package pinout (top view), –...
  • Page 117 Please Read Carefully: Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, without notice.

Table of Contents