Skip to content
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

PWM frequency change for pins PA3 and PA5 #1187

Open
ltwin8 opened this issue Dec 30, 2024 · 0 comments
Open

PWM frequency change for pins PA3 and PA5 #1187

ltwin8 opened this issue Dec 30, 2024 · 0 comments

Comments

@ltwin8
Copy link

ltwin8 commented Dec 30, 2024

hello, i would like to use the Pins PA3 and PA5 for outputting PWM.

I would like to run at 1MHz to 8MHz internal clock (the lower the better, power saving) and i would like to output a squarewave on pin PA3 with roughly 50% dutycycle at a frequency of about 100kHz at PA3, i did play around with the TCB1.CTRLA setting it to 00 for the prescaler but it did not help, i looked up on datasheet p16 that its source is tcb1.

can i somehow set the resolution of the pwm to 1 bit? that way i could just toggle the pin right? can someone provide me with an example snippet?

additionally i would like to output a pwm of 8 bit resolution on PA5 at somewhere above 5kHz and below 30kHz, please if possible give me a code snippet here too, i will try to figure the rest out myself when i can work of a functioning code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant