2022-09-16 12:40 AM
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.
Solved! Go to Solution.
2022-09-16 03:45 AM
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.
2022-09-16 03:45 AM
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.
2022-09-16 03:47 AM
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.
2022-09-16 08:24 AM
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.
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.
2022-09-16 09:15 AM
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.