Fig. 2.2.5 Timer 1 Constant Period Interrupt Setting Example - Renesas 4513 User Manual

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

Advertisement

Disable Interrupts
Timer 1 interrupt is temporarily disabled.
Interrupt enable flag INTE
Interrupt control register V1
Stop Timer Operation
Timer 1 and prescaler are temporarily stopped.
Dividing ratio of prescaler is selected.
Timer control register W1
Set Timer Value
Timer 1 count time is set. (The formula is shown
Timer 1 reload register R1 "52
Clear Interrupt Request
Timer 1 interrupt activated condition is cleared.
Timer 1 interrupt request flag T1F "0"
Note when the interrupt request is cleared
When
interrupt request flag T1F, insert the NOP instruction after the SNZT1 instruction.
Start Timer Operation
Timer 1 and prescaler temporarily stopped are restarted.
Enable Interrupts
The Timer 1 interrupt which is temporarily disabled is enabled.
Interrupt control register V1
Interrupt enable flag INTE
A The prescaler dividing ratio and timer 1 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.5 Timer 1 constant period interrupt setting example

"0"
b3
b3
0 1
is executed, considering the skip of the next instruction according to the
b3
Timer control register W1
b3
Constant period interrupt execution start
–1
3
16
Prescaler
clock
dividing
ratio
4513/4514 Group User's Manual
All interrupts disabled (DI instruction)
b0
Timer 1 interrupt occurrence disabled
0
(TV1A instruction)
Timer 1 stop (TW1A instruction)
b0
0
Prescaler stop
Prescaler divided by 16 selected
A below.)
"
Timer count value 82 set (T1AB instruction)
16
g 0 h
Timer 1 interrupt activated condition cleared
(SNZT1 instruction)
b0
Timer 1 operation start (TW1A instruction)
1 1
1
Prescaler operation stop
b0
Timer 1 interrupt occurrence enabled
1
(TV1A instruction)
All interrupts enabled (EI instruction)
"1"
(82+1)
Timer 1
count
value
APPLICATION
2.2 Interrupts
2-21

Advertisement

Table of Contents
loading

This manual is also suitable for:

4514

Table of Contents