#7358 - JTAG - Mon Jun 16, 2003 11:21 am
Hello All,
How execution externel interrupt( example IRQ0) in IAR C
I writen simple program for test:
//Test AT91R40008 IRQ
#include "stdio.h"
#include "inarm.h"
#include "arm_interrupt.h"
//===============- Interrupt handler-=============
__irq void int0_handler(void)
{
__AIC_IVR=0;
intoccurs=1;
__AIC_EOICR=1;
}//end interrupt
void main(void)
{
__PIO_PDR_bit.p9=1; //Disable PIO on the IRQ0
__AIC_SVR16=(unsigned long)&int0_handler; // Receive address interrupt
__AIC_SMR16_bit.prior=6; //PRIOR=6, Priority Level
__AIC_SMR16_bit.srctype=1; //Negative Edge Triggered
__AIC_IECR_bit.irq0=1; //Enables int0 interrupt
while(1)
{
a=1;
}
}
This program don't work :(.
Please send me sample program execution interrupt for IAR C , if it possible.
Best regards Alexander
How execution externel interrupt( example IRQ0) in IAR C
I writen simple program for test:
//Test AT91R40008 IRQ
#include "stdio.h"
#include "inarm.h"
#include "arm_interrupt.h"
//===============- Interrupt handler-=============
__irq void int0_handler(void)
{
__AIC_IVR=0;
intoccurs=1;
__AIC_EOICR=1;
}//end interrupt
void main(void)
{
__PIO_PDR_bit.p9=1; //Disable PIO on the IRQ0
__AIC_SVR16=(unsigned long)&int0_handler; // Receive address interrupt
__AIC_SMR16_bit.prior=6; //PRIOR=6, Priority Level
__AIC_SMR16_bit.srctype=1; //Negative Edge Triggered
__AIC_IECR_bit.irq0=1; //Enables int0 interrupt
while(1)
{
a=1;
}
}
This program don't work :(.
Please send me sample program execution interrupt for IAR C , if it possible.
Best regards Alexander