Fig. 2.3.7 Timer Start By External Input Setting Example (1) - 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.
Interrupt control register V1
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.
Set Port
P3
/INT0 pin is set to INT0 input.
0
Set Valid Waveform
Valid waveform of INT0 pin is selected. Timer 1 control is enabled.
Clear Interrupt Request
Timer 1 interrupt activated condition is cleared.
INT0 interrupt activated condition is cleared.
Timer 1 interrupt request flag T1F
INT0 interrupt request flag EXF0
Note when the interrupt request is cleared
When
interrupt request flags T1F and EXF0, insert the NOP instruction after the SNZT1
and SNZ0 instructions.
Enable Interrupts
The timer 1 interrupt which is temporarily disabled is enabled.
Interrupt control register V1
" ": it can be "0" or "1."

Fig. 2.3.7 Timer start by external input setting example (1)

2-36
Interrupt enable flag INTE
Timer control register W1
Timer 1 reload register R1 "52
Port P3
output latch
0
Interrupt control register I1
is executed, considering the skip of the next instruction according to the
Interrupt enable flag INTE
4513/4514 Group User's Manual
"0"
All interrupts disabled (DI instruction)
b3
b0
0
0
Timer 1 interrupt occurrence disabled
(TV1A instruction)
INT0 interrupt occurrence disabled
b3
b0
Timer 1 stop (TW1A instruction)
0 0
0
Prescaler stop
Prescaler divided by 4 selected
Timer count value 82 set (T1AB instruction)
"
16
b3
b0
INT0 input set (OP3A instruction)
1
b3
b0
Rising edge detected (TI1A instruction)
1 0
1
g 0 h
Timer 1 interrupt activated condition cleared
"0"
(SNZT1 instruction)
INT0 interrupt activated condition cleared
"0"
(SNZ0 instruction)
b3
b0
Timer 1 interrupt occurrence enabled
1
(TV1A instruction)
"1"
All interrupts enabled (EI instruction)
Timer start by external input

Advertisement

Table of Contents
loading

This manual is also suitable for:

4514

Table of Contents