On-Chip Resources (Peripherals) of STM32F1

This article and the following ones mainly introduce the usage of STM32F103C8T6.

On-Chip Resources (Peripherals) of STM32F1

So why is it called STM32F103C8T6? Below are the naming rules for STM32, and you can understand the various parameters of each chip through this diagram.

On-Chip Resources (Peripherals) of STM32F1

01

Introduction

According to the end of the previous article, this chip belongs to the mainstream series STM32F1, with an ARM Cortex-M3 core, a main frequency of 72MHz, RAM (operational memory) of 20K, actual storage medium is SRAM, ROM (program memory) is 64K, actual storage medium is Flash memory, power supply is 2.0~3.6V, with a standard of 3.3V, 5V is not within the power supply range, so it cannot be powered by 5V like C51, package is LQFP48, with a total of 48 pins, if you design your own board, you need to understand its pin configuration.

02

On-Chip Resources/Peripherals

The following are the on-chip resources (also known as peripherals), in English called peripherals, and what we mainly learn are these peripherals, which we configure through programming to achieve desired functions. The first two darker colored ones are peripherals located within the Cortex-M3 core, while the rest are peripherals outside the core.

Let’s briefly introduce them first.

(This is just for impression; we will encounter them gradually later.)

On-Chip Resources (Peripherals) of STM32F1

01

On-Chip Resources (Peripherals) of STM32F1

Core Peripherals:

NVIC (Nested Vectored Interrupt Controller)

This is a device inside the core used to manage interrupts, such as configuring interrupt priorities.

SysTick (System Tick Timer)

This is a timer inside the core, mainly used to provide timing services for the operating system. STM32 can integrate operating systems like FreeRTOS, UCOS, etc. If these operating systems are used, SysTick is needed to provide timing for task switching. Of course, we do not need this yet; we only use this timer to complete the delay function of Delay.

02

On-Chip Resources (Peripherals) of STM32F1

RCC (Reset and Clock Control)

This can configure the system clock and enable the clocks of various modules. In STM32, other peripherals do not have clocks by default when powered on; operating peripherals without a clock is ineffective, and they will not work. This is to reduce power consumption. Therefore, before operating peripherals, it is necessary to enable their clocks, which requires us to use RCC to complete the clock enabling.

03

On-Chip Resources (Peripherals) of STM32F1

GPIO (General Purpose Input/Output)

GPIO (General IO ports) is one of the most basic peripherals, which can be configured as input or output mode, used to read external signals or control external devices. STM32’s GPIO has various configuration modes, such as analog input, floating input, pull-up input, pull-down input, open-drain output, and push-pull output.

AFIO (Alternate Function Input/Output)

AFIO is an important peripheral in STM32 microcontrollers, which can complete port remapping and interrupt port configuration.

04

On-Chip Resources (Peripherals) of STM32F1

TIM (Timer)

The most commonly used and feature-rich peripheral in STM32, divided into advanced timers, general timers, and basic timers, can be used to generate precise time delays, measure time intervals, produce PWM signals, etc. For example, PWM signals are the basic requirements for motor drive and servo drive.

05

On-Chip Resources (Peripherals) of STM32F1

EXTI (External Interrupt)

It can monitor changes in external signals (such as level changes) and generate interrupts or events based on these changes, allowing the system to respond promptly to changes in the state of external devices, enabling the CPU to handle tasks.

06

On-Chip Resources (Peripherals) of STM32F1

DMA (Direct Memory Access)

It is a data transfer engine that helps the CPU complete the complex task of transferring large amounts of data, reducing the CPU’s burden.

07

On-Chip Resources (Peripherals) of STM32F1

ADC (Analog-to-Digital Converter)

It has a built-in 12-bit ADC, allowing direct reading of the analog voltage values at the IO ports without needing an external AD chip, which is very convenient.

DAC (Digital-to-Analog Converter)

It can directly output analog voltage at the IO ports, which is the inverse of ADC.

08

On-Chip Resources (Peripherals) of STM32F1

Serial Communication Interfaces:

USART/UART (Synchronous/Asynchronous Serial Port)

Asynchronous serial ports are used more frequently.

I2C (Inter-Integrated Circuit),SPI (Serial Peripheral Interface)

Both are commonly used communication protocols.

USB (Universal Serial Bus)

Can be used for USB communication devices and peripheral data storage.

09

On-Chip Resources (Peripherals) of STM32F1

RTC (Real-Time Clock)

Completes the timing of year, month, day, hour, minute, and second.

10

On-Chip Resources (Peripherals) of STM32F1

Watchdog:

IWDG (Independent Watchdog),WWDG (Window Watchdog)

When the microcontroller crashes due to electromagnetic interference or enters an infinite loop due to unreasonable programming, the watchdog resets the chip in time to ensure system stability.

11

On-Chip Resources (Peripherals) of STM32F1

Security Peripherals:

CRC (Cyclic Redundancy Check)

Used for data integrity verification.

12

On-Chip Resources (Peripherals) of STM32F1

Storage Interfaces:

SDIO (SD Card Interface)

Used for directly connecting SD/MMC cards.

FSMC (Flexible Static Memory Controller)

Supports NOR FLASH, SRAM, and LCD control.

12

On-Chip Resources (Peripherals) of STM32F1

Others:

PWR (Power Control)

Allows the chip to enter sleep mode and other states to save power.

BKP (Backup Register)

Can retain data with a backup battery when the system loses power, enabling some special functions.

USBOT (USB Host Interface)

With OTG functionality, STM32 can act as a USB host to read other USB devices.

Above is a brief introduction to the peripherals of the STM32F1 series. In the next issue, we will introduce the system architecture and pin configuration of STM32F1, to understand how it works and how various departments collaborate. Stay tuned.

END

Reference: Bilibili Jiangxie Technology

[STM32 Beginner’s Tutorial – 2023 Edition Detailed Explanation with Chinese Subtitles] https://www.bilibili.com/video/BV1th411z7sn/?p=3&share_source=copy_web&vd_source=923f4c2d6ee931454ee6d14afc021bcc

The statements and views expressed in all original and reprinted articles are neutral. The articles are provided for readers’ learning and communication purposes only. The copyright of the articles, images, etc. belongs to the original authors. If there is any infringement, please contact us for deletion.

Leave a Comment