立即注册 登录
返回首页

uid:92918的个人空间

日志

51单片机(使用中断0、中断1)遇到的问题点

已有 847 次阅读2017-12-14 20:45

程序如下:
#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
sbit LED=P0^0;
sbit LED1=P0^1;
void DelayMS(uint x)
{
 uchar t;
 while(x--)
  {
   for(t=120;t>0;t--);
  }
}
void interrupt_0()interrupt 0
{
  LED=~LED;
  DelayMS(10);

}
void interrrupt_1()interrupt 1
{
  LED1=~LED1;
  DelayMS(10);
}

void main()
{
 
 // {
  EA=1;
EX0=1;
EX1=1;
IT0=1;
IT1=1;
 //  }
  while(1);
}
问题: 中断1不能正常工作?求解,问题出在哪!

路过

鸡蛋

鲜花

握手

雷人

全部作者的其他最新日志

发表评论 评论 (1 个评论)

回复 BLUEBLOOD 2017-12-14 21:49
犯二了,知道哪出错了

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

返回顶部