Board logo

标题: KBI中断的问题,路过熟悉的请指教? [打印本页]

作者: knightccc    时间: 2007-6-6 00:51     标题: KBI中断的问题,路过熟悉的请指教?

程序如下,要么是进不了中断,要么就是一直在中断内循环,ACK没有将标志位清0?
interrupt void KBIIsr(void) {


KBI1SC &= ~0x02;


if (PB0==0) {
LED1 = LED_OFF;
LED2 = LED_OFF;
LED3 = LED_OFF;
LED4 = LED_OFF;
LED1=LED_ON;
gu8Command=1;
}

if (PB1==0) {
LED1 = LED_OFF;
LED2 = LED_OFF;
LED3 = LED_OFF;
LED4 = LED_OFF;
LED2=LED_ON;
gu8Command=2;
}

if (PB2==0) {
LED1 = LED_OFF;
LED2 = LED_OFF;
LED3 = LED_OFF;
LED4 = LED_OFF;
LED3=LED_ON;
gu8Command=3;
}



KBI1SC |= 0x04;
KBI1SC |= 0x02;

}


void KBIInit(void) {


KBI1SC &= ~0x02;
KBI1PE = 0xC3;
KBI1SC |= 0x04;
KBI1SC |= 0x02;

}
作者: strongchen    时间: 2007-6-6 09:54

什么芯片?
作者: knightccc    时间: 2007-6-9 10:32

mc98s0860gt




欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0