cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L0 VREFBUF register config

lprzenioslo
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions
KDJEM.1
ST Employee

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 Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

4 REPLIES 4
KDJEM.1
ST Employee

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 Accept as Solution on the reply which solved your issue or answered your question.

lprzenioslo
Associate II

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 Employee

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 Accept as Solution on the reply which solved your issue or answered your question.

lprzenioslo
Associate II

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.