40.8.1 Control A

Name: CTRLA
Offset: 0x00
Reset: 0x00000000
Property: PAC Write-Protection, Write-Synchronized, Enable-Protected

Bit 3130292827262524 
    CAPTMODE1[1:0] CAPTMODE0[1:0] 
Access R/WR/WR/WR/W 
Reset 0000 
Bit 2322212019181716 
   COPEN1COPEN0  CAPTEN1CAPTEN0 
Access R/WR/WR/WR/W 
Reset 0000 
Bit 15141312111098 
 DMAOS   ALOCKPRESCALER[2:0] 
Access R/WR/WR/WR/WR/W 
Reset 00000 
Bit 76543210 
 ONDEMANDRUNSTDBYPRESCSYNC[1:0]MODE[1:0]ENABLESWRST 
Access R/WR/WR/WR/WR/WR/WR/WW 
Reset 00000000 

Bits 28:27 – CAPTMODE1[1:0] Capture mode Channel 1

These bits select the channel 1 capture mode.
ValueNameDescription
0x0DEFAULTDefault capture
0x1CAPTMINMinimum capture
0x2CAPTMAXMaximum capture
0x3Reserved

Bits 25:24 – CAPTMODE0[1:0] Capture mode Channel 0

These bits select the channel 0 capture mode.
ValueNameDescription
0x0DEFAULTDefault capture
0x1CAPTMINMinimum capture
0x2CAPTMAXMaximum capture
0x3Reserved

Bits 20, 21 – COPENx Capture On Pin x Enable [x=1..0]

Bit x of COPEN[1:0] selects the trigger source for capture operation, either events or I/O pin input.

This bit is not synchronized.

ValueDescription
0Event from Event System is selected as trigger source for capture operation on channel x.
1I/O pin is selected as trigger source for capture operation on channel x.

Bits 16, 17 – CAPTENx Capture Channel x Enable [x=1..0]

Bit x of CAPTEN[1:0] selects whether channel x is a capture or a compare channel.

These bits are not synchronized.

ValueDescription
0CAPTEN disables capture on channel x.
1CAPTEN enables capture on channel x.

Bit 15 – DMAOS DMA One-Shot Trigger Mode

This bit enables the DMA One-shot Trigger Mode.

Writing a ‘1’ to this bit generates a DMA trigger on TC cycle following a TC_CTRLBSET_CMD_DMAOS command.

Writing a ‘0’ to this bit generates DMA triggers on each TC cycle.

This bit is not synchronized.

Bit 11 – ALOCK Auto Lock

When this bit is set, Lock bit update (LUPD) is set to ‘1’ on each overflow/underflow or re-trigger event.

This bit is not synchronized.

ValueDescription
0The LUPD bit is not affected on overflow/underflow and re-trigger event.
1The LUPD bit is set on each overflow/underflow or re-trigger event.

Bits 10:8 – PRESCALER[2:0] Prescaler

These bits select the counter prescaler factor.

These bits are not synchronized.

ValueNameDescription
0x0DIV1Prescaler: GCLK_TC
0x1DIV2Prescaler: GCLK_TC/2
0x2DIV4Prescaler: GCLK_TC/4
0x3DIV8Prescaler: GCLK_TC/8
0x4DIV16Prescaler: GCLK_TC/16
0x5DIV64Prescaler: GCLK_TC/64
0x6DIV256Prescaler: GCLK_TC/256
0x7DIV1024Prescaler: GCLK_TC/1024

Bit 7 – ONDEMAND Clock On Demand

This bit selects the clock requirements when the TC is stopped.

In Standby mode, if the Run in Standby bit (CTRLA.RUNSTDBY) is ‘0’, ONDEMAND is forced to ‘0’.

This bit is not synchronized.

ValueDescription
0The On Demand is disabled. If On Demand is disabled, the TC continues to request the clock when its operation is stopped (STATUS.STOP = 1).
1The On Demand is enabled. When On Demand is enabled, the stopped TC will not request the clock. The clock is requested when a software re-trigger command is applied or when an event with start/re-trigger action is detected.

Bit 6 – RUNSTDBY Run in Standby

This bit is used to keep the TC running in Standby mode.

This bit is not synchronized.

ValueDescription
0The TC is halted in standby.
1The TC continues to run in standby.

Bits 5:4 – PRESCSYNC[1:0] Prescaler and Counter Synchronization

These bits select whether the counter must wrap around on the next GCLK_TCx clock or the next prescaled GCLK_TCx clock. It also makes it possible to reset the prescaler.

These bits are not synchronized.

ValueNameDescription
0x0GCLKReload or reset the counter on next generic clock
0x1PRESCReload or reset the counter on next prescaler clock
0x2RESYNCReload or reset the counter on next generic clock. Reset the prescaler counter
0x3Reserved

Bits 3:2 – MODE[1:0] Timer Counter Mode

These bits select the Counter mode.

These bits are not synchronized.

ValueNameDescription
0x0COUNT16Counter in 16-bit mode
0x1COUNT8Counter in 8-bit mode
0x2COUNT32Counter in 32-bit mode
0x3Reserved

Bit 1 – ENABLE Enable

Due to synchronization, there is a delay from writing CTRLA.ENABLE until the peripheral is enabled/disabled. The value written to CTRLA.ENABLE reads back immediately and the ENABLE Synchronization Busy bit in the SYNCBUSY register (SYNCBUSY.ENABLE) is set. SYNCBUSY.ENABLE is cleared when the operation is complete.

This bit is not enable-protected.

ValueDescription
0The peripheral is disabled.
1The peripheral is enabled.

Bit 0 – SWRST Software Reset

Writing a ‘0’ to this bit has no effect.

Writing a ‘1’ to this bit resets all registers in the TC, except DBGCTRL, to their initial state and the TC is disabled.

Writing a ‘1’ to CTRLA.SWRST always takes precedence; all other writes in the same write-operation are discarded.

This bit is not enable-protected.