Moderadores: 51, guest2003, Renie, gpenga
//*****************************************************************************
// Function name: INTERRUPÇÃO EXTERNA
//***************************************************************************/
void EINT3_IRQHandler (void)
{
LPC_GPIOINT->IO2IntClr |= (1 << 13);
LPC_SC->EXTINT = EINT3; /* clear interrupt */
}
void EINT2_IRQHandler (void)
{
LPC_GPIOINT->IO2IntClr |= (1 << 12);
LPC_SC->EXTINT = EINT2; /* clear interrupt */
}
void EINT1_IRQHandler (void)
{
LPC_GPIOINT->IO2IntClr |= (1 << 11);
LPC_SC->EXTINT = EINT1; /* clear interrupt */
}
void EINT0_IRQHandler (void)
{
LPC_GPIOINT->IO2IntClr |= (1 << 11);
LPC_SC->EXTINT = EINT0; /* clear interrupt */
}
uint32_t EINTInit( void )
{
LPC_PINCON->PINSEL4 = 0x05500000; /* set P2.10 as EINT0 and P2.0~7 GPIO output */
LPC_GPIOINT->IO2IntEnF = (1<<13)|(1<<12) | (1<<11) | (1<<10); /* Port2.10 is falling edge. */
LPC_SC->EXTMODE = (EINT3_EDGE | EINT2_EDGE | EINT1_EDGE | EINT0_EDGE );/* INT0 edge trigger */
//LPC_SC->EXTPOLAR =( 3 | 2 | 1 | 0); /* INT0 is falling edge by default */
}
proex escreveu:Se vc fez isso ai para o 17xx, nao vai servir no 13xx.
Rodrigo F. escreveu:asim tá configurado as interrupções EINT0 à EINT3 no caso estou usando um 1768, os pinos no meu são P2.10 (1<<10) ,11 (1<<11) ,12(1<<12) ,13(1<<13), da uma olhada nos pinos do seu e altere estes trechos do código!
styg escreveu:proex escreveu:Se vc fez isso ai para o 17xx, nao vai servir no 13xx.
e tu proex, usa int no cm3?
styg escreveu:Rodrigo F. escreveu:asim tá configurado as interrupções EINT0 à EINT3 no caso estou usando um 1768, os pinos no meu são P2.10 (1<<10) ,11 (1<<11) ,12(1<<12) ,13(1<<13), da uma olhada nos pinos do seu e altere estes trechos do código!
Rodrigo, esse código tas rodando no Keil? Se sim, então deve mesmo ter diferença entre os defines da linha 17xx e 13xx, porque no meu header nem tem esses defines.
LPC_GPIO0->IS = 0xCC; // interrupção por nivel baixo para P0.2,0.3,0.6,0.7
LPC_GPIO0->IE = 0xCC; // ativa int para P0.2,0.3,0.6,0.7
NVIC_EnableIRQ(EINT0_IRQn);
NVIC_EnableIRQ(WAKEUP3_IRQn);
void PIOINT0_IRQHandler(void)
{
LPC_GPIO1->IS &= ~(0x1<<1);
}
void PIOINT0_IRQHandler(void)
{
LPC_GPIO1->IS &= ~(0x1<<1);
}
void PIOINT0_IRQHandler(void)
{
lpc1xxx_delay_ms(500);
}
void WAKEUP3_IRQHandler(void)
{
lpc1xxx_delay_ms(500);
}
Usuários navegando neste fórum: Nenhum usuário registrado e 1 visitante