Skip to main content
lprzenioslo
Associate III
September 16, 2022
Solved

STM32L0 VREFBUF register config

  • September 16, 2022
  • 4 replies
  • 1560 views

Hello,

I am using the STM32L071 with the latest STM32 studio software. I cannot find any sign of the VREFBUF configuration in the libraries (I need to enable the internal voltage reference for the COMP1 peripheral). I have found this article for H7 device:

https://st.force.com/community/s/article/how-to-configure-vrefbuf-on-my-stm32

But it seems that the VREFBUF entry in the graphical interface is missing (in the libraries code as well).

I would appreciate all help and feedback.

This topic has been closed for replies.
Best answer by KDJEM.1

Hi @Community member​ 

If you refer to RM0377, you can conclude that the Voltage reference buffer "VREFBUF" is not supported in STM32L0x1 devices.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Kaouthar

4 replies

KDJEM.1
KDJEM.1Best answer
ST Technical Moderator
September 16, 2022

Hi @Community member​ 

If you refer to RM0377, you can conclude that the Voltage reference buffer "VREFBUF" is not supported in STM32L0x1 devices.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Kaouthar

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.
lprzenioslo
Associate III
September 16, 2022

Thank you for the answer @KDJEM.1​ ,

Currently I am unable to force the COMP1 interrupt, so I assumed the internal VREF is not turned on- could you help me turning it on in case that is the issue? I have set it as the COMP "-" input source.

KDJEM.1
ST Technical Moderator
September 16, 2022

Hello @Community member​ ,

If you use the STM32CubeMX, make sure that select the interrupt mode with Rising/Falling edges detection in Trigger mode as shown in the below figure.

0693W00000Sva7iQAB.png 

Also, I advise you to get inspired from the available COMP_Interrupt example in the STM32CubeL0 MCU package.

This example may help you in the configuration by following the instructions in the readme file.

Kaouthar

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.
lprzenioslo
Associate III
September 16, 2022

Thanks @KDJEM.1​ , what I was missing is:

 /*##-2- Configure the Vref #################################################*/
 /* Enable the Vrefint */
 HAL_COMPEx_EnableVREFINT();
 
 /*##-3- Start teh COMP1 and enable the interrupt ###########################*/ 
 if(HAL_COMP_Start(&hcomp1) != HAL_OK)
 {
 /* Initiliazation Error */
 Error_Handler();
 }

Now it works.