Waveform Generation
Waveform Generation
AIM:
ALGORITHM:
Square wave:
1) Load the TMOD register with 10H
2) Load the TL0 register with CBH
3) And TH0 with 07DH
4) Set the TR0 bit
5) Check for the overflow Flag
6) If , clear TR0 and TF0
7) Complement P0.0
8) Repeat the steps 5 to 7.
STEP WAVE:
1. Load p0 with 00h
2. Delay for sometimes
3. Again load p0 on 55H
4. Delay for sometimes.
5. Load p0 with abh
6. Delay for sometimes
7. Again load p0 on ffH
8. Delay for sometimes.
9. Load p0 with abh
10.Delay for sometimes
11.Again load p0 on 55H
12.Delay for sometimes.
13.Repeat the steps 1 to 13.
CODE:
L2:mov r0,#10
mov tmod,#10h
L1:mov tl1,#0cbh
mov th1,#07dh
setb tr1
L:jnb tf1,L
clr tr1
clr tf1
djnz r0,L1
cpl p0.0
sjmp L2
end
L:
mov p0,#00h
acall delay
mov p0,#055h
acall delay
mov p0,#0abh
acall delay
mov p0,#0ffh
acall delay
mov p0,#0abh
acall delay
mov p0,#055h
acall delay
sjmp L
delay:
mov r1,#0ffh
L1:djnz r1,L1
ret
end
OUTPUT:
VERIFICATION:
RESULT:
Square wave and step wave generate and verified.
INFERENCE:
I understood how to generate the waveform of square and step wave.