Most AVR microcontrollers have PWM hardware. Today, I will explore whether the square wave generated by PWM or precise delay is more accurate. Welcome to discuss.
The editor takes the output of 4KHz square wave as an example
1. The following figure shows the 4K square wave output by the editor using PWM
From the figure, we can see that the frequency of PWM output is 4.03KHz;
2. Below is the output graph of the precise delay (the precise delay used by the editor is the cycles function in intrinsic.h in the IAR compiler)
From the figure we can see that the frequency of the precise delay is 4.01KHz, and it is in a state of jumping to 4KHz
Previous article:ATmega16 fuse settings
Next article:Summary of AVR CSTACK and RSTACK
- 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
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- How haptic technology can enhance driving safety
- Let’s talk about the “Three Musketeers” of radar in autonomous driving
- Why software-defined vehicles transform cars from tools into living spaces
- How Lucid is overtaking Tesla with smaller motors
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Three steps to govern hybrid multicloud environments
- EEWORLD University Hall----Live Replay: Infineon & Intron Explanation- How to Choose a Suitable Automotive MOSFET
- Amway uses LT768 to realize TFT industrial serial port screen solution
- Neopixel Christmas Tree
- Gigabit Network Contactless Connector-SK202 Review Unboxing
- What are the methods of wireless bridge relay transmission?
- Diode selection
- The computer will automatically restart when the LabVIEW program is running
- Master these techniques to easily operate DC-DC circuits!
- TYPEC to HDMI 4K@60HZ docking station CS5265 design reference circuit diagram
- DFT design/digital backend PR/digital backend integration/system software/and other positions, Beijing/Shanghai/Nanjing