Fujitsu FR81S User Manual

Page of 2342
CHAPTER 27: UP/DOWN COUNTER 
 
 
6. Operation and Setting Procedure Examples 
 
FUJITSU SEMICONDUCTOR LIMITED 
CHAPTER : UP/DOWN COUNTER 
FUJITSU SEMICONDUCTOR CONFIDENTIAL 
23 
 Clear Events 
The counter value is cleared to "0000
H
" in one of the following events. 
·  This device is reset. 
·  An effective edge is entered from the ZIN pin. 
(If the CGSC bit of the counter control register (CCR) is set to make the ZIN pin work for the counter 
clear function (CGSC=0).) 
·  Software-triggered clear 
The UDCC bit of the counter control register (CCR) is written to "0". 
·  Clear due to the compare function 
The counter value matches the value set in the reload compare register (RCR) and an attempt is made to 
increment the counter. 
(The counter is not cleared if an attempt is made to decrement or stop the counter.) 
·  Clear due to overflow 
Count up/down timing after the counter reaches "FFFF
H
" (or "FF
H
" in 8-bit mode). 
The time the counter is cleared to "0000
H
" depends on the up/down counter operating status as follows. 
·  If a clear event occurs during counting, the counter will be cleared in synchronization with the count 
clock. 
 
Figure 6-2 shows clear event occurrence timing. 
Figure 6-2 Clear Event Occurrence Timing 
 
 
 
·  If a clear event occurs during counting and the counting stops before the next count clock pulse is entered 
(the CSTR bit of the counter status register (CSR) is "0"), the value will be cleared when the up/down 
counter stops. 
Figure 6-2 shows the clear event occurrence timing. 
 
 
 
 
 
 
 
 
UDCR 
Clear event 
Count clock 
UDCR : Up/down count register 
Synchronized with this clock pulse
 
0065
H
 
0066
H
 
0000
H
 
0001
H
 
MB91520 Series
MN705-00010-1v0-E
1030