Real time interrupt on LPC ?

Hi all !

I’ve been trying for days to generate an RTI on a LPC2138. I mean an interrupt to trigger every 5us.

I’ve been working until now with HCS12X from Freescale and they have this real time interrupt very easy to implement.

Does anyone here know how this can be done on an LPC?

Any help is greatly appreciated.

Thanks,

James

Well, you usually take one of the available timers, set period to 5us, enable interrupt on that timer (on overflow or underflow) and write interrupt handler.

Hi,

Do you have a code example on how it’s done ? I have only been able to trigger the interrupt at 1ms but lower than that it’s impossible.

I have a 12 MHz crystal, 60MHz bus clock and 15 MHz peripheral clock…

All the best,

James

An interrupt every 5us :? this mean very very fast service routine. And probably the main software will never run, or at a very low speed.

Angelo

Have you tried a faster peripheral clock setting?

Leon

Logically there’s no difference between 1 mS and 5 uS, but at the latter you have about 300 instructions between interrupts which isn’t a whole lot of other work, depending on what your isr code does.

However, I’m using 65536 Hz as a context switching clock on LPC21XX series which is

a little over 15 uS and the idle loop still gets executed a lot.