Philips Semiconductors

User’s Manual - Preliminary -

 

 

 

 

 

 

TIMERS 0 AND 1

P89LPC901/902/903

 

 

5. TIMERS 0 AND 1

 

 

The P89LPC901/902/903 has two general-purpose counter/timers which are similar to the 80C51 Timer 0 and Timer 1. Timer 0 of the P89LPC901 can be configured to operate either as a timer or event counter (see Figure 5-1). An option to automatically toggle the T0 pin upon timer overflow has been added. Timer 1 of the P89LPC901 and both Timer 0 and Timer 1 of the P89LPC902 and P89LPC903 devices may only function as timers.

In the “Timer” function, the timer is incremented every PCLK.

In the “Counter” function, the Timer 0 register is incremented in response to a 1-to-0 transition on the external input pin, T0, which is sampled once during every machine cycle. When the pin is high during one cycle and low in the next cycle, the count is incremented. The new count value appears in the register during the cycle following the one in which the transition was detected. Since it takes 2 machine cycles (4 CPU clocks) to recognize a 1-to-0 transition, the maximum count rate is 1/4 of the CPU clock frequency. There are no restrictions on the duty cycle of the external input signal, but to ensure that a given level is sampled at least once before it changes, it should be held for at least one full machine cycle.

The “Timer” or “Counter” function is selected by control bit T0C/T in the Special Function Register TMOD. Timer 0 and Timer 1 of the P89LPC902 and P89LPC903, and Timer 1 of the P89LPC901 have four operating modes (modes 0, 1, 2, and 3), which are selected by bit-pairs (TnM1, TnM0) in TMOD. Modes 0, 1, 2 and 3 are the same for both Timers. Mode 3 is different. The operating modes are described later in this section. In addition to these modes, Timer 0 of the P89LPC901 has mode 6. Additionally the T0M2 mode bit in TAMOD is used to specify modes with Timer 0 of the P89LPC901.

TMOD

 

 

 

7

6

5

4

 

3

2

 

 

1

0

 

Address: 89h

 

 

 

 

 

 

 

 

 

 

 

-

-

T1M1

T1M0

 

-

T0C/T

 

 

T0M1

T0M0

 

Not bit addressable

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Reset Source(s): Any source

 

 

 

 

 

 

 

 

 

 

 

 

 

Reset Value:

00000000B

 

 

 

 

 

 

 

 

 

 

 

 

 

BIT

SYMBOL

FUNCTION

 

 

 

 

 

 

 

 

 

 

 

TMOD.7

-

 

 

Reserved.

 

 

 

 

 

 

 

 

 

 

 

TMOD.6

-

 

 

Reserved.

 

 

 

 

 

 

 

 

 

 

 

TMOD.5, 4

T1M1,T1M0

Mode Select for Timer 1. These bits are used to determine the Timer 1 mode (see Figure

 

 

 

 

5-2).

 

 

 

 

 

 

 

 

 

 

 

TMOD.3

-

 

 

Reserved.

 

 

 

 

 

 

 

 

 

 

 

TMOD.2

T0C/T

 

 

Timer or Counter Selector for Timer 0. Cleared for Timer operation (input from CCLK). Set

 

 

 

 

 

for Counter operation (input from T0 input pin).P89LPC901. When writing to this register

 

 

 

 

on the P89LPC902 or P89LPC903 devices, this bit position should be written with a zero.

TMOD.1, 0

T0M1,T0M0

Mode Select for Timer 0. These bits are used to determine the Timer 0 mode (see Figure

 

 

 

 

5-2). On the P89LPC901 these bits are used with the T0M2 bit in the TAMOD register to

 

 

 

 

determine the Timer 0 mode (see Figure 5-2).

 

 

 

 

 

 

 

Figure 5-1: Timer/Counter Mode Control register (TMOD)

2003 Dec 8

45

Page 45
Image 45
Philips P89LPC901, P89LPC903, P89LPC902 user manual Tmod, TMOD.7, TMOD.6, TMOD.3, TMOD.2

P89LPC903, P89LPC902, P89LPC901 specifications

The Philips P89LPC901, P89LPC902, and P89LPC903 are a series of 8-bit microcontrollers designed for embedded system applications. These models, which belong to the LPC900 series, are notable for their affordability and versatility, making them an attractive choice for both hobbyists and professional developers.

One of the core features of the P89LPC901, P89LPC902, and P89LPC903 microcontrollers is their powerful 8-bit architecture. Operating at clock speeds up to 20 MHz, they deliver efficient performance suited for a range of tasks. Each model includes a comprehensive instruction set that supports various data manipulation and arithmetic functions, enabling extensive programming capabilities.

These microcontrollers come with built-in memory, with configurations that vary among the three models. The P89LPC901 typically features 4 KB of Flash memory and 256 bytes of RAM, while the P89LPC902 and P89LPC903 offer enhanced memory options. This Flash memory allows for reprogrammability, making it easier to update and modify applications as needed.

Another significant characteristic of the LPC900 series is their integrated peripherals. These models are equipped with a variety of I/O ports, allowing for easy interfacing with other devices and components. The P89LPC901 supports up to 32 I/O pins, while the P89LPC902 and P89LPC903 provide additional features such as analog-to-digital converters (ADCs), timers, and serial communication interfaces. This broad range of peripherals empowers developers to design complex applications without needing extra hardware.

Power consumption is also a key consideration for microcontroller applications. The P89LPC901, P89LPC902, and P89LPC903 are designed with low power consumption in mind, making them ideal for battery-operated devices and energy-efficient projects. They can operate in various power modes, allowing for greater flexibility in deployment.

In terms of technology, these microcontrollers utilize advanced CMOS technology, ensuring high reliability and durability. Their design offers a robust solution for numerous applications, including consumer electronics, industrial controls, and automation systems.

In summary, the Philips P89LPC901, P89LPC902, and P89LPC903 microcontrollers present an attractive combination of performance, integrated peripherals, low power consumption, and versatility. Their features cater to a wide array of applications, keeping them relevant in a rapidly evolving technology landscape. For hobbyists and professionals alike, these microcontrollers represent a reliable foundation for embedded system development.