Skip to main content
Visitor II
January 6, 2020
Question

Why DAC make 0.12[V] when I set it be 0

  • January 6, 2020
  • 5 replies
  • 1124 views
HAL_DAC_Start_DMA(&hdac, DAC_CHANNEL_1, (uint32_t*)setdac, 1, DAC_ALIGN_12B_R);

HAL_DAC_SetValue(&hdac, DAC_CHANNEL_1, DAC_ALIGN_12B_R, setdacvalue);

The first problem was when I changed setdac which points value that DMA buffer(?) 

It doesn't work so I add second code it works when i set 4095 on there it says 2.90[V] but

when i set 0 on there it says 0.12[V]..

and the code generation setting is going below picture

0690X00000BvbglQAB.png

As you can see that I set DMA and OUT1 as DAC operating conditions

It works properly except one stuff that when I set DAC value as 0 the pin says 0.12[V] ..

Have no idea how to make that pin to be 0[V]

That's all Thankyou

    This topic has been closed for replies.

    5 replies

    Super User
    January 6, 2020

    Read the datasheet, this is probably inherent DAC limitation.

    JW

    SKim.1761Author
    Visitor II
    January 6, 2020

    But... It's .... so.. Ok..

    SKim.1761Author
    Visitor II
    January 6, 2020

    Data sheet seems like saying "DAC_O UT min(2) Lower DAC_OUT voltage with buffer ON's value is higher than 0.2[V]"

    So there's nothing we can do with only using code..?

    I captured the parts of pointing DAC out minimum

    0690X00000Bvc2rQAB.png

    Super User
    January 6, 2020

    >So there's nothing we can do with only using code..?

    That's the case, face it.

    I know it's a disappointment for you now, but, on the other hand, think of it, this is a rather complex primarily digital chip, where analog is really just of a secondary importance and, if you'd been designing chips, you'd think of it as a miracle that it works this well at all, more than a shortcoming.

    If for some reason, you'd need one solid zero but then you'd not care that the next value is not in the millivolt range, you could go with the trick of setting the pin for that particular value as a digital output.

    JW

    Graduate II
    January 6, 2020

    If you really need 0 V out, use the DAC unbuffered and buffer DAC out with a buffer with a negative rail.