What are the problems with the study these days? When I started to look at the first few routines, I seemed to find some feelings and learned some things, such as how to calculate the baud rate that the serial port needs to configure, how to implement the addressing operation of a single bit of the I/O port through the design of the bit band alias area, how to set the port mode, and the respective advantages and disadvantages of spi and iic. I read so much last week, and now I think that these are the only ones left. Then this week, the feeling of this week is even less solid. Many things are just a cursory glance and forgotten after reading, such as interrupt control. It was not until the second time that the framework was formed, the various experiments of watchdog DMA game controller infrared communication, well, I only know what these things are, and my understanding of them is not even as good as the modules of last week. At least there is a framework. At this point, there is only "Oh, this, I know..." and that's it, right! That's it. So the next step is to modify the program, no matter what program you modify, of course it is best to modify the program of the three-axis accelerometer directly, modify it casually, and you can see the effect on the board after the modification. Do this kind of thing. If there is nothing to modify in this module, modify something else. Anyway, you have to start modifying it. You can't just look at it like this. Okay, let's try it tomorrow.
Keywords:stm32
Reference address:stm32 study notes--serial port baud rate
Below I will organize what I can still remember.
1. How is the baud rate of the serial port configured?
Each serial port of STM32 has an independent baud rate register USSART-BRR. By setting this register, you can achieve the purpose of configuring different baud rates. Of course, the key is how much the baud rate should be set. Because first of all, we should know why we need to configure the baud rate. The following is the answer found by Baidu
The baud rate of microcontroller serial communication is the interval between two data transmissions, or the number of bytes sent per second. When you are performing serial communication, two microcontrollers must communicate, so they must be synchronized (the baud rate must be the same), otherwise the communication cannot be established.
That is to say, the baud rate cannot be set arbitrarily, and needs to be coordinated with the chip. After we know the baud rate, we need to express it in a register, which involves the calculation mentioned at the beginning. The lowest four bits of USART-BRR are used to store the decimal part, the next 12 bits are used to store the integer part, and the highest 16 bits are not used. The calculation formula is as follows
USARTDIV = PCLK2 / (serial port baud rate * 16). In this way, the value of USARTDIV can be calculated, and then converted into binary and put into the register to complete the setting of the serial port baud rate.
Previous article:stm32 study notes--spi and iic
Next article:STM32 low power design experience
Recommended ReadingLatest update time:2024-11-16 21:32
STM32 SysTick routine
#include "stm32f10x.h" /*RCC clock configuration*/ void RCC_config() { ErrorStatus HSEStartUpStatus; /* RCC registers are set to default configuration */ RCC_DeInit(); /* Turn on external high speed clock */ RCC_HSEConfig(RCC_HSE_ON); /* Wait for the external high-speed clock to stabilize*/ HSEStartUpStat
[Microcontroller]
How to confirm whether the STM32 clock configuration is correct
Configure STM32F103 clock (HSI) to 48M void SystemClock_Config(void) { RCC_DeInit(); RCC_HSICmd(ENABLE); while(RCC_GetFlagStatus(RCC_FLAG_HSIRDY) == RESET); RCC_HCLKConfig(RCC_SYSCLK_Div1); RCC_PCLK1Config(RCC_HCLK_Div2); RCC_PCLK2Config(RCC_HCLK_Div1); RCC_PLLConfig(RCC_PLLS
[Microcontroller]
Another entry-level embedded development platform! Mir STM32MP135 core board new product release
Another entry-level embedded development platform! Mir STM32MP135 core board new product release
Since STMicroelectronics (ST) launched the first STM32 Cortex-M core MCU in 2007, ST has been developing rapidly in the field of MCU for more than a decade. In 2019, ST released the new STM32MPU series pro
[Embedded]
Understanding the startup code of the medium-capacity STM32 processor
Today I want to introduce the startup code of STM32. I am using the medium-capacity STM32f103c8t6 here. The corresponding startup file is startup_stm32f10x_md.s. My startup file version is V3.6.2 Without further ado, here are the source codes I annotated: /** ***************************************************
[Microcontroller]
STM32--UART asynchronous communication learning
Description of the character transmission process: In the UART transmission process, the data is first input into the transmission data register (TDR). At this time, (TXE) is set to 1 by hardware. Then the TDR register serially shifts the data into the transmission shift register and transmits the data at the TX port.
[Microcontroller]
STM32 BOOT0, BOOT1 configuration
STM32 has three boot modes: main memory, system memory and internal SRAM. You can find them in the user manual of the chip. Regarding these three startup modes, they are as follows: BOOT1=x, BOOT0=0: boot from main memory, which is the on-chip Flash memory of 64K, 128K, 256K, 512K, etc. Under normal circumstances, w
[Microcontroller]
stm32 i2c communication [operation register + library function]
The I2C bus was designed by NXP (formerly PHILIPS) and has a very concise physical layer definition. Its characteristics are as follows: Only two bus lines are required: a serial data line SDA and a serial clock line SCL; Each device connected to the bus can be software-addressed by a unique address and a simple mas
[Microcontroller]
A technical expert made his own STM32 development board to learn 32-bit microcontrollers (pictures and text)
The lab is about to close, so I made the STM32 development board I always wanted to make, and also made the 2.4-inch TFT adapter board and added a touch screen. I uploaded my information here. I hope it will be helpful to netizens.
I always put practicality first, and this time is no exception. The development
[Microcontroller]
- Popular Resources
- Popular amplifiers
Recommended Content
Latest Microcontroller Articles
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
MoreDaily News
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
Guess you like
- Check it out: Things that ST New Chinese official forum doesn’t want to tell netizens
- HyperLynx High-Speed Circuit Design and Simulation (IV) Transmission Line Crosstalk
- What are the advantages of electronic shelf labels with Bluetooth 5.0 technology?
- DSP-F28335 System Resources
- msp430f5529 interrupt notes
- Detailed explanation of multi-layer PCB stacking structure
- Looking for part-time engineers to cooperate
- Modern Communication Technology (4th Edition)
- Are there other ways to reduce heat and power consumption of MOS besides parallel connection? The current cannot be changed. Although the internal resistance can be...
- TI will broadcast [CAN SIC (Signal Improvement Function)] live at 10 am today. Learn the technology and win gifts!