|
4524_M Datasheet, PDF (193/310 Pages) Renesas Technology Corp – 4-BIT CISC SINGLE-CHIP MICROCOMPUTER 720 FAMILY / 4500 SERIES | |||
|
◁ |
4524 Group
APPLICATION
2.2 Interrupts
â Disable Interrupts
Timer 3 interrupt is temporarily disabled.
Interrupt enable flag INTE
Interrupt control register V2
0
b3
b0
âââ 0
All interrupts disabled [DI]
b0: Timer 3 interrupt occurrence disabled [TV2A]
â Stop Timer Operation
Timer 3 and prescaler are temporarily stopped.
Timer 3 count source is selected.
b3
Timer control register W3 0 0
â
b0
01
b0
Timer control register PA
0
[TW3A]
b3: Timer 3 count auto-stop circuit not selected
b2: Timer 3 stop
b1, b0: Prescaler output (ORCLK) selected for
Timer 3 count source
Prescaler stop [TPAA]
â
â Set Timer Value and Prescaler Value
Timer 3 and prescaler count times are set. (The formula is shown *A below.)
Timer 3 reload register R3 â5216â
Timer count value 82 set [T3AB]
Prescaler reload register RPS â0F16â
Prescaler count value 15 set [TPSAB]
â
â Clear Interrupt Request
Timer 3 interrupt activated condition is cleared.
Timer 3 interrupt request flag T3F 0
Timer 3 interrupt activated condition cleared [SNZT3]
â
( ) Note when the interrupt request is cleared
When â is executed, considering the skip of the next instruction
according to the interrupt request flag T3F,
insert the NOP instruction after the SNZT3 instruction.
â
â Start Timer Operation and Prescaler Operation
Timer 3 and prescaler temporarily stopped are restarted.
b3
b0
Timer control register W3 0 1 0 1
b0
Timer control register PA
1
b2: Timer 3 operation start [TW3A]
Prescaler start [TPAA]
â
â
Enable Interrupts
The Timer 3 interrupt which is temporarily disabled is enabled.
Interrupt control register V2
b3
b0
â â â 1 b0: Timer 3 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 3 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 3 count value
âââ: it can be â0â or â1.â
â[ ]â: instruction
Fig. 2.2.7 Timer 3 constant period interrupt setting example
Rev.2.00 Aug, 06 2004
REJ09B0107-0200Z
2-29
|
▷ |