23.3.4.4.1 Waveform Generation
The compare channels can be used for waveform generation on the corresponding port pins. The following requirements are mandatory to make the waveform visible on the connected port pin:
- Select a Waveform Generation mode by writing the Waveform Generation Mode (WGMODE) bit field in the TCEn.CTRLB register.
- Enable the used compare channels (CMPnEN = ‘
1
’ in TCEn.CTRLB), thus overriding the output value for the corresponding pin. An alternative pin can be selected by configuring the Port Multiplexer (PORTMUX). Refer to the PORTMUX - Port Multiplexer section for details. - Optional: Enable the inverted waveform output for the associated port pin n. Refer to the PORT - I/O Pin Configuration section for details.
WGMODE[2:0] | Group Configuration | Mode of Operation | Top | Update | OVF |
---|---|---|---|---|---|
000 | NORMAL | Normal | PER | TOP/BOTTOM(1) | TOP/BOTTOM(1) |
001 | FRQ | Frequency | CMP0 | TOP/BOTTOM(1) | TOP/BOTTOM(1) |
010 | - | Reserved | - | - | - |
011 | SINGLESLOPE | Single-Slope PWM | PER | BOTTOM | 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 | BOTTOM |
Note: TOP for up-count and BOTTOM for down-count.