1
Program timer 1 of 8051 to generate 1 KHz square wave on P2.1 using mode 1. Assume crystal frequency to 12 MHz.
programming with 8051 • 19k  views
1
0

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 C/T M1 M0
0 0 0 0 0 0 0 1

IE

EA - - ES ET1 EX1 ET0 EX0
1 0 0 0 0 00 1 0

PROGRAM :

enter image description here

0
Please log in to add an answer.

Continue reading

Find answer to specific questions by searching them here. It's the best way to discover useful content.

Find more