English
Language : 

4524_M Datasheet, PDF (194/310 Pages) Renesas Technology Corp – 4-BIT CISC SINGLE-CHIP MICROCOMPUTER 720 FAMILY / 4500 SERIES
4524 Group
APPLICATION
2.2 Interrupts
➀ Disable Interrupts
Timer 4 and serial I/O interrupts are temporarily disabled.
Interrupt enable flag INTE 0
Interrupt control register V2
b3
b0
0 ✕✕✕
All interrupts disabled [DI]
b3: Timer 4 and serial I/O interrupts occurrence disabled
[TV2A]
➁ Stop Timer and Prescaler Operation
Timer 4 and prescaler are temporarily stopped.
Timer 4 count source is selected.
b3
Timer control register W4 0 0
Timer control register PA
↓
b0
01
b0
0
[TW4A]
b3: CNTR1 output invalid
b2: PWM signal “H” interval expansion function invalid
b1: Timer 4 stop
b0: Prescaler output (ORCLK) divided by 2 selected
for Timer 4 count source
Prescaler stop [TPAA]
➂ Select Timer 4 Interrupt
Timer 4 is selected for the interrupt source.
Interrupt control register I3
↓
b0
0 Timer 4 interrupt valid [TI3A]
↓
➃ Set Timer Value and Prescaler Value
Timer 4 and prescaler count times are set. (The formula is shown *A below.)
Timer 4 reload register R4L “DD16”
Timer count value 221 set [T4AB]
Prescaler reload register RPS “9516”
Prescaler count value 149 set [TPSAB]
↓
➄ Clear Interrupt Request
Timer 4 interrupt activated condition is cleared.
Timer 4 interrupt request flag T4F 0
Timer 4 interrupt activated condition cleared [SNZT4]
↓
( ) Note when the interrupt request is cleared
When ➄ is executed, considering the skip of the next instruction
according to the interrupt request flag T4F,
insert the NOP instruction after the SNZT4 instruction.
↓
➅ Start Timer Operation and Prescaler Operation
Timer 4 and prescaler temporarily stopped are restarted.
Timer control register W4
b3
b0
0011
b0
Timer control register PA
1
b1: Timer 4 operation start [TW4A]
Prescaler start [TPAA]
↓
➆ Enable Interrupts
The Timer 4 interrupt which is temporarily disabled is enabled.
Interrupt control register V2
b3
b0
1 ✕ ✕ ✕ b3: Timer 4 interrupt occurrence enabled [TV2A]
Interrupt enable flag INTE 1
All interrupts enabled [EI]
↓
Constant period interrupt execution started
*A: The prescaler count value and timer 4 count value to make the interrupt occur every 50 ms are set as follows.
50 ms ≅ (4.0 MHz)-1 ✕ 3 ✕
System clock Instruction
clock
“✕”: it can be “0” or “1.”
“[ ]”: instruction
(149 +1) ✕ 2 ✕
Prescaler Timer 4
count value count
source
(221 +1)
Timer 4 count value
Fig. 2.2.8 Timer 4 constant period interrupt setting example
Rev.2.00 Aug, 06 2004
REJ09B0107-0200Z
2-30