Skip to main content
calvin
Associate II
December 27, 2023
Solved

DAC output offset spec with output buffer enabled

Hi,

Currently, we are facing an accuracy problem when using the built-in DAC on the STM32F407 (with buffer enabled). As the built-in reference voltage measured 2.0005V, we set the DOR to 0x800, expecting to get 1.25V on the DAC output. However, we actually measured 1.238V, which is 122mV away from the ideal. All tests were made with the DAC under no load.

 

As I've seen in datasheets and many posts, the mentioned DAC output range will be 0.2V~ (VDDA-0.2V) when the buffer is enabled. Could I suspect that the DAC output offset specification is within (IDEAL ±0.2V)? Given the 122mV error mentioned above, it's hard to estimate the output accuracy without any listed specifications to refer to.

 

Overall, I think the built-in buffer actually works and is usable, but we really need more information about it to leverage it better.

Thanks.

This topic has been closed for replies.
TDK
TDKBest answer
December 27, 2023

2.5005 / 2 - 1.238 = 0.01225

That's an error of ~12.2mV, higher than 12 LSB, but much closer to what you should be expecting.

 

> However, as it lists ±12LSB at VREF+ = 3.6V, does this mean the offset error only occurs within 12LSB when VREF+ = 3.6V? If a VREF+ voltage other than 3.6V is applied, is the error then not estimable?

The datasheet tests specific conditions, but the limits should be comparable to similar setups.

 

> This resulted in the 0x800 being 1.6201V, which should be near 3.271/2 = 1.6335V, yet there was still a 132mV error.

You mean 13.2 mV?

 

A good test would be to disable the buffer, and disable any external loading, and see if the outputs fall in line with what the datasheets guarantee.

"If you feel a post has answered your question, please click ""Accept as Solution""."

11 replies

TDK
December 27, 2023

The 0.2V~ (VDDA-0.2V) spec is the rails. It should be considerably more accurate than +/- 0.2V. In this case, +/- 12 LSB.

TDK_0-1703651529613.png

 

> As the built-in reference voltage measured 2.0005V, we set the DOR to 0x800, expecting to get 1.25V on the DAC output. However, we actually measured 1.238V, which is 122mV away from the ideal.

Not sure I follow the math here. If VREF+ is 2.005V , a 12-bit DAC output of 0x800 should be near 1.0025 V.

"If you feel a post has answered your question, please click ""Accept as Solution""."
calvin
calvinAuthor
Associate II
December 27, 2023

>Not sure I follow the math here. If VREF+ is 2.005V , a 12-bit DAC output of 0x800 should be near 1.0025 V.

It's my typo, and there is something that needs clarification. The voltage of VREF+ is measured at 2.5005V, and it comes from an external voltage sourced from the AD7175-2 REFOUT.

However, as it lists ±12LSB at VREF+ = 3.6V, does this mean the offset error only occurs within 12LSB when VREF+ = 3.6V? If a VREF+ voltage other than 3.6V is applied, is the error then not estimable?

I didn't actually test applying 3.6V to both VDDA and VREF+, but I tried to tie VREF+ to VDDA, which was applied with a stable voltage measured at 3.271V. This resulted in the 0x800 being 1.6201V, which should be near 3.271/2 = 1.6335V, yet there was still a 132mV error.

TDK
TDKBest answer
December 27, 2023

2.5005 / 2 - 1.238 = 0.01225

That's an error of ~12.2mV, higher than 12 LSB, but much closer to what you should be expecting.

 

> However, as it lists ±12LSB at VREF+ = 3.6V, does this mean the offset error only occurs within 12LSB when VREF+ = 3.6V? If a VREF+ voltage other than 3.6V is applied, is the error then not estimable?

The datasheet tests specific conditions, but the limits should be comparable to similar setups.

 

> This resulted in the 0x800 being 1.6201V, which should be near 3.271/2 = 1.6335V, yet there was still a 132mV error.

You mean 13.2 mV?

 

A good test would be to disable the buffer, and disable any external loading, and see if the outputs fall in line with what the datasheets guarantee.

