0% found this document useful (0 votes)
89 views5 pages

External Interrupt Stepper Motor PDF

The document describes three experiments involving microcontroller programming: 1. An ALP was developed to accept external interrupts and toggle an LED accordingly. 2. An ALP was created to accept timer interrupts and toggle an LED when the timer generates an interrupt, while continuously printing "C" to an LCD. 3. An ALP was made to interface with a stepper motor, rotating it anticlockwise by shifting the motor control bits left on each loop iteration.

Uploaded by

Jashwanth sai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views5 pages

External Interrupt Stepper Motor PDF

The document describes three experiments involving microcontroller programming: 1. An ALP was developed to accept external interrupts and toggle an LED accordingly. 2. An ALP was created to accept timer interrupts and toggle an LED when the timer generates an interrupt, while continuously printing "C" to an LCD. 3. An ALP was made to interface with a stepper motor, rotating it anticlockwise by shifting the motor control bits left on each loop iteration.

Uploaded by

Jashwanth sai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

EXPERIMENT NO.

5:
AIM: To Develop an ALP to accept the external interrupt and to toggle the LED
SOFTWARE USED: MCU8051
PROGRAM:
ORG 0000H
LJMP MAIN
ORG 0003H
CPL P1.0
acall delay
acall delay
acall delay
acall delay
acall delay
RETI
ORG 0013H
CPL P1.1
acall delay
acall delay
acall delay
acall delay
acall delay
RETI
MAIN:
MOV IE,#85H
again:
mov p2,#00h
mov a,#01h
mov p2,a
acall delay
acall delay 21
acall delay
mov a,#03h
mov p2,a
acall delay
acall delay
acall delay
mov a,#07h
mov p2,a
acall delay
acall delay
acall delay
mov a,#0fh
mov p2,a
acall delay
acall delay
acall delay
SJMP again
delay:

Page | 17
mov r0,#0ffh
here1: mov r1,#0ffh
here: djnz r1,here
djnz r0,here1
ret
END

RESULT: An ALP is developed to accept the external interrupt and accordingly the LED’s were made to
toggle.

Page | 18
EXPERIMENT NO.6:
AIM: To Develop an ALP to accept the timers interrupt and to toggle the LED when timer generates
Interrupt.
SOFTWARE USED: MCU8051
PROGRAM:
ORG 00H
SJMP START
ORG 000BH
CPL P1.1
RETI
ORG 30H
START:
MOV A,#38H
ACALL CMD
MOV A,#06H
ACALL CMD
MOV A,#01H
ACALL CMD
MOV A,#0EH
ACALL CMD
MOV A,#80H
ACALL CMD
MOV TMOD, #02H
MOV TH0, #44H
SETB TR0
MOV IE,#82H
back:
MOV A, #'C'
ACALL DAT
ACALL DELAY
ACALL DELAY
ACALL DELAY
SJMP back
CMD: MOV P0, A
CLR P2.0
CLR P2.1
SETB P2.2
ACALL DELAY
CLR P2.2
RET
DAT:MOV P0,A
SETB P2.0
CLR P2.1
SETB P2.2
ACALL DELAY
CLR P2.2
RET
DELAY: MOV R3,#0FEH

Page | 19
LOOP2: MOV R4,#0C3H
LOOP1: DJNZ R4,LOOP1
DJNZ R3,LOOP2
RET
END

RESULT:PERFORMED TIMER INTERRUPT CONCEPT, LETTER ‘C’ CONTINUOUSLY PRINTING ON LCD,


WHEN TIMER INTERRUPT IS GENERATED LED IS GLOWING

Page | 20
EXPERIMENT NO.8:
AIM: To Develop an ALP to interface to STEPPER MOTOR:
SOFTWARE USED: MCU8051

PROGRAM:
ORG 0H
MOV A,#00110011B
LOOP1: MOV P2,A
ACALL DELAY
RL A;RR A ROTATE LEFT OR ROTATE RIGHT
SJMP LOOP1
DELAY: MOV R7,#0FFH
HERE2: MOV R6,#0FFH
HERE1: DJNZ R6,HERE1
DJNZ R7,HERE2
RET
END
OUTPUT:

RESULT: PERFORMED THE MOVEMENT OF STEPPER MOTOR IN ANTICLOCKWISE


DIRECTION.

Page | 21

You might also like