Skip to content

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

Merged
merged 17 commits into from
Nov 5, 2019
Merged

STM32: PWMOut #2248

merged 17 commits into from
Nov 5, 2019

Conversation

hierophect
Copy link
Collaborator

@hierophect hierophect commented Oct 28, 2019

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.

@hierophect
Copy link
Collaborator Author

CI is complaining about some kind of... Itsy Bitsy issue?

@dhalbert
Copy link
Collaborator

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

@hierophect
Copy link
Collaborator Author

@dhalbert great thanks Dan. I'll keep an eye out for your PR.

Copy link
Collaborator

@dhalbert dhalbert left a 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 hierophect requested a review from dhalbert October 28, 2019 20:19
@ladyada
Copy link
Member

ladyada commented Oct 29, 2019

@hierophect lemme know when this is ready for me to try :)

@hierophect
Copy link
Collaborator Author

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.

@ladyada
Copy link
Member

ladyada commented Oct 29, 2019

hiya can you provide me a bin for the feather f405? artifacts aren't coming thru actions anymore :/

@hierophect
Copy link
Collaborator Author

hierophect commented Oct 29, 2019

Hi, that's a bummer - here you go. Feather F405 version, 8 bit PWM pulse resolution.

firmware.bin.zip

@ladyada
Copy link
Member

ladyada commented Oct 29, 2019

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?

@hierophect
Copy link
Collaborator Author

@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.

@ladyada
Copy link
Member

ladyada commented Oct 30, 2019

hiya no UART is more useful.
@tannewt is parallelbus required for displayio or is it possible to have only spibus support?

@hierophect
Copy link
Collaborator Author

@ladyada this is ready for one last re-test with the updated algorithm

@tannewt
Copy link
Member

tannewt commented Nov 1, 2019

@ladyada ParallelBus can be stubbed out and raise a NotImplementedException from make_new.

@ladyada
Copy link
Member

ladyada commented Nov 1, 2019

ok that makes sense! @hierophect do that - i believe nrf52 does the same so you can get hints here :)

tannewt
tannewt previously requested changes Nov 1, 2019
Copy link
Member

@tannewt tannewt left a 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.

@hierophect hierophect requested a review from tannewt November 4, 2019 15:10
dhalbert
dhalbert previously approved these changes Nov 5, 2019
Copy link
Collaborator

@dhalbert dhalbert left a 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!

@adafruit adafruit deleted a comment from tannewt Nov 5, 2019
@dhalbert dhalbert dismissed tannewt’s stale review November 5, 2019 01:44

stuck change, won't let me merge

@dhalbert dhalbert self-requested a review November 5, 2019 01:44
@ladyada
Copy link
Member

ladyada commented Nov 5, 2019

yep we will find more/any bugs during user testing for sure :)

@dhalbert dhalbert merged commit c87d6cc into adafruit:master Nov 5, 2019
@hierophect hierophect deleted the stm32-PWM branch November 6, 2019 20:09
@hierophect hierophect added the stm label Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants