I’ve been messing with using the Trinket M0 with SAMD21 chip for PWM (thanks, MartinL!) and have discovered an interaction between the SAMD21 data sheet, and “received wisdom” on the 'net, is likely to lead newcomers like me astray. I’m posting this in the hope it may help others to avoid wasting time.
The port mapping table in the data sheet says that on pins PA08 and PA09, function F uses WO registers 2 and 3 respectively.
A few places on the web say that when setting the duty cycle of the timer you use CC[n] where n is determined by n = x % 4, and x is from WO.
That applies to TCC0, which has 4 WO registers, but TCC1 has only two and the proper CC[n] value for TCC1 is x % 2 – e.g., where function F of PA08 says TCC1/WO, you need to use CC, and where function F of PA09 says TCC1/WO, you need to use CC.
A post from another part of the forum tells you about the number of WO registers (thanks, Martin!), but doesn’t link that to use of CC[n]. I wanted to make this post to document the added wrinkle with the TCC1 WO and CC registers.