Program for generation of Square wave..
Following are the steps involved in generating Square wave using keil software
- Make ACCwith =00H
- Load ACC to port1 ( select any port in available)
- Call delay subroutine
- Make ACC with = FFH
- Load ACC to port1
- Call delay subroutine
- then repeat from first step again
Program:
org 2050H
back: cla a ; acc loading with 00
move p1,a ; moving 00 into port1
lcall delay ; going to delay subroutine
move a.#FFh ; acc loading with FF
move p1,a ; moving acc into port1
lcall delay ; going to delay subroutine
sjmp back ; repeating steps again
end ;
Delay: move r1, #100h ;
l1 : nop ; no operation
nop ; no operation
nop ;no operation
nop ;no operation
nop ;no operation
djnz r1, l1 ; decreament jump if not equal to zero
ret ; returning
No comments:
Post a Comment