Components (80c51 chip, 8255A chip, 74ls373 latch chip, l298 driver chip, three-phase six-wire stepper motor, several buttons, power supply)
Assembly source program:
ORG 0000H;
LJMP MAIN1;
ORG 0030H; (header file)
MAIN1:MOV DPTR,#0FF7FH; detect PA port status
MOV A,#91H;
MOVX @DPTR,A;
MAIN:MOV DPTR,#0FF7CH;
MOVX A,@DPTR;
CJNE A,#0FFH,L1;
LJMP MAIN;
L1:CJNE A,#0FEH,LOOP2;
LOOP1:MOV DPTR,#0FF7DH;Control the motor to rotate forward
MOV A,#01H;
MOVX @DPTR,A;
LCALL DELAY;
MOV DPTR,#0FF7CH;
MOVX A,@DPTR;
CJNE A,#0FFH,L2;
LJMP MAIN;
L2:CJNE A,#0FEH,LOOP2;
MOV DPTR,#0FF7DH;
MOV A,#02H;
MOVX @DPTR,A;
LCALL DELAY;
MOV DPTR,#0FF7CH;
MOVX A,@DPTR;
CJNE A,#0FFH,L3;
LJMP MAIN;
L3:CJNE A,#0FEH,LOOP2;
MOV DPTR,#0FF7DH;
MOV A,#04H;
MOVX @DPTR,A;
LCALL DELAY;
MOV DPTR,#0FF7CH;
MOVX A,@DPTR;
CJNE A,#0FFH,L4;
LJMP MAIN;
L4:CJNE A,#0FEH,LOOP2;
L8:LJMP LOOP1;
LOOP2:MOV DPTR,#0FF7DH; control the motor to reverse
MOV A,#01H;
MOVX @DPTR,A;
LCALL DELAY;
MOV DPTR,#0FF7CH;
MOVX A,@DPTR;
CJNE A,#0FFH,L5;
LJMP MAIN;
L5:CJNE A,#0FCH,LOOP1;
MOV DPTR,#0FF7DH;
MOV A,#04H;
MOVX @DPTR,A;
LCALL DELAY;
MOV DPTR,#0FF7CH;
MOVX A,@DPTR;
CJNE A,#0FFH,L6;
LJMP MAIN;
L6:CJNE A,#0FCH,LOOP1;
MOV DPTR,#0FF7DH;
MOV A,#02H;
MOVX @DPTR,A;
LCALL DELAY;
MOV DPTR,#0FF7CH;
MOVX A,@DPTR;
CJNE A,#0FFH,L7;
LJMP MAIN;
L7:CJNE A,#0FCH,L8;
LJMP LOOP2;
DELAY:MOV R5,#0H; Delay subroutine
K1:MOV R6,#02H;
K2:MOV R7,#81H;
K3:NOP;
DJNZ R7,K3;
DJNZ R6,K2;
DJNZ R5,K1;
RET;
END;
Previous article:Smart car production - remote control car (assembly version)
Next article:51 single-chip programmable chip 8255 LED light control
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
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
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- How haptic technology can enhance driving safety
- Let’s talk about the “Three Musketeers” of radar in autonomous driving
- Why software-defined vehicles transform cars from tools into living spaces
- R16-Startup Manual
- Header files in C language
- [RVB2601 Creative Application Development] 1. Unboxing
- Can't find the target microcontroller, please give me some advice, thank you
- dsp 28335 ConfigCpuTimer() detailed introduction
- TMS320C6678 ZYNQ Development Manual camera_edge_display video case
- How to Become a Qualified Electronic Engineer
- [Project Source Code] Six Golden Rules for Naming Verilog Code Based on FPGA
- Display bit variable icon--LCD display
- EEWORLD University Hall--Keysight World 2019 Automotive Forum Review