#include "STC15F2K60S2.H"
|
|
|
void Timer0_Isr(void) interrupt 1
|
{
|
}
|
|
void Timer0_Init(void) //125΢Ãë@22.1184MHz
|
{
|
AUXR |= 0x80; //¶¨Ê±Æ÷ʱÖÓ1Tģʽ
|
TMOD &= 0xF0; //ÉèÖö¨Ê±Æ÷ģʽ
|
TL0 = 0x33; //ÉèÖö¨Ê±³õʼֵ
|
TH0 = 0xF5; //ÉèÖö¨Ê±³õʼֵ
|
TF0 = 0; //Çå³ýTF0±êÖ¾
|
TR0 = 1; //¶¨Ê±Æ÷0¿ªÊ¼¼Æʱ
|
ET0 = 1; //ʹÄܶ¨Ê±Æ÷0ÖжÏ
|
}
|
|
|
void Timer1_Isr(void) interrupt 3
|
{
|
}
|
|
void Timer1_Init(void) //1ºÁÃë@22.1184MHz
|
{
|
AUXR |= 0x40; //¶¨Ê±Æ÷ʱÖÓ1Tģʽ
|
TMOD &= 0x0F; //ÉèÖö¨Ê±Æ÷ģʽ
|
TL1 = 0x9A; //ÉèÖö¨Ê±³õʼֵ
|
TH1 = 0xA9; //ÉèÖö¨Ê±³õʼֵ
|
TF1 = 0; //Çå³ýTF1±êÖ¾
|
TR1 = 1; //¶¨Ê±Æ÷1¿ªÊ¼¼Æʱ
|
ET1 = 1; //ʹÄܶ¨Ê±Æ÷1ÖжÏ
|
}
|