50ms delay; the program in the general book
Keywords:MCU
Reference address:Assembly delay program for single chip microcomputer
DEL: MOV R7,#200 LO: MOV R6,#123 NOP L1: DJNZ R6,L1 DJNZ R7,L0 RET But this program actually delays 50.001ms, one more machine cycle. In fact, it is impossible to achieve accurate delay with a double loop, so a triple loop must be used. My program; DEL: MOV R5,#29 L0: MOV R7,#22 L1: MOV R6,#6 L2: DJNZ R6,L2 DJNZ R7,L1 DJNZ R5,L0 RETAt this time, the precise delay is 50ms, and the values in the three registers can be changed. What we want to discuss here is why it is not possible, or not easy, to use a double loop to implement some precise delay programs, while a triple loop can generally do so. In mathematics, it is the ergodicity of some function values, which is different from the intermediate value of continuous functions due to their continuity. Are there some values that cannot be implemented by a triple loop? So we start using a quadruple loop? What are the necessary and sufficient conditions?
Previous article:MCU Hardware Experience
Next article:MCU drives 8*8LED dot matrix c program
- 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
- [TI recommended course] #TI? Application of interface chips in automotive products#
- [NXP Rapid IoT Review] + Use of Bluetooth (1 Preliminary Exploration)
- 500 yuan for infrared counting microcontroller
- EE mobile station development board introduction: STM32 Nucleo Pack FOC and 6 step motor control (ST 3-phase motor...
- TI NIR SCAN NANO Consulting
- Why can the serial port receive 9600 but lose bytes at 115200?
- What is the chip with 4BMN silk screen? It has 5 pins.
- Can I ask the experts, can a sine wave be converted into a square wave only by using an adder?
- Next-generation DOCSIS 4.0 products, CATV amplifiers based on gallium nitride (GaN) technology
- ④. Drive five-wire four-phase stepper motor