Operation Of The 8/16-Bit Up/Down Counters/Timers - Fujitsu FR60 Hardware Manual

Hide thumbs Also See for FR60:
Table of Contents

Advertisement

6.1.3

Operation of the 8/16-bit Up/Down Counters/Timers

This section describes the 8/16-bit up/down counter/timer operation
■ Selecting Counting Mode
The 8/16-bit up/down counters/timers have four counting modes. The CMS1 and CMS0 bits of the CCR
register are used to select the counting modes. Table 6.1-1 lists the values of the CMS1 and CMS0 bits and
corresponding counting modes.
Table 6.1-1 Selecting Timer Counting Mode
CMS1, CMS0
00
01
10
11
(a) Timer mode [down count]
In timer mode, the output of the internal prescaler is used for counting down. For the internal prescaler,
either two machine cycles or eight machine cycles can be selected with the CLKS bit of the CCRH register.
(b) Up/down counting mode
In up/down counting mode, counting up/down is performed by counting the input through external pin AIN
and BIN. The input through the AIN pin controls counting up and the input through the BIN pin controls
counting down.
The inputs through the AIN pin and BIN pin are subject to edge-detected. The edge detection can be
selected by the CES1 and CES0 bits of the CCRH register. Table 6.1-2 lists the values of the CES1 and
CES0 bits and the corresponding detection edges.
Table 6.1-2 Selecting the Detection Edge
CES1, CES0
00
01
10
11
(c) Phase difference counting mode (two multiplication/four multiplication)
In phase difference counting mode, to count the phase difference between phase A and phase B of the
encoder output signal, detect the input level of the BIN pin at input edge detection of the AIN pin and
detect the input level of the AIN pin at input edge detection of the BIN pin.
Timer mode [down count]
B
Up/down counting mode
B
Phase difference counting mode, 2 multiplication
B
Phase difference counting mode, 4 multiplication
B
Disables the edge detection.
B
Detects rising edge.
B
Detects falling edge.
B
Detects both falling and rising edges.
B
Counting mode
Detection edge
259

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb91350a series

Table of Contents