Справочник Пользователя для Fujitsu FR81S
CHAPTER 27: UP/DOWN COUNTER
6. Operation and Setting Procedure Examples
FUJITSU SEMICONDUCTOR LIMITED
CHAPTER : UP/DOWN COUNTER
FUJITSU SEMICONDUCTOR CONFIDENTIAL
FUJITSU SEMICONDUCTOR CONFIDENTIAL
29
Operation performed when the reload compare function is in use
The reload function is used at counting down and the compare function is used at counting up.
Figure 6-5 shows operation performed when the reload compare function is in use.
Figure 6-5 Operation Performed When the Reload Compare Function is in Use
Checking counting direction
This mode involves both the counting up and counting down. So, the counting direction can be confirmed
with the UDF1 and UDF0 bits of the counter status register (CSR). These bits are rewritten each time
counting occurs, so enabling the current counting direction to be checked. These bits are useful to know the
rotation direction during motor control or the like.
with the UDF1 and UDF0 bits of the counter status register (CSR). These bits are rewritten each time
counting occurs, so enabling the current counting direction to be checked. These bits are useful to know the
rotation direction during motor control or the like.
Table 6-2 lists the counting directions indicated with the UDF1 and UDF0 bits.
Table 6-2 Correspondence between UDF1 and UDF0 Bits and Counting Directions
UDF1
UDF0
Count direction
0
0
No input
0
1
Counting down
1
0
Counting up
1
1
Concurrent generation of counting up and counting down
If the counting direction is inverted one or more times from the counting down to counting up or vice versa,
the CDCF bit of the counter control register (CCR) changes to "1". In this case, a direction change interrupt
request can also be generated. So, using the CDCF bit and the direction change interrupt request, you can
check whether the counting direction has been inverted.
the CDCF bit of the counter control register (CCR) changes to "1". In this case, a direction change interrupt
request can also be generated. So, using the CDCF bit and the direction change interrupt request, you can
check whether the counting direction has been inverted.
Note:
If the counting direction is continuously changed in a short period of time, the counting direction is restored
and so the direction indicated with the UDF1 and UDF0 bits of the counter status register (CSR) may be the
same as the direction set before the CDCF bit changes to "1".
and so the direction indicated with the UDF1 and UDF0 bits of the counter status register (CSR) may be the
same as the direction set before the CDCF bit changes to "1".
RCR
RCR : Reload compare register
Reload
00
H
FF
H
Counter clear
Compare
result match
result match
Underflow
Compare
result match
result match
Compare
result match
result match
Counter clear
Counter clear
Underflow
Underflow
Reload
Reload
MB91520 Series
MN705-00010-1v0-E
1036