40.7.2.2 Control B Clear

This register allows the user to clear bits in the CTRLB register without doing a read-modify-write operation. Changes in this register will also be reflected in the Control B Set register (CTRLBSET).

Name: CTRLBCLR
Offset: 0x04
Reset: 0x00
Property: PAC Write-Protection, Read-Synchronized, Write-Synchronized

Bit 76543210 
 CMD[2:0]  ONESHOTLUPDDIR 
Access R/WR/WR/WR/WR/WR/W 
Reset 000000 

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

These bits are used for software control of the TC. The commands are executed on the next prescaled GCLK_TC clock cycle. When a command is executed, the CMD bit group is read back as zero.

Writing ‘0x0’ to these bits has no effect.

Writing a ‘1’ to any of these bits clears the pending command.

Bit 2 – ONESHOT One-Shot on Counter

This bit controls one-shot operation of the TC.

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

Writing a ‘1’ to this bit disables one-shot operation.

ValueDescription
0The TC will wrap around and continue counting on an overflow/underflow condition.
1The TC will wrap around and stop on the next underflow/overflow condition.

Bit 1 – LUPD Lock Update

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

When CTRLB.LUPD is set, no update of the registers with the value of its buffered register is performed on the hardware UPDATE condition. Locking the update ensures that all buffer registers are valid before a hardware update is performed. After all the buffer registers are loaded correctly, the buffered registers can be unlocked.

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

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

Writing a ‘1’ to this bit clears the LUPD bit.

ValueDescription
0The CCBUFx and PERBUF buffer registers value are copied into CCx and PER registers on hardware update condition.
1The CCBUFx and PERBUF buffer registers value are not copied into CCx and PER registers on 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 clears the bit and make the counter count up.

ValueDescription
0The timer/counter is counting up (incrementing).
1The timer/counter is counting down (decrementing).