Professional Documents
Culture Documents
MICROCONTROLLER ENGINEERING
1. The purpose of this lecture is to understand the STM32F429 chip and Nucleo-F429ZI reference board.
2. We will be used the Nucleo-F429ZI and the STM32CubeIDE design tool for beginners to
microcontrollers so that they can design independently in the practical field.
3. We will be coded by hand so that HAL library functions and code usage are familiar in all example
codes.
Notice
1. All examples will be developed in STM32CubeIDE instead of TrueStude of your textbook because only
STM32CubeIDE (2019. 4 Release) will be supported in the future.
2. Some incorrect expressions in the textbook will be corrected in the lecture. ( lsh4185@du.ac.kr )
3. All the examples in Chapters 6 and 7 will be practiced as examples of presentation materials.
4. Also, this lecture is for level 2-3 out of level 5. If you take this lecture, you will be able to
independently design an application system using the latest STM32F429 microcontroller in practice.
NovemberDay-10
9, 2021 Application Programming Class-2: Light_Sensor, Water Sensor p.195, p.201
-3-
Class-3: UART, Summary p.241
DAY-1 : Nucleo-F429ZI B/D & Development Environment
Learning Object
•Cortex
- Since CorTex developed the first ARM1 processor in 1985 by ARM, Cotrex was the first to
use the name Cortex for a processor with an ARMv7 architecture core.
•STM32F429ZI
- 32-bit MCU developed by STMicroelectronics, based on Cortex-M
- Arm® 32-bit Cortex®-M4 CPU with FPU
•STM32CubeIDE
- STM32CubeIDE is an all-in-one multi-OS development tool, which is part of the STM32Cube
software ecosystem.
- STM32CubeIDE is an advanced C/C++ development platform with peripheral configuration,
code generation, code compilation, and debug features for STM32 microcontrollers and
microprocessors.
- It is based on the Eclipse®/CDT framework and GCC toolchain for the development, and GDB
for the debugging. It allows the integration of the hundreds of existing plugins that
complete the features of the Eclipse® IDE.
•Mbed
- It is a platform developed under the leadership of ARM in order to make the development
of the ARM Cortex-M processor more convenient and easy.
ARM : Advanced RISC Machines
CPU : Central Processing Unit
MCU : Microcontroller Unit
FPU : Floating-Point Unit
CDT : C/C++ Development Toolkit
GCC : GNU Compiler Collection
November 9, 2021 GDB : GNU Project debugge -6-
IDE : integrated development environment
Refer p.2-3
1.1 STM32F429ZIT (2 of 8) ART (Adaptive Real-Time) accelerator
•Core: Arm® 32-bit Cortex®-M4 CPU with FPU, Adaptive real-time accelerator (ART Accelerator™) allowing
0-wait state execution from Flash memory, frequency up to 180 MHz, MPU, 225 DMIPS/1.25 DMIPS/MHz
(Dhrystone 2.1), and DSP instructions DMIPS : Dhrystone MIPS (Million Instructions per Second)
•Memories
–Up to 2 MB of Flash memory organized into two banks allowing read-while-write
–Up to 256+4 KB of SRAM including 64-KB of CCM (core coupled memory) data RAM
–Flexible external memory controller with up to 32-bit data bus: SRAM, PSRAM, SDRAM / LPSDR SDRAM,
Compact Flash/NOR/NAND memories
LPSDR SDRAM(Low Power SDR SDRAM)
•LCD-TFT controller with fully programmable resolution (total width up to 4096 pixels, total height up to 2048
lines and pixel clock up to 83 MHz)
•3×12-bit, 2.4 MSPS ADC: up to 24 channels and 7.2 MSPS in triple interleaved mode
Mili-Second Sample Per Second
•General-purpose DMA: 16-stream DMA controller with FIFOs and burst support
•Up to 17 timers: up to twelve 16-bit and two 32- bit timers up to 180 MHz, each with up to 4 IC/OC/PWM or
pulse counter and quadrature (incremental) encoder input
SWD : Serial Wired Debug
•Debug mode JTAG : Joint Test Action Group
•Up to 168 I/O ports with interrupt capability – Up to 164 fast I/Os up to 90 MHz
–Up to 166 5V-tolerant I/Os VBUS : Powered from the bus in USB
System Management Bus (SMBus) ISO7816 : Contact card standard
Power Management Bus (PMBus)
•Up to 21 communication interfaces LIN : Local Interconnect Network
–Up to 3 × I2C interfaces (SMBus/PMBus) – Up to 4 USARTs/4 UARTs (11.25 Mbit/s, ISO7816 interface, LIN,
IrDA, modem control)
–Up to 6 SPIs (45 Mbits/s), 2 with muxed full-duplex I2S for audio class accuracy via internal audio PLL or
external clock
–1 x SAI (serial audio interface)
–2 × CAN (2.0B Active) and SDIO interface
SPI : Serial Peripheral Interface
CAN : Controller Area Network
SDIO : Secure Digital Input/Output
November 9, 2021 -8-
Refer p.2-3
1.1 STM32F429ZIT (4 of 8)
ULPI PHY(Universal Serial Bus Transceiver Macrocell Low-Pin Interface Physical Layer
•Advanced connectivity Device)
–USB 2.0 full-speed device/host/OTG controller with on-chip PHY
–USB 2.0 high-speed/full-speed device/host/OTG controller with dedicated DMA, on-chip full-speed PHY and
ULPI
–10/100 Ethernet MAC with dedicated DMA: supports IEEE 1588v2 hardware, MII/RMII
Ehernet PHY(MAC) Interface type
•8- to 14-bit parallel camera interface up to 54 Mbytes/s -MII (Media Independent Interface)
-RMII (Reduced Media Independent Interface)
-GMII (Gigabit Reduced Media Independent Interface)
•True random number generator
OTG (On The Go) USB
•CRC calculation unit
ULPI PHY(Universal Serial Bus Transceiver Macrocell Low-Pin Interface Physical
Layer Device)
•RTC: subsecond accuracy, hardware calendar
MAC : Media Access Control : 48bit size
•96-bit unique ID CRC : Cyclic Redundancy Code
Chip : STM32F429ZIT6U
B/D : NUCLEO-F429ZI
https://www.st.com/en/microcontrollers-microprocessors/stm32f429zi.htmlRefer
https://www.st.com/en/development-tools/stm32cubeide.html
GPIOA ~ GPIOG, …
ADC, TIMER, …
gpio
• Install STM32CubeMX
MPU STM32CubeIDE • Install TrueSTUDIO Compiler
STM32CubeIDE • Install ST-LINK driver STSW-LINK009
Reference Board
November 9, 2021 -14-
Refer p.5
2.1 NUCLEO-F429ZI Reference Board (1 of 7)
Reference Board
-STM : manufacturer
MPU
-NUCLEO-F429ZI : Reference B/D name
STM32CubeIDE
-STM32CubeIDE : ARM/ST integrated development
environment design tool
• Install STM32CubeMX
STM32CubeIDE • Install TrueSTUDIO Compiler
• Install ST-LINK driver STSW-LINK009
STM32 support)
•3 user LEDs
•LSE (Low Speed External) crystal : 32.768 kHz crystal X3 : NOT USE
X2
oscillator
X4
•Board connectors:
• RMII is a shortened form of the MII interface. -Reduce MII, TXD and RXD are reduced by 2 bits each -
Clock operates up to 50 MHz
November 9, 2021 -19-
Refer p.5
2.1 NUCLEO-F429ZI Reference Board (6 of 7)
NRST : Reset MCU registers. The contents of the flash are not
changed.
ST Zio Connector
Zio Connector
ST Zio Connector
ST Zio Connector
ST Zio Connector
ST Zio Connector
JP5
jump state Explanation
• HCLK : A clock that operates the actual source code as a core clock
•SYSCLK: System Clock. Immediately after Power On Reset, the internal clock is
unconditionally operated first.
• HSE (High Speed External): External high-speed clock that requires a crystal/ceramic
resonator external to the STM32. It can also be used as an external square wave or triangle
wave signal with a duty of 50% or less.
• HSI (High Speed Internal): As an internal high-speed clock, it is a clock operated by the
RC oscillation circuit built in STM32. It has its own calibration function, but an error
occurs due to temperature rise due to the characteristic problem of the RC oscillation
circuit.
• LSE (Low Speed External): A 32.768kHz Crystal / Ceramic resonator is used as an external
low-speed clock, and the purpose is to realize low power and set accurate time (RTC).
• LSI (Low Speed Internal): As an internal low-speed clock, it is used for Independent
Watchdog, AWU (Auto Wakeup) function, and RTC (real-time clock) Clock (It is difficult to
secure accuracy)
• CSS (Clock Security System): When there is a problem with the HSE clock, it generates an
NMI interrupt and changes the clock source to the HSI clock
Clock Tree
X1 : 8MHz
X2 : 32.768KHz
X3 : NC
X4 : 25MHz
Extension B/D
• LEDs for output (LED1 to LED8) : 8
STEP-1
https://www.st.com/en/development-tools/stm32cubeide.html
STEP-2
STEP-3
STEP-4
STEP-5
STEP-6
STEP-7
STEP-8
STEP-9
STEP-10
STEP-11
STEP-1
STEP-2
STEP-3
STEP-4
STEP-5
Next
STEP-6
STEP-7
STEP-8
STEP-9
1. Internet required, if not connected
2. Only RCC & SYS items are set as shown below
STEP-10
1. main.h : no change
2. main.c : change
File / Save
/* Infinite loop */
/* USER CODE BEGIN WHILE */
port Pin no Port operation
while (1) GPIO_EX3_1, refer p.60
{
HAL_GPIO_WritePin (GPIOD, GPIO_PIN_0, GPIO_PIN_SET);
HAL_Delay(1000);
Click and F3
Press Cont+Space
• Reference board: Reference board (a board/device made to verify/use the operation and
function of the chip) IDE (Integrated Development Environments): Integrated development
environment
• Data sheet: Data sheet (a manual that describes the characteristics, performance, function,
and usage/application of the chip) Specification: Specification (clear specification of chip
or device)
• Memory map: Memory map (specifying the areas of memory that the processor can access by
address)
• CPU: Central processing unit (CPU) is the most essential computer control unit that
controls the computer system and executes and processes program operations, or a chip with
its functions embedded CPU, MPU, MCU, microprocessor, microcontroller, embedded processor
2. Briefly explain the characteristics of the expansion board mounted on the STM32F429ZI
board.
6. Explain the input/output timing of the STM32F429ZI chip with reference to the data sheet.
3. The design tool used for programming the NUCLEO-F429ZI board is STM32CubeIDE.
5. Memory map is divided into several areas (GPIO, RAM, Timer, ADC, etc.) used by MCU, and
each has an assigned area address.