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

analogWrite on R4 boards generates spikes #460

Open
kevinjwalters opened this issue Apr 4, 2025 · 0 comments
Open

analogWrite on R4 boards generates spikes #460

kevinjwalters opened this issue Apr 4, 2025 · 0 comments

Comments

@kevinjwalters
Copy link

kevinjwalters commented Apr 4, 2025

An arduino program trying to use analogWrite() to accurately generate a waveform suffers from a lot of brief spikes. I noticed these when trying to make a low frequency triangle wave. A recent Playduino YouTube video (by @olivereybel) shows these although it's possible they aren't shown in full by the oscilloscope. Even setting the midpoint value repeatedly can do this.

Arduino UNO R4 Minima DAC 8bit 127 value repeatedly set

Arduino UNO R4 Minima DAC 12bit sine wave

A more advanced oscilloscope shows this for a sine wave.

Image

Perhaps the issue discussed in the "Hairy output on R4 DAC" forum topic was never fixed? @TriodeGirl provided some code to deal with this in https://github.com/TriodeGirl/Arduino-UNO-R4-code-DAC-ADC-Ints-Fast_Pins/

Arduino Forum discussion: Spikes on UNO R4 DAC output using analogWrite()


Other analogWrite issues:

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

No branches or pull requests

1 participant