Content originally posted in LPCWare by inspire on Sun Jan 13 05:11:24 MST 2013 Hi,
in the LPCXpresso examples for the timer the MR0 register is set to the value where the timer interrupt occurs:
#define TIME_INTERVALmS 1000
...
LPC_TIM0->MR0 = TIME_INTERVALmS * 10; /* Set up 10 mS interval */
But now I wonder if this is absolutely right this way? When the interrupt occurs the TC value is reset. So TC moves between 0 and TIME_INTERVALmS * 10 = 10000. But this means that 10000+1 ticks have to pass until the interrupt occurs, right? So shouldn't MR0 be (TIME_INTERVALmS * 10) - 1?