https://static.assets-stash.eet-china.com/album/old-resources/2009/2/8/ccd885c0-7422-467d-a6f2-32acf29cc873.rar
这次实验比较成功,一次通过,但移位错了一位,在Timer0_Handle函数中。个人觉得interrupt.h这个文件没用。
TIMER INITIALIZATION 关键在于知道各寄存器的公用,设置3种时钟,设置的顺序,开启中断,
TIMER INITIALIZATION USING MANUAL UPDATE BIT AND INVERTER BIT<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
An auto reload operation of the timer occurs when the down counter reaches 0. So, a starting value of the TCNTn has to be defined by the user in advance. In this case, the starting value has to be loaded by the manual update bit. The following steps describe how to start a timer:
1) Write the initial value into TCNTBn and TCMPBn.
2) Set the manual update bit of the corresponding timer. It is recommended that you configure the inverter on/off bit. (Whether use inverter or not).
3) Set start bit of the corresponding timer to start the timer (and clear the manual update bit).
If the timer is stopped by force, the TCNTn retains the counter value and is not reloaded from TCNTBn. If a new value has to be set, perform manual update.
NOTE
Whenever TOUT inverter on/off bit is changed, the TOUTn logic value will also be changed whether the timer runs. Therefore, it is desirable that the inverter on/off bit is configured with the manual update bit.
文章评论(0条评论)
登录后参与讨论