23.5.6 Events

The TCC can generate the following events:

Table 23-8. TCC Event Generators
Generator NameDescriptionEvent TypeGenerating Clock DomainLength of Event
PeripheralEvent
TCCnOVFOverflow/UnderflowPulseGCLK_TCCnOne GCLK_TCCn period
TRGTriggerPulseGCLK_TCCnOne GCLK_TCCn period
CNTCounterPulseGCLK_TCCnOne GCLK_TCCn period
MC_nCompare Match or Capture on compare/capture channel nPulseGCLK_TCCnOne GCLK_TCCn period

Writing a ‘1’ to an Event Output Enable bit in the Event Control register (EVCTRL.xxEO) enables the corresponding output event. Writing a ‘0’ to this bit disables the corresponding output event.

The TCC can connect to the following events:

Table 23-9. Event Users
User NameDescriptionInput DetectionChannel Path Type
PeripheralInput
TCCnEV_nEvent Input nLevel/EdgeAsynchronous
MC_nCapture event nRising EdgeAsynchronous

Writing a ‘1’ to an Event Input Enable bit in the Event Control register (EVCTRL.xxEI) enables the corresponding action on an input event. Writing a ‘0’ to this bit disables the corresponding action on an input event.

Note: EVn input detection depends on the configuration of the Timer/Counter Event n Invert Enable bit in the Event Control register (EVCTRL.TCINVn) and the Timer/Counter Event Input n Action bit fields in the Event Control register (EVCTRL.EVACTn).

The event users can trigger the following actions:

Table 23-10. Event Actions
Event InputEvent ActionDescription
EV_0RETRIGGERCounter retrigger
COUNTEVCount on event (increment or decrement, depending on counter direction)
STARTCounter start - Start counting on the event rising edge. Further events will not restart the counter; the counter will keep on counting using prescaled GCLK_TCCn, until it reaches TOP or ZERO, depending on the direction
INCCounter increment on event. This will increment the counter, irrespective of the counter direction
COUNT_ASYNCCount during active state of an asynchronous event (increment or decrement, depending on counter direction). In this case, the counter will be incremented or decremented on each cycle of the prescaled clock, as long as the event is active
STAMPCapture Time-stamp (overflow)
FAULT_ASYNCNon-recoverable fault
EV_1RETRIGGERCounter retrigger
DIR_ASYNCCounter direction control
STOPStop the counter
DECDecrement the counter on event
PWP_ASYNCPeriod and pulse width capture
FAULT_ASYNCNon-recoverable fault
MC_nCapture event
Generate a recoverable or non-recoverable fault

Refer to the EVSYS - Event System chapter for details on configuring the event system.

Note:
  1. Counter retrigger is not supported if RAMP2 operation is used with a prescaler (CTRLA.PRESCALER != 0). RAMP2 operation can use the retrigger option only if the counter retrigger is synchronized with the next prescaler clock (CTRLA.PRESCYNC = PRESC).
  2. If a retrigger event occurs exactly at the time a channel compare match occurs, the next waveform will be corrupted. To avoid this issue, use two channels to store two successive CC register values (n and n+1) and combine the related waveform outputs to provide signal redundancy.
  3. See the Capture Operations and Recoverable Faults sections for more information on the Match or Capture input events (MCn).