Professional Documents
Culture Documents
Part B 1 Experiments
Part B 1 Experiments
1. (a) Aim: Write an ALP to interface a simple toggle switch to 8051 and write
an ALP to generate an interrupt which switches on an LED continuously as
long as the switch is on.
;------------------Start of Program------------------------
ORG 0H
AJMP MAIN
;------------------Start of ISR FOR INT1-------------------
ORG 0013H
CLR P0.3 ;Switch off the LED
HERE: JNB P3.6, HERE ;Wait for a high signal at switch connected at P3.6
SETB P0.3 ; Switch on the LED
RETI
;------------------Start of Main-----------------------------
ORG 30H
MAIN: MOV P0, #00H
MOV IE, #10000100B ;Configuration of interrupt
WAIT: SJMP WAIT
END
(b) Aim: Interface a simple toggle switch to 8051 and write an ALP to generate an
interrupt which switches on an LED only once for a small time when the switch is
turned on.
; -------------------Start of Program------------------------
ORG 0H
AJMP MAIN