Timer interrupt

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Timer interrupt

962 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by volter on Tue Nov 16 10:35:00 MST 2010
Can someone help me to set  timer 0 as interrupt?
I mean each time the Counter counts to the end it will generate interrupt and perform some tasks in the interrupt function. 

Basically, I need to generate 1KHz in some pin without making the microcontroller (lpc1343) to wait (like while() loop).

Original Attachment has been moved to: 1100835_lpc11_isr_handler_in_ram.zip

0 Kudos
Reply
2 Replies

876 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gbm on Tue Nov 16 13:17:08 MST 2010
Select some timer match channel x.
Set timer prescaler to (clock frequency in MHz -1), set EMR to toggle a MATx output on match, set MRx to 1 ms interval (999), select "reset on match x" in MCR, select timer match output pin function for a selected pin in IOCON register and start the timer, then go to sleep.

Oh, and dont't forget to enable clock for IOCON and a timer in SYSAHBCLKCTRL before programming the stuff.
0 Kudos
Reply

876 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Nov 16 11:23:11 MST 2010
Did you import LPCXpresso1343_systick sample ? :confused:
It's generating a 1ms interrupt :)
0 Kudos
Reply