下面一段話是在網(wǎng)上摘錄下來的,開了之后終于解開了我的頻率計(jì)為何不能準(zhǔn)確的測480KHz以上的信號了。
The 8052 microcontroller has internal timers (T0, T1, and T2 if you are using an 8052), but they are limited to the speed of your microcontroller, which is in turn limited to the speed of your crystal. If you have a standard Intel 8052 running with a 12MHZ crystal, your timers will be incremented 1,000,000 times per second (1MHZ). Since you are counting high/low transitions and the source must remain high or low for at least one cycle, the theoretical maximum resolution for such a configuration would be 500,000 (500Khz). Tricks and external components may be used to measure higher frequency events.
如果8052單片機(jī)的晶振頻率為12MHz的話,那么計(jì)數(shù)器最大計(jì)數(shù)為1MHz,但是由于8052單片機(jī)在測頻率的時候,至少需要兩個時鐘周期,理論上所能測得頻率的最高至為500Khz.
難怪我改了定時器的定時時間為10ms,都不濟(jì)于事,本以為是計(jì)數(shù)器變量溢出了,那就把1s改為10ms,那不就不會溢出了,結(jié)果還是不行,看了看網(wǎng)上的資料,終于明白了,若真要測480KHz的信號,那就只能拿個頻率更高的晶振了。。
不知這樣的理解是否合理,還望各位多多指點(diǎn)。