Flash Magic Forum

In-System Programming Support => LPC9xx/LPC9xxx => Topic started by: tanuja on February 23, 2006, 09:54:06 PM

Title: How to configure timers in P89LPC932
Post by: tanuja on February 23, 2006, 09:54:06 PM
Hi everyone,

How to configure the timer0 or timer1 in 16 bit timer mode using 12Mhz crystal oscillator for P89LPC932.
If i want to generate delay of 1sec, how it can be done using timer in 16 bit timer mode.
I tried with code generator, but cannot understand it, as i cannot select the timer mode there.
Please guide me.

Thanks
Title: Re: How to configure timers in P89LPC932
Post by: erikm on February 24, 2006, 06:20:14 AM
wrong forum

Title: Re: How to configure timers in P89LPC932
Post by: Andy Ayre on February 24, 2006, 06:23:30 AM
Yes. But a note on Code Architect: it picks the most appropriate mode depending on your inputs. Using the on-chip oscillator, 1 sec is not possible. Instead you will have to time a shorter period and use a counter.

Title: Re: How to configure timers in P89LPC932
Post by: markbng on February 24, 2006, 06:54:13 AM
You can set a shorter time out for a timer in mode2 and count the time-outs/overflows. You can poll the TF0/TF1 bit. Clear the bit and increase the time-out counter. Break the loop if 1sec delay is reached (Time-out time * CounterValue = 1 sec.). See data-sheet for more information about the timers.

Regards,
Mark



Post Edited (02-24-06 07:56)