Fig. 2.2.6 Timer 2 Constant Period Interrupt Setting Example - Renesas 4513 User Manual

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

Advertisement

APPLICATION
2.2 Interrupts
Disable Interrupts
Timer 2 interrupt is temporarily disabled.
Interrupt control register V1
Stop Timer Operation
Timer is temporarily stopped.
Timer 2 count source is selected.
Set Timer Value
Timer 2 count time is set. (The formula is shown
Clear Interrupt Request
Timer 2 interrupt activated condition is cleared.
Timer 2 interrupt request flag T2F "0"
Note when the interrupt request is cleared
When
interrupt request flag T2F, insert the NOP instruction after the SNZT2 instruction.
Start Timer 2 Operation
Timer 2 temporarily stopped is restarted.
Enable Interrupts
The timer 2 interrupt which is temporarily disabled is enabled.
Interrupt control register V1
A The timer 2 count value to make the interrupt occur every about 2 s is set as follows.
2 s
(4.0 MHz)
System clock Instruction
" ": it can be "0" or "1."

Fig. 2.2.6 Timer 2 constant period interrupt setting example

2-22
Interrupt enable flag INTE
Timer control register W2
Timer 2 reload register R2 "27
is executed, considering the skip of the next instruction according to the
Timer control register W2
Interrupt enable flag INTE
Constant period interrupt execution start
16
–1
3
2
16-bit
clock
fixed
dividing
frequency
4513/4514 Group User's Manual
"0"
All interrupts disabled (DI instruction)
b3
b0
Timer 2 interrupt occurrence disabled
0
(TV1A instruction)
Timer 2 stop (TW2A instruction)
b3
b0
16-bit timer (WDT) underflow signal selected
0
1
1
for count source
A below.)
"
Timer count value 39 set (T2AB instruction)
16
Timer 2 interrupt activated condition cleared
(SNZT2 instruction)
b3
b0
Timer 2 operation start (TW2A instruction)
1
1
1
b3
b0
Timer 2 interrupt occurrence enabled
1
(TV1A instruction)
"1"
All interrupts enabled (EI instruction)
(39+1)
Timer 2
count
value

Advertisement

Table of Contents
loading

This manual is also suitable for:

4514

Table of Contents