cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F334K8T6, DAC acts like VDDA is 1.5 Volts but VDDA measures 2.5 V.

Jim Frederick
Associate II
Posted on December 30, 2015 at 14:05

Using a STM32F334K8T6 with 2 DAC channels. Each channel will go no higher than 1.5 Volts with a DAC Holding register value of 0xFFF. I expected 2.5 V because VDDA is being fed 2.5V from a reference. Where is this 1.5 Volts coming from?

More specifics:

    • I'm using an STM32F334K8T6, an LQFP32 package
    • Reference manual RM0364, 'STM32F334xx advanced ARM®-based 32-bit MCUs' has an equation of: DACoutput = VDDA * DOR / 4096.
    • My DOR register shows values of 0xFFF as seen in an IAR debugger (FW is writing intended/correct values). As expected, attempting to write a larger value than 0xFFF results in the value getting truncated to 0xFFF. Smaller values result in proportionally/linearly smaller voltages e.g., 0x7FF results in 750 mV (half of 1.5 V). 
    • DAC configuration: for this test is simple: no DMA, no interrupts, no DAC buffer configured, 12 bit mode, right-justified
    • VDDA on pin 5 (Vref+) measures 2.5 Volts and is supplied by a 2.5 V reference (LT1790-2.5). This seems to be out-of-spec because it's more than 0.4V less than VDD according to RM0364. 
    • VDD measures 3.3 V
    • There's no VSSA (Vref-) pin or a Vbat pin on this 32 pin device.
    • The DAC channels I'm using are DAC1_OUT2 on PA5 (pin 11) and DAC2_OUT1 on PA6 (pin 12).
    • I checked the Reference manual RM0364 and the 'STM32F334x4 STM32F334x6 

      STM32F334x8' datasheet - looked for info about configuring a different Vref source for DACs or configuring a gain - didn't see anything. 
    • The datasheet mentioned a VREFINT (Embedded reference voltage) of 1.20 V but is used for some ADC channels rather than the DACs.
    • Constraints for VDDA and VDD: RM0364 says: 'VDD must always be kept lower than or equal to VDDA' and 'It is forbidden to have VDDA < VDD - 0.4 V'. 
5 REPLIES 5
raptorhal2
Lead
Posted on January 01, 2016 at 03:21

What happens when you avoid the forbidden zone and apply 2.9 to 3.3V to VDDA ?

Cheers, Hal

re.wolff9
Senior
Posted on January 03, 2016 at 15:12

You really can't go ignoring specifications in the datasheet without knowing what you are doing. In this case, the ''MUST be withing 0.4V'', is because there is a diode between the modules inside the chip. 

So to come within spec, you need to increase the VDDA or decrease the normal VDD. Once you get things working, you could be brave and see if it continues to work ok for you if you go outside of the specifications. 

For example, one of the specs that you could ignore is the spec that pins may not be more than XXX above VDD..... provided that the current into them is sufficiently  low. In general there are diodes to VDD on each pin, and by specifying that you cannot go above XXX, they ensure those diodes don't turn on. But in realitiy it is not that bad if they do turn on, as long as you don't blow them away with too much current.

And still... if you exceed specifications in the datasheet, when it breaks you get to keep both pieces.... For example ST might ''improve'' their process and start to make chips on another process. that might change your ''outside the datasheet'' parameters, resulting in your application no longer working. Be careful.... 

Jim Frederick
Associate II
Posted on January 04, 2016 at 23:29

Hal-

With a VDDA of 3.3 Volts (same as VDD), I see a max DAC output voltage of 2.5 Volts. I expected ~3.3 Volts.

Roger-

You're right - we are correcting our design oversight.
Posted on January 05, 2016 at 02:03

How is the DAC output loaded?

JW
re.wolff9
Senior
Posted on January 05, 2016 at 12:31

The reason Jan is asking that is because the output of the DAC has a surprisingly large output resistance. Without the buffer, circuit the output resistance is on the order of Mega Ohms. Draw 1 micro amp and you're influencing the results very significantly. 

WITH the buffer, you cannot reach the last 50-100 mV near the power supplies.... But the output impedance improves a lot. But it is still around 15k Ohm.... draw 0.1mA and again you'll get significantly different results than what you expect....