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
ESP32-S2 DAC2 Requires Load Resistor? #9324
Comments
dacWrite has been has been rewritten in 3.0.0 using the IDF hal. Can you please test with the development version? |
I installed the development version 3.0.0 alpha3 using the Arduino board manager. |
Can anyone replicate this, please? |
Let me test :) |
Hi @biomurph I tried with 2 Espresso's official boards on latest master. So it's caused by the HW (board) you are using. There is nothing to be fixed. |
Thanks @P-R-O-C-H-Y |
@P-R-O-C-H-Y I acquired an ESP32-S2 Soala board, and found the same issue with DAC2. The exact same distortion of the lower half of the signal range values were distorted in the same way as my scope pictures above. The signal trace reacted the same way to the application of a load resistor. I found the schematics of the Soala board here: It clearly shows that on the Soala GPIO-18 is used to drive the neopixel on the board. There is a 0 ohm jumper, R40, from GPIO-18 to the neopixel. GPIO-18 also has a 10K pull-up resistor, R42. I removed R40 and R42 from the Soala, and now I get the proper wave shape on DAC2. That is good, but how were you able to get a clean signal on DAC2 of your Soala board with the 10Kpullup and neopixel hanging off of it? Further, the Adafruit Feather ESP32-S2 board uses the Espressif ESP32-S2 Mini 1 radio module. It does look like the radio module ESP32-S2 Mini 1 has a 10K pullup resistor under the can. Can that be verified? Is there a schematic of the radio module? |
Board
Adafruit ESP32-S2 Feather
Device Description
na
Hardware Configuration
Oscilloscope
Version
v2.0.14
IDE Name
Arduino IDE 2.3.2
Operating System
Mac
Flash frequency
80MHz
PSRAM enabled
yes
Upload speed
921600
Description
DAC2 output is not 0 to 3.3V (Vdd). The lower half of the byte value (0 to 128 or so) is not registering the correct output voltage. I have the DAC1 connected to the Yellow Channel and DAC2 connected to the Pink Channel in the photo here. You can see the DAC1 trace makes a nice sawtooth /| faithfully presenting the correct voltage on the pin. DAC2 on the other hand is trying to make a sawtooth |\ but has distorted values that range from 0 to about mid range (128). I confirm that when I make DAC2 draw a sawtooth /| style it has the same Voltage value correlated to the byte value.
Why is this happening? Is this expected? Is there a preferred circuit to connect to the DAC outputs?
I tried to search the forum, but the search is broken, at least for me.
I plan to buffer the DAC output signals with an OpAmp.
Sketch
Debug Message
Other Steps to Reproduce
In order to get a better, more complete DAC2 output, I added a load resistor to GND. Here are examples of various R Load values.
R Load = 100R
R Load = 220R
R Load = 330R
R Load = 470R
You can see that the range expands with increase of R value until there is some weird foldover of the values at 470R.
In the next image, a 390R value is used and the distortion appears equally at either end of the range.
R Load = 390R
I first saw this distortion when I was trying to produce two sine waves at different
frequencies using a lookup table of pre-calculated values. Here's the initial scope view with no load resistor on DAC2 (Pink Channel).
With a 390R load resistor connected from DAC2 to GND, The output of the sine values is better, but there is some strange clipping at the range limits.
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: