Program for generation of Rectangle wave form
Following are the steps for generating rectangle wave form...
- Make accumulator as 00H
- Load accumulator to port 1
- now call delay subroutine
- Make accumulator to FFH
- again load accumulator to port 1
- again call delay subroutine
Program :
org 2050H
back : clr a ;
mov p1,a ;
lcall delay;
mov a, #FFh;
mov p1, a ;
lcall delay1 ;
sjmp back ;
end
delay : mov r2, #200H ;
l1: nop ;
nop ;
nop ;
nop ;
nop ;
djnz r2, l1 ;
delay1 : mov r1, #50H ;
l2: nop ;
nop ;
nop ;
nop ;
nop ;
djnz r2, l2 ;
No comments:
Post a Comment