Fig. 2.2.7 Timer 3 Constant Period Interrupt Setting Example - Renesas 4513 User Manual

4500 series 4-bit single-chip microcomputer
Table of Contents

Advertisement

Disable Interrupts
Timer 3 interrupt is temporarily disabled.
Stop Timer 3 Operation
Timer 3 and prescaler are temporarily stopped.
Dividing ratio of prescaler is selected.
Set Timer Value
Timer 3 count time is set. (The formula is shown
Clear Interrupt Request
Timer 3 interrupt activated condition is cleared.
Timer 3 interrupt request flag T3F "0"
Note when the interrupt request is cleared
When
interrupt request flag T3F, insert the NOP instruction after the SNZT3 instruction.
Start Timer 3 Operation
Timer 3 and prescaler temporarily stopped are restarted.
Enable Interrupts
The timer 3 interrupt which is temporarily disabled is enabled.
Interrupt control register V2
A The prescaler dividing ratio and time 3 count value to make the interrupt occur every 1 ms are set as follows.
1 ms
(4.0 MHz)
System clock Instruction
" ": it can be "0" or "1."

Fig. 2.2.7 Timer 3 constant period interrupt setting example

Interrupt enable flag INTE
Interrupt control register V2
Timer control register W1
Timer control register W3
Timer 3 reload register R3 "52
is executed, considering the skip of the next instruction according to the
Timer control register W3
Timer control register W1
Interrupt enable flag INTE
Constant period interrupt execution start
–1
3
16
Prescaler
clock
dividing
ratio
4513/4514 Group User's Manual
"0"
All interrupts disabled (DI instruction)
b3
b0
Timer 3 interrupt occurrence disabled
0
(TV2A instruction)
b3
b0
Prescaler stop (TW1A instruction)
0 1
Prescaler divided by 16 selected
b3
b0
Timer 3 stop (TW3A instruction)
0
0
1
Prescaler selected for count source
A below.)
"
Timer count value 82 set (T3AB instruction)
16
Timer 3 interrupt activated condition cleared
g 0 h
(SNZT3 instruction)
b3
b0
Timer 3 operation start (TW3A instruction)
1
0
1
b3
b0
1 1
Prescaler operation start (TW1A instruction)
b3
b0
Timer 3 interrupt occurrence enabled
1
(TV2A instruction)
All interrupts enabled (EI instruction)
"1"
(82+1)
Timer 3
count
value
APPLICATION
2.2 Interrupts
2-23

Advertisement

Table of Contents
loading

This manual is also suitable for:

4514

Table of Contents