I have read the XMEGA E5 manual many times, but not everything is clearly explained there. I try to use TCC4 in byte mode, to double the number of PWM channels. Everything seems to be ok, except I cannot get any waveform on PC4. On PC0-PC3 the waveform is as expected. Maybe I have missed something? Here is my code:
PORTC.DIRSET=0b00011111; //PWM outputs
TCC4.CTRLB=TC_BYTEM_BYTEMODE_gc | TC_WGMODE_SINGLESLOPE_gc; //8-bit mode, single slope
TCC4.CTRLE=TC_LCCAMODE_COMP_gc | TC_LCCBMODE_COMP_gc | TC_LCCCMODE_COMP_gc | TC_LCCDMODE_COMP_gc; //Compare for all channels (should be only 0-4, the rest is enabled for testing
TCC4.CTRLF=TC_HCCAMODE_COMP_gc | TC_HCCBMODE_COMP_gc | TC_HCCCMODE_COMP_gc | TC_HCCDMODE_COMP_gc;
I've noticed, that higher 8-bits of CCx registers are cleared every timer overflow.