Fortune Telling Collection - Comprehensive fortune-telling - Calculation method of timer initial value of single chip microcomputer
Calculation method of timer initial value of single chip microcomputer
1 The time constant x of the timer can be calculated according to the calculation formula of the timing time:
Timing time t = (n -X power of 2) 12/ single chip microcomputer crystal frequency.
2 N is the working mode of the timer:
In mode 0, N= 13.
When the mode is 1, N= 16.
In mode 2, N=8.
3 according to the timing time and working mode, calculate the time constant x.
Convert x into a binary number, send the upper 8 bits to TH 1 and the lower 8 bits to TL 1, and you can start the timer to start counting.
For example: working in mode 1, timing time 1000 microseconds, crystal frequency = 12MHZ.
Then the timing time t = (power of 2 16-x)12/12mhz =1000 gives X=64536=FC 18H.
Hehe, if you are satisfied, please choose the satisfactory answer.
- Related articles
- See how names test fate, and names test fate.
- Fortune-telling is very hot _ Fortune-telling that has been very hot recently
- Fortune telling fortune telling _ What is fortune telling?
- Real fortune-telling map _ real fortune-telling map daquan
- If you get married, you will probably get divorced.
- Who killed Feng Sen's wife?
- Eight-character fortune telling 1988 Lunar February 18 65438+ 0:30 am
- Fortune tellers say that people who don't get rich will get rich.
- How to find the correct use of god in the eight characters
- What are the village committees under the jurisdiction of Jialing Town, Xiangcheng City, Zhoukou City, Henan Province?