COUNT EQU 9217; for a crystal oscillator of 11.0592, 9217 is equivalent to 10ms
LED EQU P1.1
ORG 0000H
MOV R0,#00H
DJNZ R0,$
MOV R1,00H ;When using R1 as the overall count, use
MOV SP,#60H
MOV R1,#00H
//MOV A,TMOD
//ANL A,#11110000B
//CLR ACC.3
//CLR ACC.2
//CLR ACC.1
//SETB ACC.0
//MOV TMOD,A
MOV TMOD,#00000001B ; The above expression can be replaced by this, which is more concise
MOV TH0,#(65536-COUNT)/256
MOV TL0,#255
CLR TF0
SETB TR0
LOOP: JNB TF0,LOOP
;
OVER: CLR TF0
MOV TH0,#(65536-COUNT)/256
MOV TL0,#255
INC R1
MOV A,R1
CJNE R1,#5,NEXT ;If it does not reach 50ms, it will continue to accumulate timing
CPL LED
MOV R1,#00H ;Re-install the initial value
NEXT: AJMP LOOP ;After reaching 50ms, the light will be reversed and the timing will start again
END
Previous article:MCU timer (timer0 working mode 2)
Next article:MCU timer working mode 0 (timer013 bit timer)
- Popular Resources
- Popular amplifiers
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
- 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
- 【Portable Programmable Meter】Hardware is already working
- STM32H7 RAMECC function and application
- The program encountered adb problems
- Happy New Year 2020
- Infineon XMC4700 Relax 5V shield review—by freebsder
- EEWORLD University Hall--Boston robots rebel against humans? It turns out to be a CG spoof
- The live broadcast has ended [ON Semiconductor ultra-low power RSL10 Bluetooth SoC development board detailed explanation]
- 3.3V to 5V pulse level, 200mA drive required, pulse width 1us circuit
- What IC is this???
- With the configuration parameter table, can AT commands be customized?