I am currently working with a SAMD21E17 and trying to output PWM to two pins using a TC module. Here is my setup:
PA24, FUNCTIONE -> TC5-WO
PA25, FUNCTIONE -> TC5-WO
pm->APBCMASK |= (1<<13)
TC5->(CTRLA = (1 << 8) | (2 << 5) | (1 << 2);
TC5->READREQ = (1 << 14) | (0x10);
TC5->CTRLC = (1 << 1);
TC5->PER = 0xff;
TC5->CC0 = 0;
TC5->CTRLA |= (1 << 1);
TC5->CTRLBSET = (1<< 6);
Here are my two questions:
1) From analyzing the datasheet I concluded: although TC's have two CCx controls, in Normal Pulse-Width Modulation Operation (NPWM) only CC0 can be used as period register [SAMD21 Datasheet, Section: 22.214.171.124], hence, I can only output one kind of PWM with TCs. Is that correct?
2) I managed to output the PWM to one pin (PA24), however, for some reason I cannot output the PWM to the other pin (PA25) or both pins (PA24 & PA25). Is that supposed to be? If not, how do I link TC's PWM to output pins? At least from my experience with TCC, the TCC module got an extra register for output pin configuration [SAMD21 Datasheet, Section: 31.6.4, Table 31-4].
Thank you for your support,