Closed kattni closed 2 years ago
Just take a look at the SAMD21 manual, TCC0 only has 4 channels, and CH6 in indeed CH2, likewise ch4,5,6,7 --> ch0, 1, 2, 3. The reason seems to allow 1 signal to drive multiple pins synchronously e.g fading of 2 LEDs, or maybe having other usage. So this is definitely the hardware limitation.
@hathach could you try to adjust the definition so that the main timer for pins is:
this would make each pin on a different TCC?
@hathach could you try to adjust the definition so that the main timer for pins is:
- A2 TCC0[0]
- A3 TCC0[1]
- SDA TCC2[0]
- SCL TCC2[1]
- TX TCC1[0]
- RX TCC1[1]
- SCK TCC0[3] (CHANGED to make unique!)
- MISO TCC1[3] (CHANGED to be unique!)
- MOSI TCC0[2] (CHANGED to be unique!)
this would make each pin on a different TCC?
This is spot on, I should have figured it out. #331 is submitted.
From user feedback:
The variant mentioned is in core Arduino, and is from the original Arduino code. It might be a hardware limitation. The question is should we document it in the SAMD21 board guides? Or is this an unusual and unlikely situation to encounter?
@dhalbert Found these links and thought they might somehow be related. https://forum.arduino.cc/t/samd21-wo-and-cc-register-mapping/852449 https://github.com/arduino/ArduinoCore-samd/pull/170