1.3 Timer/Counter Type F
The TCF capabilities include frequency and waveform generation. The TCF consists of a base counter and a control logic, which can be set in different modes, each providing unique functionality. The base counter is clocked by a selectable clock source with optional prescaling. The TCF features the following characteristics:
- 24-Bit Timer/Counter
 - Operation Modes:
- Frequency Generation
 - Numerically Controlled
                        Oscillator (NCO) 
- Pulse-Frequency
 - Fixed Duty Cycle
 
 - 8-Bit PWM
 
 - 7-Bit Prescaler
 - Timer Overflow and Two Compare Match Events/Interrupts
 - Event Generation as Pulse or Waveform Output
 - Multiple Clock Sources
 
Depending on the operation mode, the peripheral’s registers functionality might be different. This chapter of the technical brief focuses on the NCO Fixed Duty Cycle mode.
In the NCO Fixed Duty Cycle Frequency Generation mode, the TCF operates by repeatedly adding at the input clock rate a fixed value (increment) defined by the Compare register to an accumulator (Counter register). The accumulator will overflow with a carry periodically, effectively reducing the input clock by the ratio of the added value to the maximum accumulator value.
The frequency (fFRQ) of the generated waveform is defined by the following equation:
fFRQ = (fCLK_TCF x Increment) / 2SIZE_CNT + 1
This makes a linear relationship between the waveform frequency and the increment, effectively allowing for accurate frequency waveform generation. This linear advantage over divide-by-n timers comes at the cost of the output jitter. However, the jitter that periodically occurs is always plus or minus one clock period, depending on the division remainder.
The waveform output is toggled every time the accumulator overflows. Given that the increment value remains constant, the resulting waveform will have a 50% duty cycle.
The two Compare interrupts and events are generated on alternating overflows where one will match the rising edge of the waveform and the other the falling edge. An overflow interrupt/event is generated on all overflows.
