0
22kviews
Write an assembly program to generate a square wave of 10 KHz with timer 0 on port pin.
1 Answer
written 6.0 years ago by |
Frequency = 10 KHz.
1 clock pulse = 1/10 KHz = 100 μsec.
50 μsec is ‘ON’ time’ and 50 μsec is ‘OFF’ time
Hence, a delay of 50 μsec required
Count = 50 μsec /1 μsec (Assuming 12 MHz crystal) = 50.
Using mode 2, the timer will have to be initialized to 256 50 = 206