Enable VREFBUF on STM32L476Vxx (100 pin LQFP) Solved ! #15300
Unanswered
julien-minet
asked this question in
STM32 / Pyboard
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I searched for a long time how to activate VREFBUF on an L476Vxx (100 pin TQFP). On my board i want to use the internal reference at 2.5V and run the ADCs and DACs. I worked from the definition of the NUCLEO_L476RG board. On this board it is not necessary to activate VREFBUF but on a 100 pin package the activation of VREFBUF becomes mandatory to operate the DACs and ADCs (with the internal reference). The modification is not clean and I don't know how to integrate it into micropython. Currently the code has been added in the stm32/main.c file
At the beginning of the file:
#define VBUFREF
#include "../../lib/stm32lib/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_system.h"
and then just after the comment
// At this point everything is fully configured and initialized.
mp_printf(&mp_plat_print, "L476VGT6: VREFBUF overwrite init\n");
SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SYSCFGEN); // needed to modify VREFBUF
LL_VREFBUF_SetVoltageScaling(LL_VREFBUF_VOLTAGE_SCALE1);
LL_VREFBUF_DisableHIZ();
LL_VREFBUF_Enable();
Is there a clean solution to integrate this code into micropython?
Sincerely,
Julian
Beta Was this translation helpful? Give feedback.
All reactions