0
75kviews
Program timer 1 of 8051 to generate 1 KHz square wave on P2.1 using mode 1. Assume crystal frequency to 12 MHz.
1 Answer
| written 7.1 years ago by | • modified 7.1 years ago |
frequency = 1KHz
1 pulse = 1/1KHz = 1 msec
500 μsec ON time and 500 μsec OFF line.
Crystal Frequency = 12MHz
1 clock pulse = 1μsec.
Count = 500μsec/1μsec = 500
Counter initial value = 65536 - 500 = 65036 = FE0C
TMOD
| Gate | C/T | M1 | M0 | Gate … |
|---|