The prelude to creating a project is the same as that of C language, so I won’t go into details. One thing you need to note is that it is no longer a .C file, but an .ASM file. . . .
Make P1 port output 0 for 500ms, then output 1 for 500ms, and repeat this cycle.
ORG 00H ; Pseudo instruction
START:
MOV P1,#00H ; assign 0 to P1
CALL DELAY ;Call delay
MOV P1,#0FFH ; assign P1 to 1
CALL DELAY
JMP START ; jump to START
DELAY: MOV R3,#50
D1: MOV R4,#20
D2: MOV R5,#248
DJNZ R5,$
DJNZ R4,D2
DJNZ R3,D1
RIGHT;
END; ; Pseudo instruction
Previous article:Tips for 51 timer configuration PWM
Next article:How to generate 115200 baud rate with 11.0592M crystal oscillator of 89C52 microcontroller
- 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
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- 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)
- [Zero-knowledge ESP8266 Tutorial] Quick Start 11- Tilt switch to control your light
- About the dynamic load response of the switching power supply, the oscillation phenomenon of the D-pole waveform of the MOS, and the delay problem of output voltage switching
- MotionDRV DC servo drive PID parameter tuning
- Which one is better among ceramic antenna, PCB antenna and IPEX antenna?
- Get accurate, fast and stable analog voltage from digital PWM signal
- EEWorld invites you to dismantle (fifth issue) - Gosund CP5 Pro smart power strip dismantling report
- Is the vibration direction and wave propagation direction similar to the rhythm of the Humen Bridge?
- How to get started with Renesas MCU?
- Shanghai ACM32F070 Development Board Review 1. Unboxing
- Strange crash problem of STM32G series timer TIM7!