⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.c

📁 51定时中断例程
💻 C
字号:
#include "reg52.h"
#include "intrins.h"

void initTimer(void)
{
 TMOD=0x11;
 TH0=0x0;
 TL0=0x0;
 TH1=0x0;
 TL1=0x0;
}

void timer0(void) interrupt 1
{
 TH0=0x0;
 TL0=0x0;
 _nop_();
 _nop_();
 _nop_();
 //add your code here.

}

void timer1(void) interrupt 3
{
 TH1=0x0;
 TL1=0x0;
  _nop_();
 _nop_();
 _nop_();
 //add your code here.
}

void main(void)
{
initTimer();

TR1=1;
ET1=1;
TR0=1;
ET0=1;
EA=1;
IP=0x02;
while(1);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -