Tuesday 9 May 2017

Program for generation of Rectangle wave form

Program for generation of Rectangle wave form

Following are the steps for generating rectangle wave form...

  1. Make accumulator as  00H
  2. Load accumulator to port 1
  3. now call delay subroutine 
  4. Make accumulator to FFH
  5. again load accumulator to port 1
  6. again call delay subroutine
And then repeat the steps again


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