34.6.5.3 Events

The TCC can generate the following output events:
  • Overflow/Underflow (OVF)
  • Trigger (TRG)
  • Counter (CNT) For additional information, refer to EVCTRL.CNTSEL description.
  • Compare Match or Capture on compare/capture channels: MCx
Writing a '1' ('0') to an Event Output bit in the Event Control Register (EVCTRL.xxEO) enables (disables) the corresponding output event. For further information, refer to the EVSYS – Event System.
The TCC can take the following actions on a channel input event (MCx):
  • Capture event
  • Generate a recoverable or non-recoverable fault
The TCC can take the following actions on counter Event 1 (TCCx EV1):
  • Counter re-trigger
    • Not supported with dithering or if RAMP2 operation is used with a prescaler (CTRLA.PRESCALER !=0). RAMP2 operation can use the re-trigger option only if the counter re-trigger of the counter is synchronized with the next prescaler clock (CTRLA.PRESCYNC = PRESC).
    • If a re-trigger 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.
  • Counter direction control
  • Stop the counter
  • Decrement the counter on event
  • Period and pulse width capture
  • Non-recoverable fault
The TCC can take the following actions on counter Event 0 (TCCx EV0):
  • Counter re-trigger
    • Not supported with dithering or if RAMP2 operation is used with a prescaler (CTRLA.PRESCALER !=0). RAMP2 operation can use the re-trigger option only if the counter re-trigger of the counter is synchronized with the next prescaler clock (CTRLA.PRESCYNC = PRESC).
    • If a re-trigger 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.
  • Count on event (increment or decrement, depending on counter direction)
  • Counter start - Start counting on the event rising edge. Further events will not restart the counter; the counter will keep on counting using prescaled GCLK_TCCx, until it reaches TOP or ZERO, depending on the direction.
  • Counter increment on event. This will increment the counter, irrespective of the counter direction.
  • Count 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.
  • Non-recoverable fault

The counter Event Actions are available in the Event Control registers (EVCTRL.EVACT0 and EVCTRL.EVACT1). For additional information, refer to EVCTRL.

Writing a '1' ('0') to an Event Input bit in the Event Control register (EVCTRL.MCEIx or EVCTRL.TCEIx) enables (disables) the corresponding action on input event. When TCC input events are used, the respective channel path of the Event System must be configured as Asynchronous path (CHANNELx.PATH = 0x2).

Note: When several events are connected to the TCC, the enabled action will apply for each of the incoming events. Refer to the EVSYS – Event System for details on how to configure the event system.