SparkFun Forums 

Where electronics enthusiasts find answers.

Everything ARM and LPC
By abhavi
#169923
Hi
I am using LPC 2129 board with ARM7TDMI core.
I have read the data sheet of the processor.But I am not getting clear
idea of various registers of Timer0 and Timer1.Particularly Relation
ship between TC(Timer counter) and PR(Prescale register) and PC
(Prescale counter).

Can anybody in the group explain me in detail the relationship among
three registers and its usage as match timer.

I will download the timer examples from the other sites.

Regards
Anand
By stevech
#169929
I've used the timers, but it was some time ago. I have some code, but there is so much LPC2xxx code on the 'net and from NXP, I didn't have problems getting mine going.

The prescaler creates a clock for the timer, if the prescaler is enabled. The divisor is written to the prescaler, as a power of 2, such as divide by 1024. The prescaler's output frequency per the divisor, can be the input to the timer. Most microprocessors have this arrangement. The prescaler allows the timer to count more clock cycles before reaching the maximum count, e.g., rolling-over (the modulus of the counter). For a 32 bit counter as are common on ARM chips, the roll-over is 2 to the 32nd power clocks, using a start from 0.

It gets more involved.
By cfb
#169954
abhavi wrote:Hi
I am using LPC 2129 board with ARM7TDMI core.
I have read the data sheet of the processor.
The Data Sheets are mainly about the physical and electrical aspects of the NXP microcontrollers. You need the User Manual for all of the programming information.

You can download the User Manual (UM10114) for the LPC2129 from:

http://www.nxp.com/documents/user_manual/UM10114.pdf

You will find a whole chapter of about a dozen pages describing the operation of the Timers in great detail.