Write a program that creates a periodic waveform of 10 KHz a

Write a program that creates a periodic waveform of 10 KHz and duty cycle of 75% on P1.5?

Please use the C Syntax for the 8051 micro controlller only.

Thanks.

Solution

You may follow this procedure.

Frequency you mentioned is 10kHz. That simply indicated the time to be in mseconds
Duty Cycle 75% that\'s 0.75 X the time period.

1) Please arrange a delay of 0.05ms and call this 50 times.

2) Now, make 0.05ms call again for 14 times.

3) Make both the functions inevitable and proceed to the code.

/Assembly language code/
org 11h
begin : seta p1.1
acall delay
.
.

.

to 50 times

clr p1.1

acall delay
.
.

.

to 14 times

sjmp begin
org 30h

delay:
mov tmod,#10h ;timer 2,mode2

back: mov tl2,#0f7h
mov th2, #0ffh
seta tr2
again: jna tf2,again
clr tr2
clr tf2
ret
end

Write a program that creates a periodic waveform of 10 KHz and duty cycle of 75% on P1.5? Please use the C Syntax for the 8051 micro controlller only. Thanks.So

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site