新手上路
- 积分
- 38
- 金钱
- 38
- 注册时间
- 2020-5-21
- 在线时间
- 8 小时
|
1金钱
void Timer0_Configuration()
{
ET0=1;
AUXR |= 0x80; //定时器时钟1T模式
TMOD = 0x40; //设置定时器模式
TL0 = 0xCD; //设置定时初值
TH0 = 0xD4; //设置定时初值
TF0 = 0; //清除TF0标志
TR0 = 1; //定时器0开始计时
}
void Timer1_Configuration()
{
ET1=1;
AUXR |= 0x70; //定时器时钟1T模式
TMOD = 0x40; //设置计数模式
TL1 = (65536-5)%256; //设置定时初值
TH1 = (65536-5)/256; //设置定时初值
TF1 = 0; //清除TF0标
TR1 = 1;
IP=0x08;
}
void Timer_Configuration()
{
Timer1_Configuration();
Timer0_Configuration();
EA=1;//开启总中断
}
void Time1()interrupt 3 using 0
{
P27=!P27;
Reversal_Flag=1;
TR1 = 0;
}
void Time0()interrupt 1 using 1
{
if(Main_Flag==1)
Enter_Set_count++;
if(Running.Increase_material_Sensor_Detection_Delay_Flag==1)
Running.Increase_material_Sensor_Detection_Delay_Time++;
if(Running.Brushless_Electric_Machine_On_Time_Flag==1)
Running.Brushless_Electric_Machine_On_Time++;
if(Running.Brushless_Electric_Machine_Off_Time_Flag==1)
Running.Brushless_Electric_Machine_Off_Time++;
if(Running.Brushless_Electric_Reversal_Flag==1)
Running.Brushless_Electric_Reversal_Time++;
if(Running.Brushless_Electric_Foreward_Flag==1)
Running.Brushless_Electric_Foreward_Time++;
if(Read_ADC_Value_Time_Flag==1)
Read_ADC_Value_Time++;
}
|
|