Skip to main content
HBavi.1
Associate II
August 10, 2021
Question

I want to develop PVD to generate interrupt if voltage in STM32G030 using ADC Analog Watchdog (AWD)

  • August 10, 2021
  • 9 replies
  • 7676 views

I've a question related to how AWD works in case of STM32G030 controller. As per my understanding, AWD analog watchdog status bit is set if the analog voltage converted by the ADC is below a low threshold or above a high threshold. These thresholds are programmed in the 12 least significant bits of the ADC_HTR and ADC_LTR 16-bit registers. An interrupt can be enabled by using the AWDIE bit in the ADC_CR1 register.

However, STM32Cube IDE doesn't allow to configure low threshold value other than 0 and according to parameter description "low threshold value must be set to 0". In that case how STM32G030 generates an interrupt if it goes below 2.5V?

0693W00000D23J7QAJ.png

This topic has been closed for replies.

9 replies

TDK
August 10, 2021

Seems like it's a CubeMX bug. You can adjust the lower threshold on AWD 2 and 3, but the UI tries to be smart and won't let you set LT above HT, or HT below LT. Maybe the AWD 1 HT field is missing an event which updates the range of LT.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Amel NASRI
ST Technical Moderator
August 23, 2021

Hi @HBavi.1​  & @TDK​ ,

It seems that some restrictions related to thresholds setup for analog watchdog 1 are wrongly implemented. The implementation has to be aligned with the description provided in the table "Analog watchdog comparison" of RM0454.

In this table, we see that values of LT & HT depend on the resolution, mainly when it is less than 12-bit:

0693W00000Dq7HPQAZ.pngThat conditions aren't applicable for AWD2 & AWD3, that is why there is no such issue for both ones.

I add our STM32CubeMX @Khouloud ZEMMELI​ and @Khouloud OTHMAN​  on the loop of this discussion and, I kindly ask them to take care to report this issue to development team.

-Amel

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.
Khouloud OTHMAN
Associate
August 24, 2021

Hello @HBavi.1​ , @TDK​  & @Amel NASRI​ ,

Thanks for your feedbacks, You're right the issue is related to the STM32CubeMX tool implementing wrong restrictions for analog watchdog 1. This is reported internally to be fixed. I'll keep you posted with the updates.

Thanks for you contribution.

Internal ticket number: 112268  (PS: This is an internal tracking number and is not accessible or usable by customers). 

Khouloud.

SThon.1
Associate II
June 15, 2022

Hi,

any update on when the lower threshold issue is planned to be fixed?

It is still present in STM32CubeIDE v1.9.0 and STM32CubeMX v6.5.0.

Kind regards,

Steinar