2018-03-23 03:10 AM
Hi,
Question: Does DAC buffer enable or disable when use external OpAmp?
Reason
: I want generate high frequency sine wave use DAC,range from 100~100Khz,0.1Vrms~1Vrms.when generate 100Khz, I want a smoth sine wave,so i set Timer2_trigger speed is 4.5MHz, sample point is 45.
That is the maximum sampling rate of DAC when use STM32F3 which is specified in AN4566(Page8).
And also as ST's ''AN4566-Extending the DAC performance of STM32 microcontrollers'' write,it's better use external OpAmp to buffer the DAC output due to internal buffer limitation(Page5).
So I buy some LMH6645 accordding the AN4566(Page9),and build an test pcb just as it(Page14).
Here is the output when not use external buffer:(Yellow is DAC output)
But When I turn off DAC buffer,the external buffer output is not sine,but it's square wave.
(Yellow is DAC output,Blue is external opamp output).
While if I turn on DAC buffer, the external buffer output is well follow input,
(Yellow is DAC output,Blue is external opamp output).
but as we use external opamp for high frequency,
so it's should not turn on DAC buffer,otherwise why we use external buffer?And I test other even better opamp,such as LMH6646,LMH6642,OPA2354,it's the same problem.
So what shoul i do if i want use external opamp to generate high frequency sine wave?
and what's the reason about strange output of external OpAmp when disable DAC buffer?
-----------------------------------Hardware
: STM32F3-Discovery,which use STM32F303VC,it's DAC1 has internal buffer,which can be turn off.Software: Example(DAC_SignalsGenerations ) in ''STM32F3-Discovery_FW_V1.1.0'',
This example provides a short description of how to use the DAC peripheral to
generate several signals using DMA controller.DMA2 channel3 is configured to transfer continuously, a unit16_t Array[450] buffer to the DAC register DAC_DHR12R1. DAC channels conversions are configured to be triggered by TIM2 TRGO triggers and without noise/triangle wave generation.-------------------------------------
Attatch is the sine wave(0.6Vrms,1Khz) test.
Thanks,and looking forward anybody's reply and discussion.
2018-03-23 06:16 AM
Hi,
The question below was solved by myself because I found out the ''stm32f30x_stand_peripheral_library'' of my project are not update,and there are some error in DAC driver,which it is turn off dac buffer in fact when you config the dac to ''DAC_BufferSwitch_Enable'' in software.So it's apparently should turn off the dac buffer when use external opamp. and it does improve dac output performance.
here is the dac output 100KHz when Timer2-trigger set to 4.5Mhz and not use internal buffer:(Ingnore note on osc,beacuase error in stm32-library),set to 1Vrms output,but only 711mV actually output.
here is use internal buffer:(Ingnore note on osc,beacuase error in stm32-library),set 1Vrms output,actual is about1V.
but it's apparently large distortion of output.
And , even you increase set value above 1V,it's doesn't change in output,because internal amp is not rail-to-rail.
Next is disable internal buffer and use external opamp:2018-03-23 06:44 AM
that opamp drawing is probably incorrect: its inputs should have been swapped.
2018-03-24 12:34 AM
Actually it's correct, the positive +IN set to Vdd/2 which provide negative input -IN range between 0~Vdd and -IN 's offset is Vdd/2, so the output just inverse of -IN and range still is 0~Vdd if you use rail-to-rail opamp.
Offcourse,you can use positive input as an amplifier or as a voltage follower. but here i just use it as a dac buffer which replace internal buffer because the internal buffer's limited performance.
-------------------------------------------
Next two picture show differences DAC output when not use buffer and use an external buffer.
Not use buffer:(Yellow one is dac output,set to 0.6Vrms, but actual output is just about 200mV,)
Use external buffer:(Blue one is external buffer output,it's same as set voltage).
Sorry for no internal buffer test picture....
2018-03-24 01:40 PM
I also think the amplifier circuit is not correct.
there should be a resistor between the opamp's -ve input and the processor pin. call it R4
it is the Gain resistor. Gain is something like (R1+R4)/R4
without R4 the unit will rail.. giving a square wave.
2018-03-24 06:33 PM
'
so the output just inverse of -IN'
the circuit is an inverting amplifier, with the gain defined by R1//C1 over the DAC's output impedance (itself undefined). For a perfect voltage source, the gain is infinity -> clipping output.
If that circuit comes from a ST appnote, ST should have it corrected.
2018-03-26 01:13 AM
Attention: the DAC's bug still in standard library,it's in file '' stm32f30x_dac.h''
you should change it according RM0316's page428 if you still use stdperiph-lib:
Refer info:
AS the STSW-STM32108-''stm32f30x_dsp_stdperiph_lib_V1.2.3.zip'' is suspended and ST use STM32Cube's HAL for further developing.
2018-03-26 02:16 AM
There are two resistors in MCU,it's DAC equivalent circuit is:
And Ra+Rb = 15kohm which is specified in datasheet:
So when use external opamp, when Rf=12kohm you will get about 1:1 of dac's signal.
and Cf is used to avoid overshoot.
------------------------------------------------------------------------------------
I think why use external opamp can ''extend'' dac performance,it may be internal buffer is not good enough for high
frequency signal. And you can take stm32's Opamp's specification same as that dac buffer
because it's on the same chip and ST wouldn't design another ''good'' buffer just for DAC.
The following picture is what requide for DAC's buffer if it use for high performance:
And here is the internal Opamp's specification, you can see it's slew rate and band width are far from demand:
2018-03-26 02:52 AM
After think about your reply,i figure out why it's square wave when enable internal buffer and use external opamp at same time.
it's because like what you said,there are no output resistor which leed to infinity output.
but the circuit is correct which i find it in ST's application note, and have actual test to prove it's right.
----------------------------
The following is the simulation of use internal buffer and external opamp at same time :
here is simulation result:
Detail at 0~0.2ms:
Detail at 2.5ms:
-----------------------------------------------
When I add a resistor between DAC out and external opamp,which circuit like the following picture:
Then the simulaiton result is right:
Detail at 2.5ms:
2018-03-26 02:53 AM
After think about your reply,i figure out why it's square wave when enable internal buffer and use external opamp at same time.
it's because like what you said,there are no output resistor which leed to infinity output.
Thanks a lot.......