"If you feel a post has answered your question, please click ""Accept as Solution""."
waclawek.jan
Super User
December 27, 2023

While the DS are not clear in this regard, I believe the offset/gain specs are given for the buffer off case.

How is the DAC loaded in your circuit?

JW

calvin
calvinAuthor
Associate II
December 28, 2023

Hi,

For the test, the DAC output was left floating.

I also thought that the listed offset specification only applied when the buffer is off; the buffer amplifier should have a different specification.

waclawek.jan
Super User
December 28, 2023

> the buffer amplifier should have a different specification

I agree, and IMO as a minimum, the fact, that gain/offset is given for buffer OFF should be clearly marked in the DS.

But it is what it is.

The STM32 are a huge digital circuit with some analog functions slapped on. Few users realize that analog functionality built on what is primarily cheap digital process, is nothing short of miracle; it is actually very hard to do and full of compromises. Unfortunately, this does not show when looking at specs, which appear to be mediocre, if compared to dedicated analog devices (pun intended).

The 'F4 is relatively old, some 12 years now. If you look at newer STM32 e.g. 'L4 or 'G4, their DAC do have separate specs for buffer OFF/ON; however, their buffer opamp has a digital trim and its initial value is determined at manufacturing. That's the magic; but as all magics, it's not free - it means both silicon area, read, cost; and testing time for each individual part, read, cost.

JW

PS. How much error did you measure with buffer OFF?

calvin
calvinAuthor
Associate II
December 29, 2023

For buffer off, all output results are quite close to the IDEAL, and there is a larger dynamic range even when the DOR setting is within 100LSB to a few LSB, without significant offsets. This suggests that the DAC itself performs quite well.

anyway, below shows a bit of test result:

VREF=2.5V

Buffer ON:

DORIDEALmeasured voltageerror
10240.6250.612-0.013
20481.2501.238-0.012
30721.8751.864-0.011
40952.5002.490-0.010

 

Buffer OFF:

DORIDEALmeasured voltageerror
10240.6250.626+0.001
20481.2501.248-0.002
30721.8751.873-0.002
40952.5002.498-0.002

 

Buffer ON:

DORstepIDEALmeasurederror
1024500.6250.611-0.014
1074500.6560.642-0.014
1124500.6860.672-0.014
1174500.7170.703-0.014
1224500.7470.734-0.013
1274500.7780.764-0.014
1324500.8080.795-0.013
1374500.8390.825-0.014
1424500.8690.856-0.013
1474500.9000.887-0.013
1524500.9300.917-0.013
1574500.9610.948-0.013
1624500.9910.978-0.013
1674501.0221.009-0.013
1724501.0531.040-0.013
1774501.0831.070-0.013
1824501.1141.101-0.013
1874501.1441.131-0.013
1924501.1751.162-0.013
1974501.2051.192-0.013
2024501.2361.223-0.013
TDK
December 28, 2023

I'd also like to see the test with the buffer off. Presumably, it should fall within the limits specified by the datasheet. Agree the datasheet is lacking specificity here, couldn't find anything else that explored this further on the F4.

"If you feel a post has answered your question, please click ""Accept as Solution""."
waclawek.jan
Super User
December 29, 2023

Thanks a lot for the numbers.

The buffer opamp appears to have a consistent offset, as probably expected; which maybe could've been compensated by calibration. However, that offset is individual, probably will have a temperature-dependent component to it, and as you've demonstrated in your second post, is also supply-voltage dependent.

JW

Michal Dudka
Lead
December 29, 2023

I've measured STM32F303 DAC output with and without buffer against multimeter (about 0.1% , UT71A) point by point in loaded and unloaded condition. 

Results with buffer loaded into 27k+27k (To GND and to VCC) are there:
 http://mcu.cz/images/newspost_images/40/94/buff_27k27k_2.png
And results without buffer and unloaded are there:
http://mcu.cz/images/newspost_images/40/94/wobuff_hiz_2.png 

complete info (in Czeh) is there:
http://mcu.cz/comment-n4094.html