0
21kviews
Write an assembly program to generate a square wave of 10 KHz with timer 0 on port pin.
1 Answer
1
2.1kviews

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

enter image description here

Please log in to add an answer.