|
4524_M Datasheet, PDF (206/310 Pages) Renesas Technology Corp – 4-BIT CISC SINGLE-CHIP MICROCOMPUTER 720 FAMILY / 4500 SERIES | |||
|
◁ |
4524 Group
APPLICATION
2.3 Timers
â Disable Interrupts
Timer 1 interrupt is temporarily disabled.
Interrupt enable flag INTE
Interrupt control register V1
0
b3
b0
â0 ââ
All interrupts disabled [DI]
b2: Timer 1 interrupt occurrence disabled [TV1A]
â Stop Timer and Prescaler Operation
Timer 1 and prescaler are temporarily stopped.
Timer 1 count source is selected.
b3
Timer control register W1 0 0
Timer control register PA
â
b0
01
b0
0
[TW1A]
b3: Timer 1 count auto-stop circuit not selected
b2: Timer 1 stop
b1, b0: Prescaler output (ORCLK) selected for
Timer 1 count source
Prescaler stop [TPAA]
â
â Set Timer and Prescaler Values
Timer 1 and prescaler count times are set. (The formula is shown *A below.)
Timer 1 reload register R1 âF916â
Timer count value 249 set [T1AB]
Prescaler reload register RPS â0F16â
Prescaler count value 15 set [TPSAB]
â
â Clear Interrupt Request
Timer 1 interrupt activated condition is cleared.
Timer 1 interrupt request flag T1F 0
Timer 1 interrupt activated condition cleared [SNZT1]
â
( ) Note when the interrupt request is cleared
When â is executed, considering the skip of the next instruction
according to the interrupt request flag T1F,
insert the NOP instruction after the SNZT1 instruction.
â
â Start Timer and Prescaler Operation
Timer 1 and prescaler temporarily stopped are restarted.
b3
b0
Timer control register W1 0 1 0 1
b0
Timer control register PA
1
b2: Timer 1 operation start [TW1A]
Prescaler operation start [TPAA]
â
â
Enable Interrupts
The Timer 1 interrupt which is temporarily disabled is enabled.
Interrupt control register V1
Interrupt enable flag INTE
b3
b0
â1 ââ
1
b2: Timer 1 interrupt occurrence enabled [TV1A]
All interrupts enabled [EI]
â
Constant period interrupt execution started
*A: The prescaler count value and timer 1 count value to make the interrupt occur every 3 ms is set as follows.
3 ms = (4.0 MHz)-1 â 3 â (15+1) â (249+1)
System clock Instruction
clock
âââ: it can be â0â or â1.â
â[ ]â: instruction
Prescaler
count
value
Timer 1 count value
Fig. 2.3.4 Constant period measurement setting example
Rev.2.00 Aug, 06 2004
REJ09B0107-0200Z
2-42
|
▷ |