Skip to main content
jean_prieur
Associate III
Jul 14, 2014 10:19 AM UTC
Question

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

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.

    29 replies

    jean_prieur
    Associate III
    Jun 3, 2015 2:11 PM UTC
    Posted on June 03, 2015 at 16:11

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

    waclawek.jan
    Super User
    Jun 3, 2015 5:07 PM UTC
    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
    Jun 12, 2015 1:50 PM UTC
    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
    Feb 29, 2016 9:49 AM UTC
    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
    Visitor II
    Jun 22, 2018 10:29 AM UTC
    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;

    STOne-32
    ST Technical Moderator
    Jun 23, 2018 5:37 PM UTC
    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

    Associate II
    Jul 31, 2024 5:15 AM UTC

    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?

     

    waclawek.jan
    Super User
    Aug 1, 2024 6:53 AM UTC

    > 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
    Oct 22, 2024 4:01 AM UTC

    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.