Stepper Motor Control 8255A

Publisher:BlissfulWhisperLatest update time:2015-09-28 Source: eefocusKeywords:8255A Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Circuit connection (as shown in Figure 1):

Components (80c51 chip, 8255A chip, 74ls373 latch chip, l298 driver chip, three-phase six-wire stepper motor, several buttons, power supply)

Figure 1

 

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;

Keywords:8255A Reference address:Stepper Motor Control 8255A

Previous article:Smart car production - remote control car (assembly version)
Next article:51 single-chip programmable chip 8255 LED light control

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号