2020-01-25 12:44 AM
Hello
I am new to STM32 family and currently I was working on STM32H747I-DISCO board with HAL device support.
Is it possible to change the ADC reference from external Vref+ to internal Vref ? if possible how to configure? why because there is no parameter to configure ADC reference in HAL libraries.
And while using with external reference voltage Vref+ the ADC count was fluctuating even if the configured ADC channel was connected to ground. How to stabilize it?
Thank You
2020-01-25 03:06 AM
If there is a way, then you can find it in the reference manual.
HAL can't do everything that the MCU can do. The reference manual is the authorative documentation, HAL is a collection of examples that helps beginners getting started.
2020-01-25 04:06 AM
Thank you for your quick response.
I found VREFBUF registers in reference manual. Is it possible to configure VREFBUF registers while configuring ADC ?
In my board Vref+ was connected to +3.3.V supply, is it possible to configure internal reference?
2020-01-25 10:52 PM
Change VREF before configuring the ADC, because the ADC should be recalibrated afterwards anyway. But don't expect much improvement.
Getting stable ADC readings requres noise-free Vdda, Vssa and Vref supplies, something that cannot be fixed in software.
2020-01-26 08:01 PM
Thank you
2020-01-27 01:41 AM
>> Is it possible to change the ADC reference from external Vref+ to internal Vref ?
No. The internal voltage reference is internally connected to the input channel ADC3 VINP[19]. The internal voltage reference can be monitored to have a reference point for evaluating the ADC VREF+ voltage level.
From reference manual "26.4.35 Monitoring the internal voltage reference".
2020-01-27 09:50 PM
But according to chapter 28 Voltage Reference Buffer you can configure Internal reference voltage for ADC and DAC reference voltage and you can also select the voltage levels with VREFBUF_CSR.
I tried and configured for 1.5V, it is working.
2020-01-27 10:01 PM
I am using STM32H747I-DISO board. Vdda and Vssa was getting 3.2V and i configured Internal Vref as 1.5V and observed it on Vref+ pin. I observed these on oscilloscope, looks stable. But my ADC count was varying. what I need to do? How to reduce the noise ?
2020-01-27 10:45 PM
Vref+ and Vrefint are two different signals.
2020-01-27 11:12 PM
Read AN2834 How to get the best ADC accuracy in STM32 microcontrollers if you havent read it yet.
Looks like there is not much that can be done on the hardware level, but here is an idea.
The application note speaks of reducing pin noise, i.e. suspending as much external activity as possible during conversion. Try to synchronize ADC to the worst offenders on the system. E.g. if the display is active and the framebuffer is in the external SDRAM, that means a lot of activity on the memory and display bus, so try to start conversions in the vertical retrace interval, when the last scanline has been displayed (request an LTDC interrupt, see LTDC_LIPCR).