Tuesday, 22 November 2016

Blinking LEDs with AT89S52 in ASSEMBLY_ Best Embedded Tutorial

Here is the ASSEMBLY CODE for blinking LEDs for INFINITE TIMES. 
8 LEDs are connected with PORT2
____________________________________________________________

CONTINUE:
MOV P2,#0FFH   //TO TURN ON ALL THE LEDS
ACALL DELAY   //ADDING DELAY FOR SOMETIME
MOV P2,#00H    //TO TURN OFF ALL THE LEDS
ACALL DELAY   //ADDING DELAY FOR SOMETIME
SJMP CONTINUE   //FORMING INFINITE LOOP

DELAY:                            //PROGRAM FOR DELAY
MOV R0,#10
MOV R1,#10
MOV R2,#10
LOOP1:DJNZ R2,LOOP1
             DJNZ R1,LOOP1
             DJNZ R0,LOOP1
RET                                       //RETURN DIRECTIVE
END                                        //END DIRECTIVE

_______________________________________________________________
Here is the O/P of this Program


No comments:

Post a Comment