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

a4988 wait 1ms when coming out of sleep #1597

Merged
merged 1 commit into from
Mar 14, 2021

Conversation

WeekendWarrior1
Copy link
Contributor

What does this implement/fix?

Adds a 1ms pause to the a4988 when coming out of sleep, before starting to step.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Configuration change (this will require users to update their yaml configuraiton files to keep working)

Related issue or feature (if applicable): fixes

Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#

Test Environment

  • ESP32
  • ESP8266
  • Windows
  • Mac OS
  • Linux

Explain your changes

As specified on page 10 of the a4988 datasheet: https://www.allegromicro.com/-/media/files/datasheets/a4988-datasheet.ashx under Sleep Mode,

"When emerging from Sleep mode, in order to allow the charge pump to stabilize, provide a delay of 1 ms before issuing a Step command."

This fix adds a boolean to assist in tracking the rising edge of the sleep pin (coming out of sleep mode), and if so, adds a 1000 μs delay before continuing on with the a4988 loop.

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

@glmnet
Copy link
Member

glmnet commented Mar 14, 2021

Thanks

@glmnet glmnet merged commit 08998ca into esphome:dev Mar 14, 2021
taquitos pushed a commit to taquitos/esphome that referenced this pull request Mar 14, 2021
This was referenced Mar 22, 2021
@WeekendWarrior1 WeekendWarrior1 deleted the a4988_sleep_delay branch April 7, 2021 02:52
@github-actions github-actions bot locked and limited conversation to collaborators Sep 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants