#include "reg52.h"
void T0_valueSet() /*定义中断方式,中断时间*/
{
TMOD = 0x01;
/*定时0,工作在方式1*/
TH0
= (65536-1000)/256;
TL0
= (65536-1000)/256;
TR0
= 1;
/*启动计数*/
EA
= 1;
/*开总中断*/
ET0
= 1;
/*开定时器0中断*/
return;
}
int main()
{
T0_valueSet() ;
while(1);
}
/*-----------------------------------------------
采用定时器0产生中断,1MS触发一次
------------------------------------------------*/
void SLED_Disp() interrupt 1 using 3
{
TH0
= (65536-1000)/256;
TL0
= (65536-1000)/256;
/*添加代码*/
}