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

In connection with #13, changes to setPeriod() #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oyeb
Copy link
Contributor

@oyeb oyeb commented Jun 15, 2016

  • I've tested my additions but NOT on PWM signal generation. I've no means to do that (no scope).
  • I've taken the liberty to add an example, for testing purposes alone.
  • See comments in source and let's discuss.

See forum post for full story.
TL;DR

  1. CPWM is not compatible with use case described in forum.
    This PR asks whether we should let the user decide if he wants to do "frequent updates" and get "half the range than in CPWM" or do just basic initialization and get full range from CPWM
    -- OR --
    as in Race Condition with frequent updates to setPeriod() #13, remove CPWM altogether.
    Actually, there's nothing wrong in keeping CPWM ON and doing frequent updates -- it's only that MOD values need to be halved for corrent timing (since frequent updates implies forceful up-counting alone.) [I hope this makes sense... see the forum for explanations]
  2. Proposed solution enables "Enhanced PWM Synchronization", see datasheet sec. 36.4.11, so apart from the use case being discussed, this config. might also help in flexible multi-channel PWM control. This guide from NXP has example C programs on this topic.

* I've tested my additions but NOT on PWM signal generation. I've no means to do that (no scope).
* I've taken the liberty to add an example, for testing purposes alone.
* See comments in source and let's discuss.
@oyeb
Copy link
Contributor Author

oyeb commented Jun 15, 2016

[I'm jukedude on the forum] :)

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

Successfully merging this pull request may close these issues.

1 participant