Writing Data To Up/Down Count Register (Udcr) - Fujitsu F2MC-16LX Hardware Manual

Mb90470 series 16-bit microcontroller
Hide thumbs Also See for F2MC-16LX:
Table of Contents

Advertisement

CHAPTER 13 8/16-BIT UP/DOWN COUNTER/TIMER

13.3.2 Writing data to up/down count register (UDCR)

Writing data directly to UDCR from a bus is not permitted. This section includes
procedures for writing data to UDCR.
I Writing data to UDCR
Data can be written to UDCR with the following procedures:
1. Data to be written to UDCR is first saved to RCR. Make sure that RCR data is discarded.
2. Writing "1" to CCRH: CTUT transfers the data from RCR to UDCR.
I Clearing the counter
The following procedures are available for clearing the counter in addition to the above
procedures:
Clearing with reset input (initialize)
Clearing with an edge input from the ZIN pin
Clearing by writing "0" to CCRH: UDCC
Clearing with the compare function
Such a write operation is performed regardless of the occurrence of count start/stop.
I Count clear/gate function
The ZIN pin is selected by CCRH: CGSC for use as either a count clear or gate function.
If the count clear function starts, the counter is cleared at the edge input from the ZIN pin. The
edge of the ZIN pin input signal used to clear the count is selected using CCRL: CGE1/CGE0.
This function is used to input the phase Z output of the encoder to the pin, enabling UDCR to be
cleared at the start of encoder counting.
If the gate function starts, the count is enabled or disabled depending on the level input from the
ZIN pin. The level of the ZIN pin input signal used to enable the count is selected using CCRL:
CGE1/CGE0.
This function is available for all count modes.
Table 13.3-4 Selection of ZIN pin function
CGSC
ZIN pin function
0B
Counter clear function
1B
Gate function
270
CGE1, CGE0
Counter clear function
00B
Detect prohibited
01B
Rising edge
10B
Falling edge
Gate function
Detect prohibited
Low level
High level

Advertisement

Table of Contents
loading

Table of Contents