Write a program in which every 2seconds the LED connected to

Write a program in which every 2-seconds, the LED connected to P2.7 is turned ON and OFF four times, while at the same time the 8051 is getting data from P1 and sending it to P0) continuously. Make sure the ON and OFF states are 50 ms in duration. Assume XTAL= 11.0592 MHz

Solution

if you have any doubts please let me know.. I will help you.. And please comment on answer.. Thank you...

B U J J I s

org 00h

mov p1, #0ffh

mov p0,#00h

mov p2,#00h

mov tmod,#21h

mov th1,#-3

mov scon,#50h

repeat:

cpl p2.7

call delay

mov a,p1

mov sbuf,a

here:

jnb ti,here

clr ti

jmp repeat

delay:

mov r3,14

here1:mov tl0,#00h

mov th0,#00h

setb tr0

here2:jnb tf0,here2

clr tf0

clr tr0

djnz r3,here1

ret

end

Write a program in which every 2-seconds, the LED connected to P2.7 is turned ON and OFF four times, while at the same time the 8051 is getting data from P1 and

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site