0% found this document useful (0 votes)
1 views

Source Code: Embedded Systems - IE403 Lab Work

This document contains the source code for a lab assignment to flash LEDs in a forward-reverse-off sequence using an 8-bit microcontroller. The code uses timers and delay loops to light the LED on port 1 in a forward counting pattern, then reverse counting pattern, before turning off. It is for Lab #5 and was written by group members Ali Asad and Safdar Abbasi.

Uploaded by

Anb Bajwa
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

Source Code: Embedded Systems - IE403 Lab Work

This document contains the source code for a lab assignment to flash LEDs in a forward-reverse-off sequence using an 8-bit microcontroller. The code uses timers and delay loops to light the LED on port 1 in a forward counting pattern, then reverse counting pattern, before turning off. It is for Lab #5 and was written by group members Ali Asad and Safdar Abbasi.

Uploaded by

Anb Bajwa
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Embedded Systems IE403

Lab Work

Lab #5

Source Code
;Led Flashing Retain-Forward-Reverse-Off Sequence ORG 0000H ;Main routine REPEAT: ;Forward MOV

R0,#9

F_LOOP: MOV P1,A ACALL Delay SETB C RLC A DJNZ R0,F_LOOP ;Reverse MOV

R0,#9

R_LOOP: CLR C RRC A MOV P1,A ACALL Delay DJNZ R0,R_LOOP SJMP REPEAT Delay: MOV TMOD,#10H ;Timer-1, mode-1(16-bit) MOV TL1,#0FEH ; load TL1 25ms Delay lower-byte MOV TH1,#0A5H ; load TH1 25ms Delay upper-byte MOV R1,#8 ; 8 x 25ms = 200ms RE_Delay: SETB TR1 ; turn on Timer-1 JNB TF1,$ ; wait for TF1 to roll over CLR TR1 ; turn off Timer-1 CLR TF1 ; clear TF1 DJNZ R1,RE_Delay RET END

Group Members:

Ali Asad (1936)

Safdar Abbasi (1926)

You might also like