English
Language : 

4524_M Datasheet, PDF (192/310 Pages) Renesas Technology Corp – 4-BIT CISC SINGLE-CHIP MICROCOMPUTER 720 FAMILY / 4500 SERIES
4524 Group
APPLICATION
2.2 Interrupts
➀ Disable Interrupts
Timer 2 interrupt is temporarily disabled.
Interrupt enable flag INTE
Interrupt control register V1
0
b3
b0
0 ✕✕✕
All interrupts disabled [DI]
b3: Timer 2 interrupt occurrence disabled [TV1A]
➁ Stop Timer and Prescaler Operation
Timer 2 and prescaler are temporarily stopped.
Timer 2 count source is selected.
Timer control register W2
b3
✕0
Timer control register PA
↓
b0
01
b0
0
[TW2A]
b2: Timer 2 stop
b1, b0: Prescaler output (ORCLK) selected for
Timer 2 count source
Prescaler stop [TPAA]
↓
➂ Set Timer Value and Prescaler Value
Timer 2 and prescaler count times are set. (The formula is shown *A below.)
Timer 2 reload register R2 “5216”
Timer count value 82 set [T2AB]
Prescaler reload register RPS “0F16”
Prescaler count value 15 set [TPSAB]
↓
➃ Clear Interrupt Request
Timer 2 interrupt activated condition is cleared.
Timer 2 interrupt request flag T2F 0
Timer 2 interrupt activated condition cleared [SNZT2]
↓
( ) Note when the interrupt request is cleared
When ➃ is executed, considering the skip of the next instruction
according to the interrupt request flag T2F,
insert the NOP instruction after the SNZT2 instruction.
↓
➄ Start Timer Operation and Prescaler Operation
Timer 2 and prescaler temporarily stopped are restarted.
Timer control register W2
b3
b0
✕1 0 1
b0
Timer control register PA
1
b2: Timer 2 operation start [TW2A]
Prescaler start [TPAA]
↓
➅ Enable Interrupts
The Timer 2 interrupt which is temporarily disabled is enabled.
Interrupt control register V1
Interrupt enable flag INTE
b3
b0
1 ✕✕✕
1
b3: Timer 2 interrupt occurrence enabled [TV1A]
All interrupts enabled [EI]
↓
Constant period interrupt execution started
*A: The prescaler count value and timer 2 count value to make the interrupt occur every 1 ms are set as follows.
1 ms ≅ (4.0 MHz)-1 ✕ 3 ✕ (15 +1) ✕ (82 +1)
System clock Instruction
clock
Prescaler
count value
Timer 2 count value
“✕”: it can be “0” or “1.”
“[ ]”: instruction
Fig. 2.2.6 Timer 2 constant period interrupt setting example
Rev.2.00 Aug, 06 2004
REJ09B0107-0200Z
2-28