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

PWM glitch when ramping up followed by a pause #128

Open
GoogleCodeExporter opened this issue Jun 3, 2015 · 1 comment
Open

PWM glitch when ramping up followed by a pause #128

GoogleCodeExporter opened this issue Jun 3, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

Summary: when calling analogWrite() with values 0 or 255, it defaults to 
analogWrite() which leaves PWM registers in the previous state, and the next 
analogWrite() starts with a "glitch", very noticeable if "previous" and "next" 
values are far apart.

A simple reproductible test case, with expected output and observed results, is 
available on http://forum.arduino.cc/index.php?topic=303922.0

A simple solution is to get rid of the code that defaults to digitalWrite when 
value == 0 or 255, but probably a cleaner solution would be to make sure that 
registers are not influenced by the previous value upon starting PWM

This is on ATTiny85 using arduino-tiny cores 1.5 (with changed compiler path) 
on Arduino 1.6 IDE

Original issue reported on code.google.com by vicnevicne on 1 Mar 2015 at 10:26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant