您好,使用外部中断时,用寄存器EXPOL设置了触发边沿方式,这里以GP5为例,设置为下降沿触发,
但是当我给上升沿时,同样能触发对应的中断,这是为什么?EXPOL寄存器没有起作用?
下面是程序,问题在哪呢?谢谢
*(int *)EMIF_GCTL = 0x00003060; /* EMIF global control register */
*(int *)EMIF_CE1 = 0xFFFFFF23; /* CE1 – 32-bit operation to 16-bit FLASH asynch access */
*(int *)EMIF_CE0 = 0xFFFFFF30; /* CE0 – SDRAM */
*(int *)EMIF_CE2 = 0xFFFFFF23; /* CE2 – 32-bit asynch on daughterboard */
*(int *)EMIF_CE3 = 0xFFFFFF23; /* CE3 – 32-bit asynch on daughterboard */
*(int *)EMIF_SDRAMCTL = 0x57117000; /* SDRAM control register (100 MHz)*/
*(int *)EMIF_SDRAMTIMING = 0x0000061a; /* SDRAM Timing register */
/*———–interrupt setup————*/
IRQ_setVecs(vectors); /* point to the IRQ vector table */
IRQ_globalEnable(); /* enable global interrupt request */
IRQ_nmiEnable(); /* Enable NMI interrupt */
/*—–external interrupt initialize—-*/
IRQ_map(IRQ_EVT_EXTINT4,ExternalInt4Number);
IRQ_map(IRQ_EVT_EXTINT5,ExternalInt5Number);
IRQ_map(IRQ_EVT_EXTINT6,ExternalInt6Number);
IRQ_map(IRQ_EVT_EXTINT7,ExternalInt7Number);
IRQ_reset(IRQ_EVT_EXTINT4);
IRQ_reset(IRQ_EVT_EXTINT5);
IRQ_reset(IRQ_EVT_EXTINT6);
IRQ_reset(IRQ_EVT_EXTINT7);
IRQ_enable(IRQ_EVT_EXTINT4);
IRQ_enable(IRQ_EVT_EXTINT5);
IRQ_enable(IRQ_EVT_EXTINT6);
IRQ_enable(IRQ_EVT_EXTINT7);
*(int *)EXTPOL = 0x00000002; // 下降沿触发ExternalInt5
////////////////////////////////////////*/
while(1);
}
/* ————-external interrupt service routine———*/
interrupt void
ExtInt5(void)
{
IRQ_clear(IRQ_EVT_EXTINT5); //清中断
* PCE2=4; //测试代码
return;
}
noaming:
http://www.deyisupport.com/question_answer/dsp_arm/c6000_dsp/f/32/t/45453.aspx