#include<STC12C5A60S2.h>
#include"type.h"
#include"lcd1602_drv.h"
uint8 count=0,sec=0,min=0;
void Isr_Init()
{
TMOD=0x01;
TH0=(65536-10000)/256;
TL0=(65536-10000)%256;
EA=1;
ET0=1;
PT0=0;
TR0=0;//开中断
}
void Isr_Timer0() interrupt 1
{
TH0=(65536-10000)/256;
TL0=(65536-10000)%256;
count++;
if(count==100)
{ count=0;
sec++;
if(sec==60)
{ sec=0;
min++;
}} //设置标志位
}
void delay(uint16 z)
{
uint16 i,j;
for(i=z;i>0;i--)
for(j=112;j>0;j--);
}
void main()
{
LCD1602Init();
Delay(20);
ScreenClear();
//初始化中断系统
Isr_Init();
StringDisplay(0,0,"MODEM Stopwatchp");
delay(5);
while(1)
{ // DataWrite(sec);
NumDisplay(0,1,sec);
// NumDisplay(0,1,sec);
//StringDisplay(0,1,min);
}
}