2023-05-29 7:30 AM
Hi there,
I've been having difficulty trying to make the DAC channel 1 output 3.3v. The largest voltage that the DAC outputs is 2.56 volts which I measured with an oscilloscope. I try to set the output voltage to be higher with the following code snippet but the DAC doesn't output anything higher than 2.56 volts.
HAL_DAC_SetValue(&hdac, DAC_CHANNEL_1, DAC_ALIGN_12B_R, 4000);
I am using the stm32cube ide and there isn't many much I can configure for the DAC. I don't know if this is a configuration issue or a hardware issue.
Solved! Go to Solution.
2023-06-16 10:40 AM
Hi guys, I've solved the problem.
The issue was with the oscilloscope probe used to measure the DAC voltage. When I switched to using another probe, the oscilloscope measured the max voltage of the DAC to be 3.3V.
2023-05-29 7:50 AM
Do you know where I can find the DAC's internal reference voltage? I can't seem to find its reference voltage from the electrical schematics. Could it perhaps be in the configuration setting?
2023-05-29 7:54 AM - edited 2023-11-20 4:25 AM
2023-05-29 8:13 AM - edited 2023-11-20 4:26 AM
After looking at the schematics again I find VDDA and VREF+ are both connected to a 3.3V source. So why is the max output voltage for the DAC stuck at 2.56V?
Does it have something to do with pin PB1?
2023-05-29 8:41 AM
it would be less guesswork, if you give the cpu type...
2023-05-29 8:51 AM
I'm using the stm32 Nucleo-F302R8 MCU.
2023-05-29 10:20 AM
is any load on dac output? and try with buffer on/off .
what you get with 2048 as data ?
2023-05-29 11:12 AM
I don't have any load attached to the output. Turning the buffer off makes the DAC output very small voltages in the 100-200mv range.
When the data is set as 2048, I get an output of 1.8320 V. At 4096, the output is 2.61V.
Do these numbers seem reasonable?
2023-05-29 11:22 AM
*4095 actually not 4096
2023-05-29 11:42 AM
> Turning the buffer off makes the DAC output very small voltages in the 100-200mv range.
That sounds much like you do have a load on the given pin.
Which pin is it, btw? Is it set to Analog (read out and check/post content of GPIOA registers).
JW