When debugging the carrier communication system, I encountered such a problem: two devices, A and B, both used timers 2~4 for communication, PCLK1 of device A was configured as HCLK, and PCLK1 of device B was configured as 1/2HCLK. During the communication process, it was found that A and B could communicate occasionally and could not communicate occasionally, showing that the communication was not stable. In theory, it should be completely impossible to communicate. After in-depth research on the data sheet of STM32F101C8T6, I found the problem. The screenshot is as follows:
Figure 2 STM32 clock system
Keywords:STM32
Reference address:STM32 APB1 bus clock configuration problem
Figure 1 STM32 functional block diagram
Figure 2 STM32 clock system
From Figure 1, we can see that the APB1 bus is connected to devices such as TIM2~4, UART2~2...WWD, etc. Then from Figure 2, we can see that only the peripherals directly use the APB1 clock as the actual clock, and TIM2~4 are adjusted according to the APB1 clock. Therefore, when the PCLK1 of device B is configured to 1/2HCLK, APB1 is actually configured to 1/2HCLK. At this time, because the frequency division coefficient of APB1 is not 1, the clock used by TIM2~4 is automatically doubled, and the actual frequency is HCLK. Since the frequency division by 2 and then doubled is theoretically consistent with HCLK, factors such as circuit structure will cause the result to be inconsistent with the direct assignment of HCLK, resulting in unstable communication. Finally, by adjusting the PCLK1 of device A to 1/2HCLK, stable communication can be achieved.
Previous article:stm32 USART_IT_IDLE
Next article:STM32F107 external crystal oscillator 25MHz configured to run at 72MHz
- 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
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
MoreDaily News
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
Guess you like
- The Painful Experience of DSP Connecting to Emulator
- C2000 floating point calculation notes - differences between CPU and CLA and error handling techniques
- When Kicad moves a line individually, the line is actually disconnected when moving. How to solve this problem?
- EEWORLD University ---- Theoretical basis of IoT terminal development
- About the serial port problem of MSP430F5529 microcontroller
- Mercury-containing thermometers will be banned from 2026? What do you think is the best alternative?
- Help: AT32F425 pinout information
- China Mobile launches Super SIM card, enabling one card to travel around the world
- Tips for implementing I2C with MSP
- ARM-based support for advanced video graphics capabilities on MCUs