cancel
Showing results for 
Search instead for 
Did you mean: 

Triangle wave DAC output on STM32G473 seems to be stuck enabled on all channels

KHarb.1
Senior

I want to output a static DC value from an STM32G473 DAC, but I’m seeing the output value has a noise tone on it that changes amplitude and frequency depending on various other settings. The behavior reproduces with all other peripherals disabled.  Here are observations and questions:

 

I’m using VREFBUF in internal reference mode. Setting the DAC (1CH2,2CH1,2CH2) output to max makes the waveform bottom sit just below the VREFBUF value, and the peak waveform output goes above the VREFBUF value. This should not be possible, but its what I’m measuring. What could I check on to figure this out?

 

With the output buffer enabled, the noise amplitude is a bit less than 1v peak to peak. If I remove the output buffer, it drops to less than 0.1v. The DAC outputs directly to a scope probe, so I don’t understand why it would behave this way.

 

Of the three internal VREFBUF settings, the lowest one produces the highest amplitude noise tone and the lowest frequency, the high setting produces the opposite. The noise waveform looks like it could be a lowpass filtered triangle wave…so it seems possible what I’m seeing is being generated by the internal DAC features. The differing VREFBUF value would definitely cause the triangle feature to change amplitude and frequency this way, but the feature wasn’t activated and the registers reflect that.

 

I configured OPAMP1 in follower mode and drove it with DAC3. I observed the same behavior as if DAC1 had its output buffer enabled. The only difference was the waveform was lopsided. This may be due to opamp slew rate…?

 

It seems like perhaps the configuration registers are being garbled or misread. Reading them back via STLink shows expected values. However, if I attempt to enable triangle wave mode or change amplitude via STLink, I can’t get any change in behavior. It seems like perhaps some of the config register bits are being garbled and triangle generation is stuck activated and the output buffering bit is stepping on the MAMPx bits etc  How would I investigate this?

 

FYI: A previous thread with initial info had a bad title that I can't change now:

https://community.st.com/t5/stm32-mcus-products/i-migrated-from-stm32f373-to-stm32g473-and-it-has-a-major-noise/m-p/657637

 

1 ACCEPTED SOLUTION
4 REPLIES 4
AScha.3
Chief II

What board you use ? nucleo...custom ? + cpu ? (case?)

VDDA is clean ?

What happens, if you not switch to internal/vrefbuf , but use VDDA as VREF+ ?

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

Its a custom board. VDDA appears normal at 3.3v.  VREF+ pin is not connected, so I can't check anything changes if I try to use it.

So are cer.caps on VDDA  and VREF+ - or not? (from G473 ds )

AScha3_0-1712556657299.png

or from nucleo-G474 :

AScha3_1-1712556868769.png

If not : try with soldering a thin wire from VREF+  to a cer.cap 1uF to gnd. Then test again.

 

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