5 Timer/Counter E (TCE) and Waveform Extension (WEX)

TCE is a 16-bit up-down timer optimized for timing and PWM generation. An up-down timer can increment or decrease on each input, depending on the direction currently set. When TCE hits the TOP, the next loaded value depends on the direction. If counting up, it rolls over to 0. If it is counting down, TCE decreases down to zero. Similarly - if the direction is down, the counter rolls over to TOP. A direction change to up makes the timer start incrementing.

TCE supports double-buffering, which loads the changed register values when a compare operation occurs to prevent timing glitches from occurring mid-timer cycle, allowing the user to make changes while the timer runs.

TCE has multiple operating modes for generating waveforms. These modes are similar to the operating modes of the other timers. For instance, TCE supports “normal” timer operation, single-slope PWM, dual-slope PWM, and frequency generation. To enhance the output resolution of PWM, the TCE has a high-resolution mode that can be used to enhance the resolution of the PWM by using a high-speed clock signal. This signal may be at least 4x faster than the CPU speed for fully utilizing this feature. TCE can utilize the PLL to generate the clock signal.

Additionally, the TCE also integrates with the WEX. The WEX allows the timer to generate complementary outputs, insert dead-band time, create output patterns, and handle fault signals in hardware.