-
Notifications
You must be signed in to change notification settings - Fork 33
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
DAC buffer on/off #104
Comments
The DAC buffer is indeed turned on by default. ArduinoCore-GD32/cores/arduino/analog.cpp Lines 73 to 125 in dfa7ccb
Sounds like we should disable the DAC altogether when |
the output changes proportionally with 1, 2 ... etc, it is a constant offset as far as I tested. |
So when you put dac_output_buffer_disable(DAC0);
dac_output_buffer_disable(DAC1); after every |
I tested writing 0 on a standalone bluepill plus board, |
We can definitely add an API for this but I'm not sure if this should be the default behavior. The datasheet says that the purpose of the buffer is to provide a low-impedence output that can directly drive stuff without needing an external opamp. I can't repredict the user's application for this, whether the drive capability or voltage accuracy is more important :( . A static +6mV offset in a total voltage swing of 3300mV doesn't seem neck-breaking to me, but I'm also willing to be convinced of the opposite. |
keep the default maxgerhardt, no action needed, I will use dac_output_buffer_disable(DAC0) for my application :-) cheers ~ |
I noticed that with analogWrite() function, even I put 0, the output is not zero, something around xx - xxx mV, I happened to find that it is due to DAC buffer on - maybe by default? refer to below link ... I have no negative power available so this non-zero output is a little bit disturbing.
Is that possible we can turn the buffer off to get the zero voltage output using Arduino way? I anyway have to connect a buffer using low drift opamp so it does not matter.
https://stcommunity.st.com/t5/stm32-mcu-products/minimum-dac-output-voltage-on-stm32f30x/m-p/410862
The text was updated successfully, but these errors were encountered: