-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
64DA32/64DD32 and PWM #546
Comments
We by default set the portmux to point to whichever port appears to be the most useful for PWM/least useful for other things. Since PORTA is super-crowded all the time, we put it on a different port, The specific port is listed in the part specific documentation pages. PA2 and PA3, when TCA0 isn't pointed at PORTA will have PWM through some of the TCBs. (this is a waste of a TCB and gives mediocre PWM, but w/e, you do get PWM there. And with the default PORTD portmux, there will be TCD0 PWM on PA4-7. Combined with the fact that PA0/PA1 are usually used for console if not for a crystal, and especially on the DA-series and DB's until rev B where only the first TCD portmux option works..... well.... you can see why I decided to put the default somewhere else (the support for detecting when you've changed PORTMUX came much later) There may be something up with this, but I'm almost certain the timer assignments that are occurring are not what you expect. Have you read the part specific docs? I know I wrote a bunch about how timers are allocated there. |
If i understand your well written docs right, TCA0 should point to PortD by CoreDefault. analogWrite(PD2, 100); Maybe i missunterstood something you write in your docs, as i'm not a native English-speaker. |
Won't have access tpo test until 14th |
Hey there Guys
Im struggel with this 2 Days now. Am I stupid or blind?
Want to have 4 PWM Outputs (with LEDs on each) on Port A, D,.. whatever.
All i get ist 1 working PWM output, the other 3 LEDs just flickering a bit.
Looks like the last "analogWrite" stops the other 3 from spit out a beautiful PWM-Wave. But why? TCA should have 6(?) Outputs?
If i put e.g. analogWrite(PinG, i) on the end, the green LED will work, all others just flicker.
If I remove PORTMUX.TCA... I will get 2 blinking LED (PA0 and 1) and 2 Working PWM (2 and 3).
If I move each LED a pin higher (PA0 -> PA2, PA1->PA3. etc.) I get 3 working PWM (PA2,3 and 4) and one strange PWM on PA5, the LED will never complete turn off and is "out off sync".
Also tested on a 64DD32, same thing.
So, where is my error? what am i doing wrong?
The text was updated successfully, but these errors were encountered: