Fig. 2.3.3 Constant Period Measurement Setting Example - Renesas 4513 User Manual

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

Advertisement

APPLICATION
2.3 Timers
Disable Interrupts
Timer 1 interrupt is temporarily disabled.
Stop Timer Operation
Timer 1 and prescaler are temporarily stopped.
Dividing ratio of prescaler is selected.
Set Timer Value
Timer 1 count time is set. (The formula is shown
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 1 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
A The prescaler dividing ratio and timer 1 count value to make the interrupt occur
every 4 ms are set as follows.
4 ms
(4.0 MHz)
" ": it can be "0" or "1."

Fig. 2.3.3 Constant period measurement setting example

2-32
Interrupt enable flag INTE
Interrupt control register V1
Timer control register W1
Timer 1 reload register R1 "F9
is executed, considering the skip of the next instruction according to the
Timer control register W1
Interrupt enable flag INTE
Constant period interrupt execution start
–1
3
16
System clock Instruction
Prescaler
clock
dividing
ratio
4513/4514 Group User's Manual
"0"
All interrupts disabled (DI instruction)
b3
b0
Timer 1 interrupt occurrence disabled
0
(TV1A instruction)
b3
b0
Timer 1 stop (TW1A instruction)
0 1
0
Prescaler stop
Prescaler divided by 16 selected
A below.)
"
Timer count value 249 set (T1AB instruction)
16
Timer 1 interrupt activated condition cleared
g0 h
(SNZT1 instruction)
b3
b0
Timer 1 operation start (TW1A instruction)
1 1
1
Prescaler operation start
b3
b0
Timer 1 interrupt occurrence enabled
1
(TV1A instruction)
"1"
All interrupts enabled (EI instruction)
(249+1)
Timer 1
count
value

Advertisement

Table of Contents
loading

This manual is also suitable for:

4514

Table of Contents