Write ASM code to simultaneously generate two square waves o

Write ASM code to simultaneously generate two square waves of frequencies 5 kHz using Timer 0 on P1.1 and 200 Hz using Timer 1 on P1.2. Use appropriate modes for each of the two timers. Use interrupts

Solution

MOV TMOD, #01

HERE; MOV TL0, #0F7H // FOR 5kHZ, TL0= #0A4, TH0 = #0FF, CRYSTAL FREQ=11.0592 MHz

MOV TH0, #0FFH // FOR 200 HZ, TL0= #000, TH0 = #0F7

CPL P1.0

ACALL DELAY

SJMP HERE

DELAY;

SETB TR0

AGAIN JNB TF0, AGAIN

CLR TR0

CLR TF0

RET

Write ASM code to simultaneously generate two square waves of frequencies 5 kHz using Timer 0 on P1.1 and 200 Hz using Timer 1 on P1.2. Use appropriate modes fo

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site