A TCA instance can be split in two completely independent 8-bit timers. This feature provides a high degree of flexibility, being extremely helpful in waveform generation applications. Except in the cases where high accuracy signals are required, most of the applications can be designed using 8-bit signal generators and the possibility of adding one more generator to the design can be a big advantage. Though, there are more limitations in the Split mode than the Counter registers dimension. The most important one is that both 8-bit timers have only the down-count option, so the Dual-Slope PWM mode becomes unavailable. Also, the buffering scheme cannot be used, and the timers can no longer count events, only clock ticks. Moreover, there are no interrupts or flags for high-byte Compare registers. Regardless of these limitations, the Split mode can be really attractive when there is a need for a high number of timers. The block diagram of the TCA in Split mode is provided below.
This mode will be put forward by generating two PWM signals with different frequencies and different duty cycles.
PORTMUX.TCAROUTEA = PORTMUX_TCA0_PORTA_gc;
TCA0.SPLIT.CTRLD = TCA_SPLIT_SPLITM_bm;
TCA0.SPLIT.CTRLB = TCA_SPLIT_HCMP0EN_bm
| TCA_SPLIT_LCMP0EN_bm;
TCA0.SPLIT.LPER = 0xCF; TCA0.SPLIT.HPER = 0x44;
TCA0.SPLIT.LCMP0 = 0x68; TCA0.SPLIT.HCMP0 = 0x11;
TCA0.SPLIT.CTRLA = TCA_SPLIT_CLKSEL_DIV16_gc
| TCA_SPLIT_ENABLE_bm;void TCA0_hardReset(void) { TCA0.SINGLE.CTRLA &= ~(TCA_SINGLE_ENABLE_bm); TCA0.SINGLE.CTRLESET = TCA_SINGLE_CMD_RESET_gc; }
1’ to each corresponding
bit in the Direction register of the
port.PORTA.DIR |= PIN0_bm | PIN3_bm;