-
Notifications
You must be signed in to change notification settings - Fork 118
analogWrite() oddness on M4 when using both DACs #87
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
Comments
oi - replied and asked if they could kindly try earlier BSPs, perhaps it was introduced at some point |
Something about the first call. Behavior doesn't repeat with subsequent calls. This: void setup() {
analogWriteResolution(12);
analogWrite(A0,500);
delay(1000);
analogWrite(A1,500);
delay(1000);
analogWrite(A0,1000);
delay(1000);
analogWrite(A1,1000);
delay(1000);
analogWrite(A0,2000);
delay(1000);
analogWrite(A1,2000);
delay(1000);
analogWrite(A0,3000);
delay(1000);
analogWrite(A1,3000);
delay(1000);
}
void loop() {
} Something here? |
Not related to using both together but I've found another peculiarity of the SAMD51 DACs, see https://forums.adafruit.com/viewtopic.php?f=24&t=153707 . I have demonstrated it with CircuitPython. |
The DACs have a "differential" mode so that feature could lead to some linkage between the two DACs? I'm not saying it's in differential mode, btw, could just be a bug somewhere relating to this, possibly the hardware. It looks like there's a tiny burst of noise on To explore phenomena, might be worth trying:
|
In CircuitPython the (two) DAC output is weird just from initialisation, e.g. try this (I've tested on PyGamer and Feather M4 board):
See adafruit/circuitpython#1991 for more detail on this. |
Reference:
https://forums.adafruit.com/viewtopic.php?f=62&t=146612&p=727668#p727280
Modified example taken from above.
Confirmed odd behavior with above simple example, but reduced initial delay in setup() to 1 sec.

The text was updated successfully, but these errors were encountered: