ADuC7060 Interrupt processing Kiel
In a simple program using time 1 to toggle an LED, My program will not execute the IRQ_Handler routine
POWKEY1 = 0x1;
POWCON0 = 0x78; // Set core to max CPU speed of 10.24Mhz
POWKEY2 = 0xF4;
GP1DAT = BIT28 + BIT20; // Configure P1.4 as an output
T1LD = 0x10000; // 65236 clock ticks and start over.
T1CON = BIT6 + BIT7; // Periodic mode, enable timer, 32768hz clock/1
IRQEN = BIT4; // Enable Timer 1 IRQ
IRQCONN = BIT0;
void IRQ_Handler()
{
unsigned long IRQSTATUS = IRQSTA; // Read off IRQSTA register
if (IRQSTATUS != 0) //Timer 1 interrupt source
{
GP1DAT ^= BIT20;
T1CLRI = 0x55; // Clear the currently active Timer1 Irq
}
}
I have verified that the timer is running, and the interrupt flag is setting, and if I sample the interrupt flag outside the interrupt, the light flashes, but the IRQ does not execute. Is there a global interrupt enable or something similar that I am missing?
Hi,
Is there a while{} loop in your main function?
I think the example code should be a good reference to you.
You can download it from ADuC7060 product homepage - software & system requirement.
Regards,
Barry
Please log in to reply.