Let me first talk about frequency capture in general. According to my personal understanding, frequency capture uses a counter. When a timer interrupt occurs (it should be when the Autoreload register in the figure below is full), two values are recorded in two adjacent timer interrupts. The difference between the captured signals is calculated. The final frequency is your timer clock divided by your captured value.
Of course, if you directly call the function in the PWM_Input routine in the official 3.5 library to capture directly, you will find that the measured value will be very inaccurate below about 980Hz (under STM32F103RBT6). At this time, you need to use TIM_TimeBaseInit() to configure the pre-scaling parameters in PSC and ARR. The following figure is attached
Two pictures after the Prescaler changes
ARR determines the value of the Autoreload register. The two pictures above show that after changing PSC, the timer clock line will slow down, which means that more signals can be detected after one cycle, and the frequency that can be measured will be lower.
Previous article:Capturing PWM pulse width using STC14F104W microcontroller
Next article:stm32 timer input capture pwm
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- 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
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Can CycloneIII FPGA lock JTAG?
- "Playing with the board" + Yu Zhennan's STM32 development board experiment 3
- 【NUCLEO-L552ZE Review】2. Resources
- A complete list of domestic substitution for the entire semiconductor industry chain
- EP3C25Q240C8N
- Small but powerful
- Exclusive teardown | Innovative application of voice control on true wireless stereo TWS headphones
- DIY Indoor Air Quality Monitor
- Infrared receiving circuit and waveform decoding
- Please tell me, what is the problem of no response for a long time during burning?