RX 8564 LC

6) Example of timer interrupt function setting

Cancel timer interrupt

function

i.

 

timer interrupt

function

ii. Set

 

Set timer interrupt

function

TE

" 0 "

 

Zero-clear the TE bit to stop the timer interrupt function.

 

 

 

 

 

 

Zero-clear the TF bit and TIE bit to cancel the previous timer interrupt output

 

 

 

TF

" 0 "

 

 

 

(/IRQ output).

TIE

" 0 "

 

 

 

 

 

 

 

 

1

 

1

 

Set TI / TP bit

 

Select the operation mode (one-shot interrupt or repeated continuous

 

 

interrupts).

 

 

 

 

 

 

 

 

1) When repeated continuous interrupts are selected

 

 

 

 

Write "1" to the TI / TP bits.

 

 

 

 

2) When one-shot interrupt is selected

 

 

 

 

Write "0" to the TI / TP bits.

 

2

2

Set TIE bit

 

Select event-triggered /INT output (output/do not output interrupt when at

 

 

 

 

low level).

 

 

 

 

1) Output interrupt when at low level

 

 

 

 

Write "1" to the TIE bit.

 

 

 

 

2) Do not output interrupt when at low level

 

 

 

 

Write "0" to the TIE bit.

 

 

 

Set the timer's countdown period (= source clock).

Set TD1, TD0 bit

 

 

Select using a combination of TD1 and TD0 bit values.

 

 

 

 

 

iii. Start timer interrupt function

 

3

3

Initialize counter

Set down counter's initial value. (Reg 0F[h])

 

 

 

(Note) Be sure to set or reset the down counter's initial value each time.

 

 

 

 

TE

" 1 "

Write "1" to the TE bit to start the timer interrupt function.

 

(Note) Before starting the timer interrupt function, be sure to set or reset the

 

 

 

down counter's initial value (see 3 above).

 

 

 

 

 

 

 

To next process

Page 31

ETM12E-01