求大神帮我看下,STC15w408as,这样写的程序led灯根本就不亮,interrupt 3该成interrupt 1就好用,已经调试好几天了,还是没有办法,跪求!!
#include <reg52.h>
sfr P5=0xC8;
sfr AUXR=0x8e; //串口辅助寄存器
sbit LCD_RST=P2^0;
sbit LCD_CE=P2^1;
sbit LCD_DC=P2^2;
sbit relay2=P2^3;
sbit scl=P2^4; //iic时钟信号口
sbit sda=P2^5; //iic数据信号口
sbit CS5460_reset=P2^6;
sbit beep = P2 ^ 7;
sbit key1 = P5 ^ 4;
sbit key2=P3^1;
sbit Int0=P3^2; //时钟中断信号口
sbit Int1=P3^3; //能量中断口
sbit key3=P3^6;
sbit key4=P3^7;
sbit CS5460_CS=P1^2;
sbit LEDb=P1^6;
sbit LEDr=P1^7;
sbit relay=P5^5;
sbit BL=P1^0;
sbit dian=P3^2;
void tm1_isr() interrupt 3
{
LEDr=!LEDr;
}
void main ()
{
EA=1; //总中断打开
// INT_CLKO=0x10; //INT2 INT3中断允许
AUXR = 0x01; //定时器时钟1T模式
TMOD = 0x00; //设置定时器为模式0(16位自动重装载)
TF0=0;TF1=0; //清除TF1标志 //T0计数器
// TL0 = 0xcd;
TL1 = 0xcd;
// TH0 = 0xd4;
TH1 = 0xd4; //T0装数
// ET0 = 1;
ET1 = 1; //使能定时器0中
// TR0 = 1;
TR1 = 1;
key1=1;key2=1;
beep=1;LEDb=0;LEDr=0;
while(1);
}
|