137k views
5 votes
Write a program to generate a square wave with 80% duty cycle on bit P2.7 Microprocessor.​

1 Answer

5 votes

Answer:

assuming its assembly (otherwise just delete this ans)

Step-by-step explanation:

MOV TMOD , #01 ;

MOV TLO, #00 ;

MOV THO, #DCH

CPL P1.5

ACALL DELAY

SJMP HERE

;generate delay using Timer 0

DELAY:

SETB TR0

AGAIN:

JNB TF0 ,AGAIN

CLR TR0

CLR TF0

RET

User Vance Lopez
by
3.7k points