cancel
Showing results for 
Search instead for 
Did you mean: 

Why won't my DAC output a voltage larger than 2.56v?

RWang.9
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions
RWang.9
Associate II

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. 

View solution in original post

16 REPLIES 16
RWang.9
Associate II

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?

AScha.3
Chief II


_legacyfs_online_stmicro_images_0693W00000bl3srQAA.png

If you feel a post has answered your question, please click "Accept as Solution".
RWang.9
Associate II

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?


_legacyfs_online_stmicro_images_0693W00000bl3v7QAA.png
_legacyfs_online_stmicro_images_0693W00000bl3uxQAA.png 

Does it have something to do with pin PB1?


_legacyfs_online_stmicro_images_0693W00000bl3vRQAQ.png

AScha.3
Chief II

it would be less guesswork, if you give the cpu type...

If you feel a post has answered your question, please click "Accept as Solution".
RWang.9
Associate II

I'm using the stm32 Nucleo-F302R8 MCU.

AScha.3
Chief II

is any load on dac output? and try with buffer on/off .

what you get with 2048 as data ?

If you feel a post has answered your question, please click "Accept as Solution".
RWang.9
Associate II

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?

*4095 actually not 4096

> 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