beautypg.com

2 timer functions – NEC PD17062 User Manual

Page 134

background image

134

µ

PD17062

12.2 TIMER FUNCTIONS

There are two timer functions, timer carry FF check and timer interrupt.

The timer carry FF check function performs time management by checking, by program, the state of the

timer carry FF, which is set at constant intervals. The timer interrupt function performs time management

by requesting an interrupt at constant intervals.

The timing at which the timer carry FF is set to 1 or the timer interrupt is requested is controlled by the

timer interval set pulse output from selector A or B, respectively.

The timer interval set pulse can be specified as 10 Hz (100 ms), 50 Hz (20 ms), or 200 Hz (5 ms) by setting

the appropriate data in the timer mode select register.

The timer mode select register is used to specify the time base mode (internal timer mode or external timer

mode) for selectors A and B. The internal timer mode uses pulses generated by dividing the device’s operating

frequency (8 MHz). The external timer mode uses 50 or 60 Hz supplied at the P0B

2

/TMIN pin.

The timer mode select register is again used to specify whether to divide the frequency of the pulse supplied

at the P0B

2

/TMIN pin by 5 or 6.

The timer interval set pulse is specified by combining the timer carry FF and timer interrupt.

Fig. 12-2 shows the relationships between the timer mode select register and timer interval set pulse.

In the internal timer mode, the timer interval set pulse is generated by dividing the device’s operating

frequency (8 MHz). If the frequency deviates from the correct value (8 MHz), the timer interval set pulse will

also deviate at the same ratio.