下面一段話是在網上摘錄下來的,開了之后終于解開了我的頻率計為何不能準確的測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單片機的晶振頻率為12MHz的話,那么計數器最大計數為1MHz,但是由于8052單片機在測頻率的時候,至少需要兩個時鐘周期,理論上所能測得頻率的最高至為500Khz.
難怪我改了定時器的定時時間為10ms,都不濟于事,本以為是計數器變量溢出了,那就把1s改為10ms,那不就不會溢出了,結果還是不行,看了看網上的資料,終于明白了,若真要測480KHz的信號,那就只能拿個頻率更高的晶振了。。
不知這樣的理解是否合理,還望各位多多指點。