
R01UH0336EJ0102 Rev.1.02
Page 985 of 1538
Jul 17, 2014
V850E2/PG4-L
Section 18 Encoder Timer (ENCA)
(3)
Overflow Operation
An overflow occurs when up-counting is performed when the counter value is
FFFF
H
. When an overflow occurs, an overflow interrupt (INTENCAnIOV) is
output, and the overflow flag (ENCAnOVF) is set to "1". The overflow flag
(ENCAnOVF) is cleared to "0" when "1" is set to the overflow clear bit
(ENCAnCLOV).
Operations in the generation of an overflow and clearing of the overflow flag
are described below.
Figure 18-3
Generation of an Overflow and Settings to Clear the Overflow Flag
1. From label 1 in the figure, the counter value increases from FFFE
H
to
FFFF
H
.
2. From label 2, the counter overflows when its value changes from FFFF
H
to
0000
H
. At the same time, an overflow interrupt is output and the overflow
flag is set to 1.
3. Label 3 indicates the method for clearing of the overflow flag; i.e. the
overflow flag is cleared to 0 by setting ENCAnFGC.ENCAnCLOV to 1.
Alternatively, the overflow flag may be cleared by setting
ENCAnTS.ENCAnTS to 1 while ENCAnTE.ENCAnTE = 0, or by placing
the signal input as ENCAnTSST (simultaneous start trigger input) at the
high level.
PCLK
ENCAnCNT register
ENCAnCSF flag
Counter clock
ENCAnOVF flag
INTENCAnIOV interrupt
ENCAnCLOV bit
= H (counting up)
FFFC
H
FFFD
H
FFFE
H
FFFF
H
0000
H
0001
H
0002
H
Overflow occurs
ENCAnOVF flag is output
ENCAnOVF
flag is cleared
INTENCAnIOV interrupt is output
.
Overflow flag clear bit is set
1
2
3
Содержание V850 Series
Страница 1556: ...V850E2 PG4 L R01UH0336EJ0102 Back Cover ...