i am using LPC2129,i need to program for capture , pwm and 1sec delay all using timer 0,how to use an single timer for those things...
Is there any manuals gave answer for this means give me a URL..
You can find manuals for most of the LPCxxxx ARM chips on this web. And if you google, you can also find them on the manufacturers page (NXP). It is easier to find the user manual using google than to visit NXP, since NXP have one of the most confusing web pages known to man.
ok..what is the answer for that...how to solve the problem....i didn't find any useful manual for capture module in LPC2129...
Not sure what you are saying.
Did you not find the user manual, or do you find chapter 15 of the manual no good?
Do you mean that "I need to control the timing for A , B and C, all using timer0, how to use an single timer for those things".
If so, how about use several counters in the timer0 ISR?
void Timer0Handler (void) __irq { timer0_counter++; if ( timer_A != 0 ) timer_A--; if ( timer_B != 0 ) timer_B--; if ( timer_C != 0 ) timer_C--; T0IR = 1; /* clear interrupt flag */ VICVectAddr = 0; /* Acknowledge Interrupt */ }
In your application, check if the counters of A/B/C become 0; if it is 0 "already", then do something and reset the counter.
The disadvantage is, it is not precise. Maybe someone else knows a better way. :)
Note that each timer has multiple compare/match registers, so it can generate interrupts or toggle a pin at different phases of the countdown.