Key doorbell program
;***** By pressing the 3rd button of the 1*4 button, you can hear the doorbell sound
T5 Hz EQU 30H
T7HZ EQU 31H
T05SA EQU 32H
T05SB EQU 33H
FLAG BIT 00H
STOP BIT 01H
SP1 BIT P1.0
ORG 0000H
LJMP START
ORG 000BH
LJMP INT_T0
START: MOV TMOD,#02H
MOV TH0,#06H
MOV TL0,#06H
SETB ET0
SETB EA
NSP: JB SP1,NSP
LCALL DELY10MS
JB SP1,NSP
SETB TR0
MOV T5HZ,#00H
MOV T7HZ,#00H
MOV T05SA,#00H
MOV T05SB,#00H
CLR FLAG
CLR STOP
JNB STOP,$
LJMP NSP
DELY10MS: MOV R6,#20
D1: MOV R7,#248
DJNZ R7,$
DJNZ R6,D1
RET
INT_T0:INC T05SA
MOV A,T05SA
CJNE A,#100,NEXT
MOV T05SA,#00H
INC T05SB
MOV A,T05SB
CJNE A,#20,NEXT
MOV T05SB,#00H
JB FLAG,STP
CPL FLAG
LJMP NEXT
STP: SETB STOP
CLR TR0
LJMP DONE
NEXT: JB FLAG,S5HZ
INC T7HZ
MOV A,T7HZ
CJNE A,#03H,DONE
MOV T7HZ,#00H
CPL P3.7
LJMP DONE
S5HZ: INC T5HZ
MOV A,T5HZ
CJNE A,#04H,DONE
MOV T5HZ,#00H
CPL P3.7
LJMP DONE
DONE: RETI
END
Previous article:Traffic Light Simulation Experiment Procedure
Next article:Ultrasonic Dispersion Procedure
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
- What information do I need to provide for FCC certification of Bluetooth headsets?
- Recommended solutions to reduce Wi-Fi interference
- The MCU cannot run in DC-DC mode of BLUENRG-1
- micropython update: 2020.7
- Disassembling AirTags: The coil, magnet and diaphragm in the ring-shaped motherboard work together, and the body is the speaker
- Serial communication and LCD display
- Detailed explanation of several triggering modes of oscilloscope
- Update the image
- [Prizes await you every week] Are you a circuit master or a circuit novice?
- MCU low power consumption