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

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
Waveform Operating Mode
This mode is entered by setting the WAVE parameter in
TC_CMR (Channel Mode Register).
Waveform Operating Mode allows the TC Channel to gen-
erate 1 or 2 PWM signals with the same frequency and
independently programmable duty cycles, or to generate
different types of one-shot or repetitive pulses.
In this mode, TIOA is configured as output and TIOB is
defined as output if it is not used as an external event
(EEVT parameter in TC_CMR).
Figure 45 shows the configuration of the TC Channel when
programmed in Waveform Operating Mode.
Compare Register A, B and C (RA, RB, and RC)
In Waveform Operating Mode, RA, RB and RC are all used
as compare registers.
RA Compare is used to control the TIOA output. RB Com-
pare is used to control the TIOB (if configured as output).
RC Compare can be programmed to control TIOA and/or
TIOB outputs.
RC Compare can also stop the counter clock (CPCSTOP =
1 in TC_CMR) and/or disable the counter clock (CPCDIS =
1 in TC_CMR).
As in Capture Mode, RC Compare can also generate a trig-
ger if CPCTRG = 1. A trigger resets the counter so RC can
control the period of PWM waveforms.
External Event/Trigger Conditions
An external event can be programmed to be detected on
one of the clock sources (XC0, XC1, XC2) or TIOB. The
external event selected can then be used as a trigger.
The parameter EEVT in TC_CMR selects the external trig-
ger. The parameter EEVTEDG defines the trigger edge for
each of the possible external triggers (rising, falling or
both). If EEVTEDG is cleared (none), no external event is
defined.
If TIOB is defined as an external event signal (EEVT = 0),
TIOB is no longer used as output and the TC channel can
only generate a waveform on TIOA.
When an external event is defined, it can be used as a trig-
ger by setting bit ENETRG in TC_CMR.
As in Capture Mode, the SYNC signal, the software trigger
and the RC compare trigger are also available as triggers.
Output Controller
The output controller defines the output level changes on
TIOA and TIOB following an event. TIOB control is used
only if TIOB is defined as output (not as an external event).
The following events control TIOA and TIOB: software trig-
ger, external event and RC compare. RA compare controls
TIOA and RB compare controls TIOB. Each of these
events can be programmed to set, clear or toggle the out-
put as defined in the corresponding parameter in TC_CMR.
The tables below show which parameter in TC_CMR is
used to define the effect of each event.
If two or more events occur at the same time, the priority
level is defined as follows:
1. Software trigger
2. External event
3. RC compare
4. RA or RB compare
Status
The following bits in the status register are significant in
Waveform Mode:
Parameter
ASWTRG
AEEVT
ACPC
ACPA
Parameter
BSWTRG
BEEVT
BCPC
BCPB
CPAS: RA Compare Status
CPBS: RB Compare Status
CPCS: RC Compare Status
COVFS: Counter Overflow
ETRGS: External Trigger
there has been a RA Compare match at least once
since the last read of the status
there has been a RB Compare match at least once
since the last read of the status
there has been a RC Compare match at least once
since the last read of the status
Counter has attempted to count past $FFFF since the
last read of the status
External trigger has been detected since the last read
of the status
TIOA Event
Software trigger
External event
RC compare
RA compare
TIOB Event
Software trigger
External event
RC compare
RB compare
AT91M40400
89

Related parts for AT91M40400-25C