-
Notifications
You must be signed in to change notification settings - Fork 1.3k
STM32: PWMOut #2248
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
STM32: PWMOut #2248
Conversation
CI is complaining about some kind of... Itsy Bitsy issue? |
This is a version skew issue that the itsy 840 PR got caught in. I've submitted a fix PR, and can have you review it. Then you can merge from master and that should fix it. I'll start reviewing this today |
@dhalbert great thanks Dan. I'll keep an eye out for your PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, including the timer/channel finding. It's not clear to me the prescaler/divisor choices attain the finest possible granularity. Is that true? Could you add a comment about that.
@hierophect lemme know when this is ready for me to try :) |
Ok, feeling pretty good about this. @ladyada, this is ready for testing. We had a pretty huge discussion in #circuitpython about the tradeoff between PWM duty cycle resolution (required for servos) and speed/frequency resolution (for audio and highspeed driving) so I may pick up on that in a later issue/PR. |
hiya can you provide me a bin for the feather f405? artifacts aren't coming thru actions anymore :/ |
Hi, that's a bummer - here you go. Feather F405 version, 8 bit PWM pulse resolution. |
ok tested with great success! there's some debug output to remove - other than that i tried various frequencies and duty cycles. did you try enabling displayio? |
@ladyada Awesome! Forgot about the debug output I'll get rid of that real quick. DisplayIO has a substantial HAL component to enable Parallel Bus - do you want me to make that next over UART? @dhalbert let me know if you'd like me to make an issue or want chat more about this variable PWM pulse resolution thing. |
hiya no UART is more useful. |
@ladyada this is ready for one last re-test with the updated algorithm |
@ladyada ParallelBus can be stubbed out and raise a NotImplementedException from make_new. |
ok that makes sense! @hierophect do that - i believe nrf52 does the same so you can get hints here :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for getting this going! A number of style comments but looks good overall.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I think this resolves all the outstanding review requests. Since @ladyada already tested in on hardware, good to go, and I'll merge! Thanks for your patience!
yep we will find more/any bugs during user testing for sure :) |
This PR implements the PWMOut module on all STM32 boards. Tested features (on FeatherF405) include variable frequencies, variable pulse width, and conditional rejection of new PWMOuts based on timer group and frequency. See TODO comments for some contextual questions/comments.