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

Change default ARM hardware PWM WS2812 tick frequency to 800kHz #24508

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

infinityis
Copy link
Contributor

Description

When testing the WS2812 signal using ARM PWM hardware, my oscilloscope revealed that each bit width was erroneously 12.5us instead of 1.25us. The PWM still worked because this was less than the reset duration of 80us, but it took much longer to send the frame of data and is not what should be happening. This PR corrects that issue, as well as updates some incorrect terminology/variable naming within the ARM PWM hardware driver.

There have been references to hardware not working with the frequency set to 800,000Hz several years ago, which no one seems to currently be able to reproduce. The value of 800,000Hz (period 1.25us) is objectively correct, and if there happens to still exist hardware which does not support that PWM frequency, then that hardware is the exception that will require tailoring with #define

The ARM PWM hardware code also now properly uses the #define values to configure pulse widths for 1 and 0.

The PWM frequency (800kHz) is now properly referred to as frequency, and the clock rate is referred to as the PWM tick frequency.

Keyboards which were manually setting the PWM frequency to 800kHz have also been updated to remove that configuration line (since the default value will now be 800kHz).

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@fauxpark fauxpark requested a review from a team October 21, 2024 01:40
@drashna
Copy link
Member

drashna commented Oct 21, 2024

tested on f303, f411 and f405. LGTM.

@drashna drashna requested a review from a team October 21, 2024 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants