
164
XMEGA A [MANUAL]
8077I–AVR–11/2012
14.12.2 CTRLB – Control register B
Bit 7:4 – CCxEN: Compare or Capture Enable
Setting these bits in the FRQ or PWM waveform generation mode of operation will override the port output register for the
corresponding OCn output pin.
When input capture operation is selected, the CCxEN bits enable the capture operation for the corresponding CC
channel.
Bit 3 – Reserved
This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this
register is written.
Bit 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/event condition, and type of waveform that is generated according to
Table 14-4 on pageNo 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 CCxEN bit has been set to enable this. The port pin
direction must be set as output
Table 14-4. Timer waveform generation mode.
Bit
76543210
+0x01
CCDEN
CCCEN
CCBEN
CCAEN
–
WGMODE[2:0]
Read/Write
R/W
R
R/W
Initial Value
00000000
WGMODE[2:0]
Group configuration
Mode of operation
Top
Update
OVFIF/Event
000
NORMAL
Normal
PER
TOP
001
FRQ
Frequency
CCA
TOP
010
Reserved
–
011
SINGLESLOPE
Single-slope PWM
PER
BOTTOM
100
Reserved
–
101
DSTOP
Dual-slope PWM
PER
BOTTOM
TOP
110
DSBOTH
Dual-slope PWM
PER
BOTTOM
TOP and BOTTOM
111
DSBOTTOM
Dual-slope PWM
PER
BOTTOM