📄 1574timer.c
字号:
#include "..\inc\public2.h"
int T0_0Interval;
BYTE T0_0Service; //Timer 0 service Var.
/**--------------------------------------------------------------------------
* Name void interrupt Timer1C_NewServiceRoutine()
* char bautrate_LSB
*
* Description This is a timer interrupt. It will entry when every 20ms.
* And will check Parse flag status.
*
* Flow Chart
*
* Return
*
* DATE Author Description
* ===========================================================================
* 2003-02-20 KM Ho This is first time implement
**/
void Timer0(void) interrupt 1 using 3
{
TR0=0; //STOP COUNT Timer0
if (T0_0Service) //is Timer 0 service flag setting?
{
T0_0Interval--; // counter
if (T0_0Interval < 0) // is timer out?
T0_0Service = 0; // turn off the service flag
}
TH0=0x9E; //Timer0 working in Mode 1 and set 20m sec.
TL0=0x58; //Working Cry=14.318MHz 1/14.318M * 12 = 0.8 us
//20ms = 0.8 * 25000
// TH0 = (65536 - 25000) / 256 = 0x9E
// TL0 = (65536 - 25000) % 256 = 0x58
TF0=0;
TR0=1; //Start count Timer0
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -