有谁用过C8051F系列单片机,我写了一个程序,用按键外部中断来触发led灯发亮,这个程序哪错了

#include "C8051F340.h"
void Port_IO_Init();
void Oscillator_Init();
void Interrupts_Init();
void Init_Device(void);
sbit LED0 = P2^2;
sbit LED1 = P2^3;

void main()
{
PCA0MD &= ~0x40;
Init_Device();
LED0=1;
while(1);
}
void INIT_00() interrupt 0
{
LED0 = 1;
LED1 = 1;
}
void INIT_11() interrupt 2
{
LED0 = 0;
LED1 = 0;
}
void Port_IO_Init()
{
P0MDIN = 0XFF;
P2MDOUT = 0XFF;
}
void Oscillator_Init()
{
OSCICN = 0x83;
}
void Interrupts_Init()
{
IE = 0x85;
IT01CF = 0x10;
IT0 = 1;
IT1 = 1;
}

void Init_Device(void)
{
Port_IO_Init();
Oscillator_Init();
Interrupts_Init();
}

中断写的不对。中断向量都没有。
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答
大家正在搜