2023-03-30 03:16 AM
Hello,
I am experiencing the AWD interrupt always being activated when using the analog watchdog on the STM32G0B0 to guard channel 0. Here is my configuration:
systemclock = 64MHz
ADC ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4
Resolution = 12B
ContinuousConvMode = ENABLE
overrun = ADC_OVR_DATA_OVERWRITTEN
SamplingTimeCommon2 = 160.5
OversamplingMode = ENABLE
Oversampling.Ratio = ADC_OVERSAMPLING_RATIO_32
Oversampling.RightBitShift = ADC_RIGHTBITSHIFT_5
Oversampling.TriggeredMode = ADC_TRIGGEREDMODE_SINGLE_TRIGGER
TriggerFrequencyMode = ADC_TRIGGER_FREQ_HIGH
and for the AWD config:
AnalogWDGConfig.WatchdogNumber = ADC_ANALOGWATCHDOG_2;
AnalogWDGConfig.WatchdogMode = ADC_ANALOGWATCHDOG_SINGLE_REG;
AnalogWDGConfig.Channel = ADC_CHANNEL_0;
AnalogWDGConfig.ITMode = ENABLE;
AnalogWDGConfig.HighThreshold = 0xFFF;
AnalogWDGConfig.LowThreshold = 3000;
In this configuration, the AWD interrupt was consistently triggered even when the guarded channel was directly wired to 3.3V, and the measured ADC value that triggered the interrupt was 0xFFF! After making some (illogical) updates, the interrupt is no longer being generated, indicating that the AWD is now functioning properly. These updates include:
The behavior of the AWD being consistently triggered is present on both AWD2 and AWD3. However, according to the errata sheet, only AWD1 has some limitations.
Can you please explain the behavior to me and how to fix that?
Thanks.
2023-03-30 03:24 AM
Hello @Amel NASRI
Could you please check this problem, and if there is a workaround to be used?
for my application, I need ratio 32 and bitshift 5
Thanks in advance