Hello,
I'm busy with a Timer interrupt, but it seems not to work and I search a lot in the examples code and have used a lot but nothing likes to work:
Code.h:
void Timer0_irq (void) __attribute__ ((interrupt ("IRQ")));;
Code.c
/**********************************************************
Functie: Timer0 irq
**********************************************************/
void Timer0_irq(void)
{
print("T");
timer0_counter++;
if(timer0_counter == 500)
{
flag_time = 1 << flag_time_500ms;
timer0_counter = 0;
}
T0IR = 1; //Clear interrupt flag
VICVectAddr = 0; //Acknowledge Interrupt
}
/*********************************************************/
/**********************************************************
Functie: Timer0 init
**********************************************************/
void Timer0_init(void)
{
T0MR0 = 12000;
T0MCR = 0x03; //Interupt when MR0 is TC & TC is reset when MR0 matches it
VICVectAddr4 = (U32)Timer0_irq; //Timer0 irq
VICVectCntl4 = 15;
VICIntEnable = (1 << 4); //Enable Timer0 irq
T0TCR = 0x01; //Timer enabeled
return;
}
/*********************************************************/
Can somebody help me?
Kind regards
Patrick
|
I have the exact same problem on a 2368. Does anyone know anything about this?
Hi,
The default startups provided by Ride for the LPC2x devices only call a global IRQ_Handler function.
See their source codes here:
\lib\ARM\LPC2*.s
Then you have to add the code for analyzing which IRQ occured and call the appropriate ISR. (or call the same all the time if your application only uses one IRQ) You should find how to do that in the examples provided by NXP's website. (The examples in Ride are just to allow for testing the debugger. The examples showing the features of the CPUs are provided by the CPU manufacturers.)
More information here:
http://ics.nxp.com/support/documents/microcontrollers/pdf/an10254.pdf
Best Regards,
Vincent
hi,
I am also facing same problem and lot of working on that but can't solved yet
have you solved this problem,
could you help me?
regards,
Amogh
Hi Amogh,
It's been a while since I worked on this but I seem to remember having it working at some point. My code is as follows (in Raisonance Ride 7): (it may or may not be a copy of sample code, I just can't remember)
No guarantees though!