I need to generate PWM signal in cortex-M3. With timer example program i changed some part of the code. While compiling i was having one warning as systemclockupdate. While building the target is not created. Please help me.
Thank You.
Are you sure that this is correct? No off-by-one error, if you compare with the datasheet?
LPC_TIM0->PR = pclk/1000000; /* set prescaler to get 1 M counts/sec */
What is mS? Would be milli-Siemens if using ISO units. Don't you mean milli-seconds, i.e. lower-case "s"?
LPC_TIM0->MR0 = TIME_INTERVALmS * 15; /* Set up 15 mS interval */
You use a symbol TIME_INTERVALmS, that you don't tell us what it is.
Next thing - your timer have four different match registers. You use a single match register.
What do you think happens if you use two match registers - one for 15ms and one for 16ms. Generate interrupt for both. Let the second match register also reset the timer? Wouldn't you see an advantage in a timer that automagically restarts with zero time lost for reloading?
If you manually reconfigure the timer and restarts it, you will always leak time - it takes some time for the interrupt to be activated. Then the interrupt need to decide what to do. Then time to run the functions you don't show us to reset_timer() and enable_timer().
Another interesting thing: Your code performs absolute tests on timer registers. What happens if that register happens to tick one tick further before you have time to make that == compare? Isn't it better to just let the hardware in the timer perform the == operation, and you just quickly check which of the four match registers that detected a match? Why have hardware-acceleration if ignoring it and duplicating the functionality in software?
And by the way - your code is not easy to read. Lack of comments and not tagged as code. You didn't notice and got disappointed at the look directly when posting?