Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

Configuring the Timer 0

Configuring the Timer 0

2004-12-21 by acetoel

Hello...

I'm configurin Timer 0... My Clock is a 10Mhz Crystal PLLed to 60Mhz
for the CCLK and the PCLK. 

If I set the P0PR (prescaler register) to 0xEA60 (decimal 60000), then
when I start the Timer 0, will I have an increment on T0TC (Timer
Counter) each 60000 cycles of clock? or what's more easy to
understand... will T0TC increment in one each 1ms?
My idea is to make a short rutine that start the timer, and stop it
when 1mS has passed...

Thanks
Ezequiel

Re: Configuring the Timer 0

2004-12-22 by kaiandxiulpc2000

I didn't use the pre-scale register, but the main TC.  I think you 
need to decrement your value by 1 to 0xEA5F.  The way the timer 
works, the value 0 is one tick of the pclk, 1 is the 2nd tick, etc.. 
59999 is your 60,000th tick.  Look in the User Manual figures and you 
will see that.

--- In lpc2000@yahoogroups.com, "acetoel" <acetoel@y...> wrote:
> 
> Hello...
> 
> I'm configurin Timer 0... My Clock is a 10Mhz Crystal PLLed to 60Mhz
> for the CCLK and the PCLK. 
> 
> If I set the P0PR (prescaler register) to 0xEA60 (decimal 60000), 
then
Show quoted textHide quoted text
> when I start the Timer 0, will I have an increment on T0TC (Timer
> Counter) each 60000 cycles of clock? or what's more easy to
> understand... will T0TC increment in one each 1ms?
> My idea is to make a short rutine that start the timer, and stop it
> when 1mS has passed...
> 
> Thanks
> Ezequiel

Re: Configuring the Timer 0

2004-12-23 by dimaissaev

--- In lpc2000@yahoogroups.com, "acetoel" <acetoel@y...> wrote:
> 
> Hello...
> 
> I'm configurin Timer 0... My Clock is a 10Mhz Crystal PLLed to 60Mhz
> for the CCLK and the PCLK. 
> 
> If I set the P0PR (prescaler register) to 0xEA60 (decimal 60000), 
then
> when I start the Timer 0, will I have an increment on T0TC (Timer
> Counter) each 60000 cycles of clock? or what's more easy to
> understand... will T0TC increment in one each 1ms?
> My idea is to make a short rutine that start the timer, and stop it
> when 1mS has passed...
> 
> Thanks
> Ezequiel

Yes. And don't forget about VPB bus clock

Re: [lpc2000] Configuring the Timer 0

2004-12-23 by Robert Adsett

At 09:12 PM 12/21/04 +0000, you wrote:
>If I set the P0PR (prescaler register) to 0xEA60 (decimal 60000), then
>when I start the Timer 0, will I have an increment on T0TC (Timer
>Counter) each 60000 cycles of clock? or what's more easy to
>understand... will T0TC increment in one each 1ms?
>My idea is to make a short rutine that start the timer, and stop it
>when 1mS has passed...

Remember a counter only has a 1 count accuracy at best.  If you want to 
time a single ms wait your count should be much faster (10x faster will 
give you 10% accuracy).  That's one reason the timer in the newlib-lpc 
support runs as fast as it does.

Robert

" 'Freedom' has no meaning of itself.  There are always restrictions,
be they legal, genetic, or physical.  If you don't believe me, try to
chew a radio signal. "

                         Kelvin Throop, III

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.