AT91M40400-25C ATMEL Corporation, AT91M40400-25C Datasheet - Page 86

no-image

AT91M40400-25C

Manufacturer Part Number
AT91M40400-25C
Description
16/32-bit Microcontroller, 2.7V to 3.6V Operating Range
Manufacturer
ATMEL Corporation
Datasheet
Clock Control
The clock of each counter can be controlled in two different
ways: it can be enabled/disabled and started/stopped.
Figure 43. Clock Control
Selected
Counter
Clock
The clock can be enabled or disabled by the user with
the CLKEN and the CLKDIS commands in the Control
Register. In Capture Mode it can be disabled by an RB
load event if LDBDIS is set to 1 in TC_CMR. In
Waveform Mode, it can be disabled by an RC Compare
event if CPCDIS is set to 1 in TC_CMR. When disabled,
the start or the stop actions have no effect: only a
CLKEN command in the Control Register can re-enable
the clock. When the clock is enabled, the CLKSTA bit is
set in the Status Register.
The clock can also be started or stopped: a trigger
(software, synchro, external or compare) always starts
the clock. The clock can be stopped by an RB load event
in Capture Mode (LDBSTOP = 1 in TC_CMR) or a RC
compare event in Waveform Mode (CPCSTOP = 1 in
TC_CMR). The start and the stop commands have effect
only if the clock is enabled.
Clock
86
Q
S
R
AT91M40400
Trigger
CLKSTA
Q
CLKEN
R
S
Event
Stop
CLKDIS
Disable
Event
Timer Counter Operating Modes
Each Timer Counter channel can independently operate in
two different modes:
The Timer Counter Operating Mode is programmed with
the WAVE bit in the TC Mode Register. In Capture Mode,
TIOA and TIOB are configured as inputs. In Waveform
Mode, TIOA is always configured to be an output and TIOB
is an output if it is not selected to be the external trigger.
Trigger
A trigger resets the counter and starts the counter clock.
Three types of triggers are common to both modes, and a
fourth external trigger is available to each mode.
The following triggers are common to both modes:
The Timer Counter channel can also be configured to have
an external trigger. In Capture Mode, the external trigger
signal can be selected between TIOA and TIOB. In Wave-
form Mode, an external event can be programmed on one
of the following signals: TIOB, XC0, XC1 or XC2. This
external event can then be programmed to perform a trig-
ger by setting ENETRG in TC_CMR.
If an external trigger is used, the duration of the pulses
must be longer than the system clock (MCKI) period in
order to be detected.
Whatever the trigger used, it will be taken into account at
the following active edge of the selected clock. This means
that the counter value may not read zero just after a trigger,
especially when a low frequency signal is selected as the
clock.
Capture Mode allows measurement on signals
Waveform Mode allows wave generation
Software Trigger: Each channel has a software trigger,
available by setting SWTRG in TC_CCR.
SYNC: Each channel has a synchronization signal
SYNC. When asserted, this signal has the same effect
as a software trigger. The SYNC signals of all channels
are asserted simultaneously by writing TC_BCR (Block
Control) with SYNC set.
Compare RC Trigger: RC is implemented in each
channel and can provide a trigger when the counter
value matches the RC value if CPCTRG is set in
TC_CMR.

Related parts for AT91M40400-25C