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

Source Code: Embedded Systems - IE403 Lab Work

This document contains the source code for Lab #3 of the Embedded Systems - IE403 course. The code is for an LED flashing sequence that alternates between forward and reverse using an 8-bit timer for delays. It is written in assembly language and uses ports P1 and the timer to light an LED in a repeating forward-reverse pattern. The code 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)
6 views

Source Code: Embedded Systems - IE403 Lab Work

This document contains the source code for Lab #3 of the Embedded Systems - IE403 course. The code is for an LED flashing sequence that alternates between forward and reverse using an 8-bit timer for delays. It is written in assembly language and uses ports P1 and the timer to light an LED in a repeating forward-reverse pattern. The code 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 #3

Source Code
;Led Flashing Forward-Reverse Sequence ORG 0000H ;Main routine MOV A,#00000001B REPEAT: ;Forward MOV A,#00000001B MOV R0,#7 F_Loop: RL A MOV P1,A ACALL Delay DJNZ R1,F_Loop ;Reverse MOV A,#10000000B MOV R1,#7 R_Loop: RR A MOV P1,A ACALL Delay DJNZ R1,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 R0,#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 R0,RE_Delay RET END

Group Members:

Ali Asad (1936)

Safdar Abbasi (1926)

You might also like