Data Sheet

658
Atmel | SMART SAM D21 [DATASHEET]
Atmel-42181G–SAM-D21_Datasheet–09/2015
Recoverable State x Output Value bit in the Driver Control register.(DRVCTRL.NRE and DRVCTRL.NRV) and the Stop
bit in the Status register is set (STATUS.STOP).
Retrigger Command and Event Action
A retrigger command can be issued from software by using TCC Command bits in Control B Set register
(CTRLBSET.CMD = RETRIGGER) or when the retrigger event action is configured in the Input Event0/1 Action bits in
Event Control register (EVCTRL.EVACT1 = RETRIGGER).
When the command is detected during counting operation, the counter will be reloaded or cleared, depending on the
counting direction (CTRLSET.DIR or CTRLBCLR.DIR). The Retrigger bit will be set in the Interrupt Flag Status and Clear
register (INTFLAG.TRG). It is also possible to generate an event by writing a one to the Retrigger Event Output Enable
bit in the Event Control register (EVCTRL.TRGEO).
If the retrigger command is detected when the counter is stopped, the counter will resume counting operation from the
value in COUNT.
Note: When re-trigger event action is enabled, enabling the counter will not start the counter. The counter will start on the
next incoming event and restart on corresponding following event.
Start Event Action
The start action can be selected in the Event Control register (EVCTRL.EVACT0) and can be used to start the counting
operation when stopped. As consequence, the event has no effect if the counter is already counting. When the module is
enabled, the counter operation starts when the event is received or when a retrigger software command is applied.When
retrigger or start event action is enabled, enabling counter will not start the counter. The counter will start on the next
incoming event and restart on corresponding following event. If the event action is disabled, enabling counter will start
the counter.
Count Event Action
The count action can be selected in the Event Control register (EVCTRL.EVACT0) and can be used to count external
events (from pins for example). When an event is received, the counter is incremented or decremented, depending on
direction settings (CTRLBSET.DIR or CTRLBCLR.DIR).
Direction Event Action
The direction event action can be selected in the Event Control register (EVCTRL.EVACT1). When this event is used,
the asynchronous event path specified in the event system must be configured or selected. The direction event action
can be used to control the direction of the counter operation, depending on external events level. When received, the
event level overrides the Direction settings (CTRLBSET.DIR or CTRLBCLR.DIR) and the direction bit value is updated
accordingly.
Increment Event Action
The increment event action can be selected in the Event Control register (EVCTRL.EVACT0) and can be used to change
the counter state when an event is received. When the TCE0 event is received, the counter increments, whatever
direction settings (CTRLBSET.DIR or CTRLBCLR.DIR) is.
Decrement Event Action
The decrement event action can be selected in the Event Control register (EVCTRL.EVACT1) and can be used to
change the counter state when an event is received. When the TCE1 event is received, the counter decrements,
whatever direction settings (CTRLBSET.DIR or CTRLBCLR.DIR) is.
Non-Recoverable Fault Event Action
Non-recoverable fault actions can be selected in the Event Control register (EVCTRL.EVACT0 or EVCTRL.EVACT1).
When received, the counter will be stopped and compare channels outputs are overridden according to DRVCTRL
register settings (Non-Recoverable State x Output Enable bits and Non-Recoverable State x Output Value bits).