23.6.3 Control B Set

This register allows the user to change its register value without performing a read-modify-write operation. Changes in this register will also be reflected in the Control B Clear (CTRLBCLR) register.
Note: This register is write-synchronized - SYNCBUSY.CTRLB must be checked to ensure that synchronization of the CTRLBCLR register is complete.
Name: CTRLBSET
Offset: 0x05
Reset: 0x00
Property: PAC Write-Protection, Write-Synchronized, Read-Synchronized

Bit 76543210 
 CMD[2:0]IDXCMD[1:0]ONESHOTLUPDDIR 
Access R/WR/WR/WR/WR/WR/WR/WR/W 
Reset 00000000 

Bits 7:5 – CMD[2:0] TCC Command

This bit field can be used for software control of retriggering and stopping commands of the TCC. When a command has been executed, the CMD bit field will be read back as zero. The commands are executed on the next prescaled GCLK_TCC clock cycle.

Writing 0x0 to this bit field has no effect

Writing a value other than 0x0 to this bit field will issue a command for execution.

Important: This command requires synchronization before being executed. A valid sequence is:
  • Issue CMD command (CTRLBSET.CMD = command)
  • Wait for CMD synchronization (SYNCBUSY.CTRLB = 0)
  • Wait for CMD read back as zero (CTRLBSET.CMD = 0)
ValueNameDescription
0x0NONENo action
0x1RETRIGGERForce start, restart or retrigger
0x2STOPForce stop
0x3UPDATEForce update of double buffered registers
0x4READSYNCForce a read synchronization of COUNT
0x5DMAOSOne-shot DMA trigger
OtherReserved

Bits 4:3 – IDXCMD[1:0] Ramp Index Command

This bit field can be used to force cycle A and cycle B changes in RAMP2 and RAMP2A operation. On a timer/counter update condition, the command is executed, the IDX flag in the STATUS register is updated, and the IDXCMD command is cleared.

Writing 0x0 to this bit field has no effect.

Writing a valid value to this bit field will set a command.

ValueNameDescription
0x0DISABLECommand disabled: IDX toggles between cycles A and B
0x1SETSet IDX: Cycle B will be forced in the next cycle
0x2CLEARClear IDX: Cycle A will be forced in next cycle
0x3HOLDHold IDX: The next cycle will be the same as the current cycle
OtherReserved

Bit 2 – ONESHOT One-Shot

This bit controls one-shot operation of the TCC. When in one-shot operation, the TCC will stop counting on the next overflow/underflow condition or a stop command.

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

Writing a ‘1’ to this bit will enable the one-shot operation.

ValueDescription
0The TCC will count continuously
1The TCC will stop counting on the next underflow/overflow condition

Bit 1 – LUPD Lock Update

This bit controls the update operation of the TCC buffered registers.

When the Lock Update bit is set, the value of the buffer registers will not be copied to their non-buffered counterparts during an UPDATE condition. Disabling the update ensures that all buffer registers can be updated to valid values before a hardware update is performed. After all the buffer registers have been loaded correctly, the buffered registers can be unlocked to allow the update to occur on the next UPDATE condition.

Note: This bit has no effect when input capture operation is enabled.

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

Writing a ‘1’ to this bit disables buffer registers updates on hardware UPDATE condition.

ValueDescription
0The values of the buffer registers are copied into the corresponding non-buffer registers on a hardware UPDATE condition
1The values of the buffer registers are not copied into the corresponding non-buffer registers on a hardware UPDATE condition

Bit 0 – DIR Counter Direction

This bit is used to change the direction of the counter.

Writing a ‘0’ to this bit has no effect

Writing a ‘1’ to this bit will clear the bit and cause the counter to count up.

Note: When counting down, the COUNT register must be initialized to TOP value (PER or CC0 value depending on the mode).
ValueDescription
0The timer/counter is counting up (incrementing)
1The timer/counter is counting down (decrementing)