beautypg.com

1 16-bit timer/counter, 1 functions, 2 configuration – NEC PD78214 User Manual

Page 138: Chapter 7 timer/counter units

background image

109

Chapter 7 Timer/Counter Units

7

7.1 16-BIT TIMER/COUNTER

7.1.1 Functions

The 16-bit timer/counter can function as an interval timer and can also be used for programmable square wave
output and pulse width measurement. In addition to these basic functions, the 16-bit timer/counter can be used
for the following:

• PWM output

• Period measurement

(1) Interval timer

When operating as an interval timer, the 16-bit timer/counter generates an internal interrupt at specified
intervals.

Table 7-2 Intervals of 16-Bit Timer/Counter

Minimum interval

8/f

CLK

(1.3

µs)

Maximum interval

2

16

× 8/f

CLK

(87.4 ms)

Resolution

8/f

CLK

(1.3

µs)

The values in parentheses are based on f

CLK

= 6 MHz.

(2) Programmable square wave output

The 16-bit timer/counter outputs a square wave separately on the TO0 pin and TO1 pin.

Table 7-3 Programmable Square Wave Output Setting Range of 16-Bit Timer/Counter

Minimum pulse width

8/f

CLK

(1.3

µs)

Maximum pulse width

2

16

× 8/f

CLK

(87.4 ms)

The values in parentheses are based on f

CLK

= 6 MHz.

(3) Pulse width measurement

The 16-bit timer/counter measures the pulse width of a signal applied to the external interrupt pin INTP3.

Table 7-4 Pulse Width Measurement Range of 16-Bit Timer/Counter

Measurable pulse width

≤2

16

× 8/f

CLK

(

≤87.4 ms)

Resolution

8/f

CLK

(1.3

µs)

The values in parentheses are based on f

CLK

= 6 MHz.

7.1.2 Configuration

The 16-bit timer/counter consists of one 16-bit timer 0 (TM0), two 16-bit compare registers (CR00, CR01), and one
16-bit capture register (CR02).

Fig. 7-2 shows the block diagram of the 16-bit timer/counter.

This manual is related to the following products: