// Enable the port multiplexer for the PWM channel on pin D9 PORT->Group[g_APinDescription.ulPort].PINCFG[g_APinDescription.ulPin].bit.PMUXEN = 1; // Connect the TCC1 timer to the port outputs - port pins are paired odd PMUO and even PMUXE // F & E peripherals specify the timers: TCC0, TCC1 and TCC2 PORT->Group[g_APinDescription.ulPort].PMUX[g_APinDescription.ulPin >> 1].reg |= PORT_PMUX_PMUXO_E;
Next question: What are the differences if any between the various GCLK clocks? Are any of them reserved for Arduino infrastructure? It so happens that I'm using GCLK4 and GCLK0 four sending and receiving respectively just because that's what the sample code that I found here with using. In both instances I am using the standard 48 MHz clock with a divisor of 1 so it would seem to be I could use the same clock for both purposes. Is this a valid assumption? Why would I want to use 2 different clocks?
Next question: What are the restrictions if any and code changes if any to use a different pins number for PWM? The code that you posted in this message…
I want to give the user the flexibility to specify just about any possible pin for PWM output without doing anything to mess up the normally Arduino infrastructure. What pin numbers are legal and how significant are the code changes to have a different pin number?
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16