cancel
Showing results for 
Search instead for 
Did you mean: 

Minimum DAC output Voltage on stm32f30x

Simon Schulz
Associate II
Posted on June 17, 2017 at 11:47

Hello,

What is the minimal voltage the DAC can output?

When I read the Datasheet for the stm32f301 I can see a min of 0.2V with buffer ON.

However when the buffer is OFF the manual says 0.5mV.

I use the DAC internally as input for the comparator. When I set the DAC to 0x0000 I can read ~50mV on the output pin.

If I plot a linear ramp I get the first beginning from 50mV up to ~150mV very slow rising and then from there to VCC with the normal and linear slope.

Why is that? Why does the DAC only give me a minimum voltage of 50mV and not 0mV? Why is the first part of the ramp with a different slope?

I tested a stm32f301 on my custom PCB and also the STM32F303 on the stm32f3 discovery.

Any hints?

9 REPLIES 9
Zt Liu
Senior III
Posted on June 17, 2017 at 15:51

DAC or ADC never works perfectly in near saturation(0v, VDDA) cases.

If you DAC is buffered, then the offset of the dac output would be worse. (for the buffer is with offset.)

Note that the datasheet is somehow tricky, it says with buffer on and 

Corresponds to 12-bit input code (0x0E0) to (0xF1C) at VDDA = 3.6 V

and (0x155) and (0xEAB) at VDDA = 2.4 V

they didn't say from 0x000 to 0xFFF.

Nevertheless, if you disable the internal buffer, you should get a better result.

You may measure the real dac output(unbuffered) with a external high input impedance and low offset buffer.

re.wolff9
Senior
Posted on June 17, 2017 at 19:24

The '200mV MAX' from the datasheet translates to 50-150mV in practice.... Sounds familiar. This is a restriction from the buffer opamp inside the chip, not from the DAC itself. When I measured this effect, the result was very similar near the top end of the range. 

I'm not sure if the internal comparator requires the buffer or if the buffer setting maybe the disable buffer bit only applies to the external pin? But try without the buffer! 

Simon Schulz
Associate II
Posted on June 17, 2017 at 21:24

Thanks for your posts. I re-did my measurements.

I wrote a minimal code example which is only doing DAC init now.

And indeed, when the buffer is switched off (properly) the DAC gives me zero volts on the eval board:

0690X00000603qKQAQ.jpg

With the DAC amp on:

0690X00000603tNQAQ.jpg

So this makes all sense to me now.

However doing the same on my custom board with an stm32f301 gives me this on AMP off condition:

0690X00000603tOQAQ.jpg

Looks quite strange, a lot of noise and the whole ramp is shifted 150mV?!

When I switch the amp on i get the pattern I am used to:

0690X00000603tSQAQ.jpg

Any Ideas what might cause this problem?

Thanks a lot!

Posted on June 18, 2017 at 11:22

The output swing increases with buffer amp off, but the output impedance goes way off, about 1 MOhm.

If you really want to use the internal DAC, design your own buffer amplifier.

BTW, this quirk of ST's DAC implementation persists since the very first STM32.

Read the datasheet <very> carefully...

Posted on June 18, 2017 at 12:23

The output impedance of the DAC is very high. So on your development board it seems as if some high frequency signal is coupling to the wire connected to the DAC. 

We could assume the DAC to have a 1M Ohm output impedance, and that the 'high frequency signal' is 3V top-top, Then we can measure the noise to be 50mV and we can deduce the impedance of the coupling to be around 66MOhm. This could be some dirt left over from soldering or maybe you haven't shielded your high speed signals properly. A picture is worth 1000 words.... 

Edit: I just noticed the 150mV shift... So you're injecting close to 150nA of DC current too.... 

Simon Schulz
Associate II
Posted on June 18, 2017 at 20:02

There are no signals on the pcb during testing. The final design will use the uart and the SPI pin next to the dac output but those are not used during my test screenshots from above.

I do not need the DAC output, I just want to use the DAC voltage (adjustable but close to zero) as the reference for the included comparator. As far as I understood there is no way to disconnect the pin from the dac, right?

So how to i solve this issue?

My original idea was to have a 100nF decoupling capacitor from the DAC output to gnd. I change the output voltage only once during startup, so no fast changes are necessary.

Or remove the pad on the footprint and do not connect anything to this pin at all?

I think I might have fried my stm32f301, I just found out that the ac cable that came with my chinese soldering iron did not have the shield wire connected, I measured 115V AC (high impedance but still) on my soldering tip...

I fixed that and I will solder another one of the boards the next days and see how it behaves.

Thanks so far!

Posted on June 19, 2017 at 06:45

 hi,

I do not need the DAC output, I just want to use the DAC voltage (adjustable but close to zero) as the reference for the included comparator. As far as I understood there is no way to disconnect the pin from the dac, right?

So how to i solve this issue?

I remember my STM32F303K8, there is a output switch that I can disable, but only for  DAC1 OUT2 and DAC2 OUT1 in my case. So that these DAC outputs are not connected to any pins, and also can be negative input for any COMP.

You may check this too!

Posted on June 19, 2017 at 08:13

My original idea was to have a 100nF decoupling capacitor from the DAC output to gnd. I change the output voltage only once during startup, so no fast changes are necessary.

For the DAC with internal buffer off, 100nF seem a bit much. You can easily simulate the behavior with SPICE (e.g. LtSpice).

Or remove the pad on the footprint and do not connect anything to this pin at all?

Seems the better option to me. For internal connections, I expect the corresponding input impedance of the comparator to match. Can't remember a spec., though

Posted on June 19, 2017 at 09:00

I went ahead and checked the datasheet. The datasheet does not mention any input impedance of the opamps or comparators.