21.5.2 Control B - Normal Mode

Name: CTRLB
Offset: 0x01
Reset: 0x00
Property: -

Bit 76543210 
  CMP2ENCMP1ENCMP0ENALUPDWGMODE[2:0] 
Access R/WR/WR/WR/WR/WR/WR/W 
Reset 0000000 

Bits 4, 5, 6 – CMPEN Compare n Enable

In the FRQ or PWM Waveform Generation mode, these bits will override the PORT output register for the corresponding pin.
ValueDescription
0Port output settings for the pin with WOn output respected
1Port output settings for pin with WOn output overridden in FRQ or PWM Waveform Generation mode

Bit 3 – ALUPD Auto-Lock Update

The Auto-Lock Update feature controls the Lock Update (LUPD) bit in the TCAn.CTRLE register. When ALUPD is written to ‘1’, LUPD will be set to ‘1’ until the Buffer Valid (CMPnBV) bits of all enabled compare channels are ‘1’. This condition will clear LUPD.

It will remain cleared until the next UPDATE condition, where the buffer values will be transferred to the CMPn registers and LUPD will be set to ‘1’ again. This makes sure that CMPnBUF register values are not transferred to the CMPn registers until all enabled compare buffers are written.

ValueDescription
0LUPD in TCA.CTRLE not altered by system
1LUPD in TCA.CTRLE set and cleared automatically

Bits 2:0 – WGMODE[2:0] Waveform Generation Mode

These bits select the Waveform Generation mode and control the counting sequence of the counter, TOP value, UPDATE condition, interrupt condition, and type of waveform that is generated.

No waveform generation is performed in the Normal mode of operation. For all other modes, the result from the waveform generator will only be directed to the port pins if the corresponding CMPnEN bit has been set to enable this. The port pin direction must be set as output.

Table 21-5. Timer Waveform Generation Mode
WGMODE[2:0]Group ConfigurationMode of OperationTopUpdateOVF
000NORMALNormalPERTOPTOP
001FRQFrequencyCMP0TOPTOP
010-Reserved---
011SINGLESLOPESingle-slope PWMPERBOTTOMBOTTOM
100-Reserved---
101DSTOPDual-slope PWMPERBOTTOMTOP
110DSBOTHDual-slope PWMPERBOTTOMTOP and BOTTOM
111DSBOTTOMDual-slope PWMPERBOTTOMBOTTOM
ValueNameDescription
0x0NORMALNormal operation mode
0x1FRQFrequency mode
0x3SINGLESLOPESingle-slope PWM mode
0x5DSTOPDual-slope PWM mode
0x6DSBOTHDual-slope PWM mode
0x7DSBOTTOMDual-slope PWM mode
Other-Reserved