啊,我从来没有意识到H寄存器会被计时器损坏。我也不知道定时器寄存器“时钟上升”到65535溢出。我已经将它们的预置移动到主回路,并计算出16位的预置为4MHz/4=1MHz100000(Hz)/50(Hz)=2000065536-20000=45536=B1E0H我的频率现在是49.3Hz-接近50Hz I nEDE,只是需要调整一下。谢谢你的洞察力…
以上来自于百度翻译
以下为原文
Ahhh - I never realised the H an L registers would be destroyed by the Timer working. Neither was I aware that the timer registers "clock up" to overflow at 65535.
I have moved the presetting of them to the main loop, and calculated the 16-bit preset as
4MHz / 4 = 1 MHz
100000 (Hz)/ 50 (Hz) = 20000
65536 - 20000 = 45536 = B1E0H
My frequency is now 49.3 Hz - getting close to the 50 Hz I need, just needs a tweak.
Thanks for the insight ...
啊,我从来没有意识到H寄存器会被计时器损坏。我也不知道定时器寄存器“时钟上升”到65535溢出。我已经将它们的预置移动到主回路,并计算出16位的预置为4MHz/4=1MHz100000(Hz)/50(Hz)=2000065536-20000=45536=B1E0H我的频率现在是49.3Hz-接近50Hz I nEDE,只是需要调整一下。谢谢你的洞察力…
以上来自于百度翻译
以下为原文
Ahhh - I never realised the H an L registers would be destroyed by the Timer working. Neither was I aware that the timer registers "clock up" to overflow at 65535.
I have moved the presetting of them to the main loop, and calculated the 16-bit preset as
4MHz / 4 = 1 MHz
100000 (Hz)/ 50 (Hz) = 20000
65536 - 20000 = 45536 = B1E0H
My frequency is now 49.3 Hz - getting close to the 50 Hz I need, just needs a tweak.
Thanks for the insight ...
举报