
757
SAM G51 [DATASHEET]
11209C–ATARM–20-Dec-13
31.6.13 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 EEVT parameter in TC_CMR selects the external trigger. The EEVTEDG parameter 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 an output and the compare register
B is not used to generate waveforms and subsequently no IRQs. In this case the TC channel can only generate a
waveform on TIOA.
When an external event is defined, it can be used as a trigger by setting bit ENETRG in the TC_CMR.
As in Capture Mode, the SYNC signal and the software trigger are also available as triggers. RC Compare can also be
used as a trigger depending on the parameter WAVSEL.
31.6.14 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 trigger, 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 output as
defined in the corresponding parameter in TC_CMR.
31.6.15 2-bit Gray Up/Down Counter for Stepper Motor
Each channel can be independently configured to generate a 2-bit gray count waveform on corresponding TIOA, TIOB
outputs by means of the GCEN bit in TC_SMMRx.
Up or Down count can be defined by writing bit DOWN in TC_SMMRx.
It is mandatory to configure the channel in WAVE mode in the TC_CMR.
The period of the counters can be programmed in TC_RCx.
Figure 31-16. 2-bit Gray Up/Down Counter
TIOAx
TIOBx
DOWNx
TC_RCx
WAVEx = GCENx =1