Josh Jordan

MCF5213 trouble getting started

Discussion created by Josh Jordan on Dec 2, 2006
Latest reply on Dec 7, 2006 by Josh Jordan
I am using the M5213EVB with codewarrior and the C stationary.

I am getting a problem when trying to use interrupts. Here is what I am doing:

1. Make interrupt function preceded with __interrupt__ keyword. It is a PIT interrupt, it looks like this

__interrupt__ void my_pit0_irq(void)
{//vector 64+55=119, source =55
MCF_PIT0_PCSR = (108)||(13)||1;
MCF_PIT0_PMR = 0xffff;
MCF_GPIO_PORTAN ^= 0xff; //flip last 4 bits
counter++;
}

2. In main function, I add these lines of code for interrupt:

MCF_PIT0_PCSR = (68)||(13)||1;
//2^10 prescaler, enable irq, enable module

MCF_INTC_ICR55 = (33)||(3);
MCF_INTC_IMRH = ~(123); //enable irq 55

3. In vectors.s I change this-

vector119: .long asm_exception_handler

to this-

vector119: .long my_pit0_irq


The reason I changed vector 119 is because the pit0 irq is number 55 and 55+64=119.
When I compile this, I get error!

error- unknown identifier in vectors.s!!

The identifier is the EXACT SAME as my interrupt function!!!!! How can this happen? I am very frustrated with freescale right now. I have used many products and have never had such an issue getting an interrupt to work!

Outcomes