25.3.3.2.1 Frequency Waveform Generation

In Frequency Waveform Generation mode, the TCFn.CMP register controls the period time (T). The corresponding waveform generator output is toggled on each compare match between the TCFn.CNT and TCFn.CMPn registers.

The following equation defines the waveform frequencyfFRQ:

f FRQ = f CLK_TCF 2 N ( CMP + 1 )

where N represents the prescaler divider used (see the PRESC bit field in the TCFn.CTRLA register), and fCLK_TCF is the TCF clock frequency.

The maximum frequency of the waveform generated is half of the peripheral clock frequency (fCLK_TCF/2) when TCFn.CMP is set to 0x0000 and no prescaling is used (N = 1, PRESC = 0x0 in TCFn.CTRLA).

The OVF interrupt/event is generated on every overflow. The CMP0 and CMP1 interrupts/events are generated on alternating overflows - each occurs once every PWM period with half the period in between.

Figure 25-4. Frequency Waveform Generation