STM32U575 ADC4 unable to set AUTOFF bit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-03-28 9:35 AM
I am unable to switch on the AUTOFF bit in ADC4.
DS reads about ADC_PWRR/AUTOFF: The software is allowed to write this bit only when ADEN bit is cleared to 0 (this ensures that no conversion is ongoing).
But if this bit is set, the ADC doesn't set ADRDY flag if enabled.
LL_ADC_SetLPModeAutoPowerOff(ADC4, LL_ADC_LP_AUTOPOWEROFF_ENABLE);
LL_ADC_ClearFlag_ADRDY(ADC4);
LL_ADC_Enable(ADC4);
while(!LL_ADC_IsActiveFlag_ADRDY(ADC4)) {} // here waits forever
If I omit the ADRDY check and simply wait some time and then I start the conversion, the ADC works and converts inputs correctly.
If I omit the AUTOFF setting, the code works ok. If I try to set the bit after enable, the bit remain unchanged (acording to DS)..
My question is: How to set the AUTOFF bit? Isn't it a bug in silicon?
- Labels:
-
ADC
-
Bug-report
-
STM32U5 series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-05-02 8:47 AM
Hi @Tomas Hamouz,
Coming back to your question, I hope it was solved since the time you asked it. That would be interesting to share your findings.
On my side, I have following 2 proposals:
- did you tried using the HAL driver instead of LL functions?
- In the implementation of ADC_Enable (https://github.com/STMicroelectronics/stm32u5xx_hal_driver/blob/5313c6919f88e8ec4212da91bbe1146d4262d44c/Src/stm32u5xx_hal_adc.c), it continues to enable ADEN until ADRDY becomes 1. Can you make a similar implementation?
-Amel
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.
