Skip to main content
Visitor II
July 14, 2014
Question

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

  • July 14, 2014
  • 28 replies
  • 5939 views
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
    This topic has been closed for replies.

    28 replies

    Visitor II
    June 3, 2015
    Posted on June 03, 2015 at 16:11

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

    Super User
    June 3, 2015
    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
    Visitor II
    June 12, 2015
    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.

    Visitor II
    February 29, 2016
    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!

    Visitor II
    June 22, 2018
    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;

    Technical Moderator
    June 23, 2018
    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

    Graduate
    July 31, 2024

    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?

     

    Super User
    August 1, 2024

    > 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

    Graduate II
    October 22, 2024

    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.