stm32

STM32 learning – introductory small project

Blog address: STM32 Learning – Getting Started Small Project – Infinite’s Blog This small project comes from the STM32 ~introductory~ (advanced) task sent by the teacher when participating in the electrical design. The specific requirements are as follows: software design requirements Write a simple I/O program, you can use the 4 basic buttons on the …

STM32 learning – introductory small project Read More »

STM32 44 matrix keys

This article describes how to use STM32 to write a 4*4 [matrix] key program. First, a brief introduction to the basic methods of scanning: 1. Inversion method 2. Row and column scanning. This article mainly introduces row and column scanning Welcome to the [embedded] learning group: 559601187 (1) The code is as follows /********************************************************************* *PA8-PA11,PB12-PB15 …

STM32 44 matrix keys Read More »

STM32CubeMX series tutorial 8 configuration project template (serial port + variable length data transceiver + DMA + IDLE interrupt + soft interrupt)

Article directory Summary Generate project Configure peripherals 1. Configure the clock and Debug 2. Configure serial port and DMA 3. Configure timers and interrupts Configure the clock tree Configure project settings Click GENERATE CODE to generate the project Modify the source code Configure softirq Configure serial port declare variable redirect printf Implement IDLE interrupt handling …

STM32CubeMX series tutorial 8 configuration project template (serial port + variable length data transceiver + DMA + IDLE interrupt + soft interrupt) Read More »

STM32CubeMX series tutorial 6 external interrupt EXTI and soft interrupt SWI

Article directory Summary interrupt controller register interrupt mask register event mask register Software Interrupt Event Register pending register External interrupt configuration Software interrupt configuration configuration process Create project Enable software interrupts Create interrupt callback function start soft interrupt Compile and download Summary [There are generally more than 20 external interrupts]   in STM32 , of which …

STM32CubeMX series tutorial 6 external interrupt EXTI and soft interrupt SWI Read More »

STM32CubeMX Series Tutorial 4 Basic Serial Communication

Article directory Summary configuration project Serial polling mode to send Enable serial communication write user code Compile and download Interrupt sending and receiving Start serial port interrupt write user code Write interrupt callback function Compile and download Serial port related functions Summary This chapter explains the use of serial communication of STM32 [microcontroller] , mainly …

STM32CubeMX Series Tutorial 4 Basic Serial Communication Read More »

STM32+CUBEMX hell trip (1) – use the USB analog serial port to complete the transceiver! Prenatal education level tutorial!

words written in front Unconsciously, I have been tinkering with this CUBEMX for almost two weeks. During this period, I have searched a lot of tutorials on the Internet, and I have been instructed by many big guys. I finally adjusted my hardware I2C+USB analog [serial port] to send and receive sensor data. thing. To …

STM32+CUBEMX hell trip (1) – use the USB analog serial port to complete the transceiver! Prenatal education level tutorial! Read More »

printf function encapsulation

1 Introduction When there are many debug logs and simple management of the debug logs is required, the printf function needs to be encapsulated. The following describes how to use [a custom function] to print LOG. 2. Code implementation #include <stdarg.h> #define DEBUG_OUT void printf_log(const char* fmt, …); /******************************************************************************* *Function name: printf_log *Function description: print …

printf function encapsulation Read More »

Number and expression conversion when STM32CubeMX tool configures SPI’s CRC

When doing SPI configuration, the tutorial instructs to configure 7 as follows: static void MX_SPI2_Init(void) { /* USER CODE BEGIN SPI2_Init 0 */ /* USER CODE END SPI2_Init 0 */ /* USER CODE BEGIN SPI2_Init 1 */ /* USER CODE END SPI2_Init 1 */ /* SPI2 parameter configuration*/ hspi2.Instance = SPI2; hspi2.Init.Mode = SPI_MODE_MASTER; hspi2.Init.Direction …

Number and expression conversion when STM32CubeMX tool configures SPI’s CRC Read More »