STM32F4DISCOVERY DAC PA4/PA5 not reaching true 0V (shows ~0.045–0.05V)
- March 7, 2026
- 3 replies
- 2561 views
Hello ST Community,
My name is Gorakhnath. I am currently pursuing M.Tech (Power Electronics and Drives) at NIT Kurukshetra. I am using the STM32F4DISCOVERY (STM32F407VGT) board and I need stable DAC outputs for my hardware application.
What I need (requirement)
When the DAC command is 0 V, I need the output to be as close as possible to true 0.0000 V, because my external circuit maps:
0 V → 0 A
3 V → 50 A
Even a small voltage like 0.045–0.05 V produces unwanted current (~0.5 A) in my system.
Issue / Observation
On both DAC pins:
PA4 (DAC_OUT1)
PA5 (DAC_OUT2)
I measure about:
~0.05 V (sometimes ~0.045 V) when the command is 0 V
This happens even when I am not sending any command from LabVIEW, or when I send 0,0.
What I tried (software checks)
Set DAC values to 0 using HAL on both channels:
HAL_DAC_SetValue(..., 0) for DAC channel 1 and channel 2
Forced PA4/PA5 to GPIO output LOW when command is 0 V:
Configured PA4/PA5 as GPIO_MODE_OUTPUT_PP and wrote RESET (hard clamp to 0 V)
Startup sequence:
Start DAC at 0 first, then start USB CDC later (to avoid random outputs during USB init)
USB CDC receive parsing:
Callback is connected correctly and I parse the command format from LabVIEW:
"val1,val2\n" (float values), with clamping
Even after all of this, the output still does not reach 0.0000 V and I consistently see ~0.045–0.05 V.
Questions to the community
Is ~0.05 V at DAC output a known/expected behavior for STM32F4 DAC or specifically on the STM32F4DISCOVERY board?
Is there any board-level hardware path (resistor/capacitor/audio circuit/pull-up or peripheral connection) on PA4 / PA5 that can cause a small offset or leakage at the header pin?
What is the best recommended method to guarantee a true 0 V level at the output for such a sensitive current-mapping circuit?
External pull-down resistor recommendation (e.g., 10k / 4.7k / 1k)?
Analog switch / transistor clamp method to force 0 V?
Any specific STM32F4DISCOVERY resistor/jumper/0Ω link that should be removed to isolate DAC pins from other circuitry?
Attachments / References
I will attach STM32F4DISCOVERY board photos (front/back, and close-up near PA4/PA5 routing)
I will attach my STM32CubeIDE project and source files
Code drive link:
https://drive.google.com/drive/folders/1sN8W17vqVO0C64_aHqKQm7wwjeYXnULn?usp=sharing
Thank you for your time and support.
Kind regards,
Gorakhnath
M.Tech (Power Electronics and Drives), NIT Kurukshetra
Email: 324104207@nitkkr.ac.in
