Selection Of Counting Mode - Fujitsu MB91150 Series Hardware Manual

32-bit microcontroller
Table of Contents

Advertisement

CHAPTER 6 8/16-BIT UP/DOWN COUNTER/TIMER
6.4

Selection of Counting Mode

This timer/counter has four counting modes. The CMS1 and CMS0 bits of the CCR
register can be used to select these counting modes.
I Selecting counting mode
Table 6.4-1 "Selecting timer counting mode" lists the count modes that can be selected by the
CMS1 and CMS0 bits.
Table 6.4-1 Selecting timer counting mode
CMS1, CMS0
00
01
10
11
I 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.
I 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.4-2 Selecting the detection edge
CES1, CES0
00
01
10
11
I 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 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.
For the phase difference between AIN pin input and BIN pin input in two multiplication or four
178
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

Advertisement

Table of Contents
loading

Table of Contents