cancel
Showing results for 
Search instead for 
Did you mean: 

My DAC outputs inverted values (0000 = 3.3V and 4095 = 0V)

jean_prieur
Associate III
Posted on July 14, 2014 at 12:19

Hello,

I have a trouble with my DAC, for example when I set the DAC output (Channel1 orChannel2) to the maximum voltage, the DAC generate the minimum voltage:

DAC_SetChannel1Data(DAC_Align_12b_R, 4095);

Vout

~

0V

DAC_SetChannel1Data(DAC_Align_12b_R, 0);

Vout

~

3.3V

DAC_SetChannel1Data(DAC_Align_12b_R, 1000);

Vout

~

0.8V The strange thing is, I have two test boards, and the problem happens only on one board. The other board have a correct behavior, with the same project! Do you have any ideas? Thanks a lot!

DAC_SetChannel1Data(DAC_Align_12b_R, 4095);

Vout

~

0V

DAC_SetChannel1Data(DAC_Align_12b_R, 4095);

Vout

~

0V #whiskey-tango-foxtrot #oscar-mike-golf
29 REPLIES 29
bingojia4ever
Associate II
Posted on June 02, 2015 at 13:23

Hi,

Me too. I have built around 10 boards with exact same configuration and 30 other boards using same design for DAC part after that but it never appeared.

jean_prieur
Associate III
Posted on June 03, 2015 at 16:11

Yes it sounds totally right :) I think I made a mistake with this line...

Posted on June 03, 2015 at 19:07

If you still have the faulty board, could you please repeat the experiment and report back for the voltages for DAC set to say 0, 1000, 2000, 3000, 4096?

JW
jean_prieur
Associate III
Posted on June 12, 2015 at 15:50

I'm sorry but I don't have this board anymore... But i'm 100% sure that the voltages was perfectly inverted from 3.3V to 0V.

dennis2399
Associate II
Posted on February 29, 2016 at 10:49

I ran into the very same problem. My board outputted the correct voltages until I lend it out to a colleague for some testing. He noticed the inverted values which made us search for the problem. 

By disabling the output buffer of the DAC, the ouput values are correct but this isn't desirable for our project. We believe a short on the output pin blew some of the internal hardware of the output buffer. After replacing the MCU the output values were correct again with the output buffer enabled.

Don't know whether this is of any help for you by now but just wanted to share the info so others don't have to spend an entire afternoon looking for something wrong in the code when the hardware was faulty.

Cheers!

ahmad m
Associate
Posted on June 22, 2018 at 12:29

You must disable the output buffer

in function MX_DAC_Init 

sConfig.DAC_OutputBuffer = DAC_OUTPUTBUFFER_DISABLE;

Posted on June 23, 2018 at 17:37

Hi ,

That issue is a physical damage of the DAC pad ( PA4 or PA5) due that all board VDD flowed thru that pad and exceeding our Maxium Rating. The destroyed path is the one going to our Analog  rail thru the activation of the output buffer.  This is not normal behavior and you should replace your destroyed MCU due to EOS.

Ciao,

STOne-32

Amit_Korgaonkar
Associate II

hello,
I have this similar problem but only for one channel.
Channel 1 -- Connected to PA4 pin gives the inverted output , but the Channel 2 -- connected to PA5 pin give correct output.
Currently I have only one board for testing.
So if the DAC is damaged , than this should be seen for both Channels right?

 

> So if the DAC is damaged , than this should be seen for both Channels right?

No.

The output buffers for the two channels are independent from each other, so you probably have one of them damaged.

JW

etheory
Senior II

Is your DAC driving in buffered mode (non-inverting) or unbuffered mode driving a virtual earth inverting opamp (inverting). Obviously this would explain it depending on your choice.