本人做外部中断实验的时候,程序入下: # include "config.h"
# define BEEPCON 1<<7
void IRQ_Eint3(void) __irq /*注:该处和ADS1.2的__irq的位置不同*/
{ uint32 i;
i=IO0SET;
if(i&BEEPCON==0)
{
IO0SET =BEEPCON;
}
else
{
IO0CLR=BEEPCON;
}
while((EXTINT&1<<3)!=0)
{
EXTINT =1<<3;
}
}
int main()
{ PINSEL1=3<<8;
IO0DIR =BEEPCON;
//EXTPOLAR=0X00;
EXTMODE=0X00;
VICIntSelect =0X00000000;
VICDefVectAddr=(uint32)IRQ_Eint3;
EXTINT=1<<3;
VICIntEnable=1<<17;
while(1);
reture(0);
}
为什么程序一执行到EXTMODE 蜂鸣器就叫起来?我看了电路图,不管我拔下还是插上JP2,结果都一样。总是找不到原因,请周工帮帮忙? |