Embedded technology is one of the key core technologies of the entire IoT system. It is equivalent to the brain of the perception layer, which unifies the sensor part of the perception layer to achieve specific functions and is the underlying basic part of the entire Internet of Things.
The core part of embedded development is chip development. At present, embedded development mainly includes a single-chip microcomputer, embedded Linux, and so on. Among them, single-chip microcomputers occupy more than half of the Internet of Things industry due to their powerful functions and high-cost performance.
ⅠWhat is MCU? |
Ⅱ STM32F407G Microcontroller Bus Architecture |
Ⅲ STM32F407 GPIO-Explained |
Ⅳ How does GPIO work in LED circuits? |
ⅤWhy Use STM32F407 |
Single-chip microcomputer, also known as a single-chip microcontroller, is not a chip that completes a certain logic function but integrates a computer system into a chip. It is equivalent to a microcomputer. Compared with computers, single-chip microcomputers only lack I/O devices. In a nutshell: a chip becomes a computer. Its small size, lightweight and cheap price provide convenient conditions for learning, application, and development.
This article selects the STM32F407 series chips launched by ST (Standard Semiconductor). It ST (STMicroelectronics) launched a high-performance microcontroller based on the ARM Cortex™-M4 core, which uses a 90-nanometer NVM process and ART (Adaptive Real-Time Memory Accelerator™).
According to relevant market statistics, the shipment of STM32 series chips in 2017 was 1 billion. As one of the world's largest semiconductor companies, ST has a wide range of product lines, including sensors, power devices, automotive products, and embedded processor solutions, and plays an important role in the IoT ecosystem. Among them, MCU is one of the most important businesses. According to official data, in 2017, ST occupied about 19% of the general microcontroller market. The company has more than 800 STM32 products and more than 50,000 customers.
Figure1-STM32F407
Figure2-STM32F407G Microcontroller Bus Architecture
The main system consists of a 32-bit multilayer AHB bus matrix. The bus matrix is used for access arbitration management between master buses. Arbitration adopts a round-robin scheduling algorithm. The bus matrix can realize the following partial interconnection:
The eight master buses are:
Seven controlled buses:
Let's explain in detail the knowledge of several buses in the figure.
STM32F407 has 7 groups of IO. They are GPIOA~GPIOG respectively, each group of IO has 16 IO ports, a total of 112 IO ports are usually called PAx, PBx, PCx, PDx, PEx, PFx, PGx, where x is 0-15.
STM32F4 has many built-in peripherals, and the external pins of these peripherals are shared with GPIO. That is to say, a pin can have many functions, but it is an IO port by default. If you want to use a GPIO built-in peripheral function pin, you need GPIO multiplexing. When this GPIO is used as a built-in peripheral, It's called reuse. For example, a serial port is a GPIO multiplexed as a serial port.
GPIO_Mode_IN_FLOATING Floating input
GPIO_Mode_IPU pull-up input
GPIO_Mode_IPD pull-down input
GPIO_Mode_AIN Analog input
GPIO_Mode_Out_OD Open-drain output (with pull-up or pull-down)
GPIO_Mode_AF_OD multiplexed open-drain output (with pull-up or pull-down)
GPIO_Mode_Out_PP push-pull output (with pull-up or pull-down)
GPIO_Mode_AF_PP multiplexed push-pull output (with pull-up or pull-down)
2MHZ (low speed)
25MHZ (medium speed)
50MHZ (fast)
100MHZ (high speed)
STM32 standard peripheral library
The STM32 standard peripheral library is a firmware function package consisting of programs, data structures, and macros, including the performance characteristics of all microcontroller peripherals. The library also includes driver descriptions and application examples for each peripheral, providing an intermediate API for developers to access the underlying hardware.
Using the firmware function library, developers can easily apply each peripheral without deep knowledge of the underlying hardware details.
Therefore, using the solid-state function library can greatly reduce the time for developers to develop and use on-chip peripherals, thereby reducing development costs. Each peripheral driver consists of a set of functions that cover all the functionality of the peripheral. At the same time, the STM32 official also gave a large number of sample codes for learning.
In embedded systems, it is often necessary to control many external devices or circuits with simple structures. Some of these devices must be controlled by the CPU, and some require the CPU to provide input signals. It is more complicated to use the traditional serial port or parallel port to control the device. Therefore, a "general-purpose programmable I/O port", that is, GPIO, is usually provided on the embedded microprocessor.
LED hardware schematic diagram
This circuit will realize the operation of the GPIO port of STM32F407 by operating the LED on and off. Look at the hardware schematic diagram related to the development board LED
Figure4-LED schematic diagram
According to the schematic diagram and the characteristics of the LED lights, we know that when the LED0, LED1, and LED2 pins output low levels, the three LED lights will glow. Conversely, when the output is high, the three LED lights will go out.
The LED0, LED1, and LED2 pins correspond to GPIOE_3, GPIOE_4, and GPIOG_9 on the STM32F407 chip, respectively. Therefore, the on-off operation of the LED can be converted into the pin output operation of the STM32F407.
(1) High-cost performance.
The purchase price of a single STM32F407VET6 model is about 13 yuan, and the batch price will be lower.
(2) The market is large and there are many development materials
As the most popular chip in the world, most companies in the market currently develop based on the STM32 series of chips, and corporate recruitment requires STM32. At the same time, there are many mature solutions and related forums on the Internet.
(3) Powerful performance
The STM32F407 offers the performance of a Cortex™-M4 core (with a floating point unit) operating at 168 MHz. When executing from Flash memory, STM32F407/417 can provide 210 DMIPS/566 CoreMark performance, and utilize STMicroelectronics' ART accelerator to realize a FLASH zero wait state. DSP instructions and floating-point units expand the application range of the product.
(4) Abundant peripheral resources
2 x USB OTG (one of which supports HS)
Audio: Dedicated audio PLL and 2 full-duplex I²S
Up to 15 communication interfaces (including 6 USARTs up to 11.25 Mb/s, 3 SPIs up to 45 Mb/s, 3 I²C, 2 CAN, and 1 SDIO)
Analog: 2 12-bit DACs, 3 12-bit ADCs at 2.4 MSPS or 7.2 MSPS (interleaved mode)
Up to 17 timers: 16 and 32-bit timers up to 168 MHz
Easily expand memory capacity with flexible static memory controller supporting Compact Flash, SRAM, PSRAM, NOR, and NAND memory
True Random Number Generator Based on Analog Electronics Technology
The RFB-0505S is a DC-DC converter from RECOM Power, Inc., belonging to the RFB Series. It features a Single In-Line Package (SIP7) and provides a single unregulated output. This converter offers 1 watt of power with an output voltage of 5V and is rated for an isolation voltage of 1kV.
Read More >In the world of electronics, ensuring efficient power management is crucial for the performance and reliability of devices. One of the key components in achieving this is the DC-DC converter. Today, we dive into the specifics of the RFMM-0505S DC-DC converter, exploring its features, applications, and benefits.
Read More >A DC-DC converter is an essential electronic device to convert a direct current (DC) source from one voltage level to another. These converters are widely employed in various applications, including portable electronic devices, automotive systems, and renewable energy installations.
Read More >The LM3900 consists of four independent dual-input internally compensated amplifiers. These amplifiers are specifically designed to operate on a single power supply voltage and provide a large output voltage swing. They utilize current mirrors to achieve in-phase input functionality. Applications include AC amplifiers, RC active filters, low-frequency triangle waves, square wave, and pulse waveform generation circuits, tachometers, and low-speed, high-voltage digital logic gates.
Read More >The goal of the Taiwan Semiconductor MMBT3906 PNP Bipolar Transistor is to provide a high surge current capability with minimal power loss. This transistor is perfect for automated installation and has high efficiency.
Read More >