Code written in C:
delay = 0x64;
while(--delay);
The compiled assembly source code is as follows:
; SOURCE LINE # 62
0010 7F64 MOV R7,#064H ; 2B,2CLK
0012 ?C0006:
; SOURCE LINE # 63
0012 DFFE DJNZ R7,?C0006 ; 2B,2/3CLK
If we use a 24MHZ crystal oscillator, each clock cycle is 41.6ns, then the delay accuracy of the delay statement above
can be 41.6×8/3=111ns, which is accurate enough.
If we want to generate a delay of xns, just substitute the calculation formula:
(x-83.2)/27.7 to get the initial value of delay! !
Previous article:51 MCU precise delay program
Next article:[51 MCU] Delay function calculation problem and how to delay accurately
- Popular Resources
- Popular amplifiers
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- Principles and Applications of Single Chip Microcomputers 3rd Edition (Zhang Yigang)
- Principles and Applications of Single Chip Microcomputers and C51 Programming (3rd Edition) (Xie Weicheng, Yang Jiaguo)
- Signal Integrity and Power Integrity Analysis (Eric Bogatin)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- 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
- Playing with Zynq Serial 19——[ex02] A happy running water lamp based on Zynq PL
- 5G O-RAN All-in-one Small Base Station Hardware White Box Reference Architecture
- [Problem Feedback] Problem with the "SplitContainer" control of Anlu TangDynastyr.
- Flex flexible vibration plate can solve the problem of feeding vulnerable parts
- Basic knowledge of burning program (downloading program)
- This PCB Checklist is circulated on the Internet, if you need it, please collect it
- Smooth configuration of bq4050
- Clock Oscillator Circuit Analysis
- Thonny IDE Portable
- pcb welding video