I'm using the STM32U575CIU microcontroller and implementing the ADC driver using LL libraries. The problem is that LDORDY bit is never set, so the ADC isn't ready to get values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-09-22 1:13 AM
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-09-22 2:03 AM
You need to switch on VDDA:
// get access to PWR
SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_PWREN);
nop();
// switch voltage monitor on
SET_BIT(PWR->SVMCR, PWR_SVMCR_AVM1EN);
nop();
// wait until ready
while (READ_BIT(PWR->SVMSR, PWR_SVMSR_VDDA1RDY) == 0);
// switch off VDDA isolation
SET_BIT(PWR->SVMCR, PWR_SVMCR_ASV);
// we do not need access to the PWR domain
CLEAR_BIT(RCC->AHB3ENR, RCC_AHB3ENR_PWREN);
See RM0456
Reference manual
STM32U575/585 Arm®-based 32-bit MCUs, section 10.4.4 Independent analog peripherals supply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-09-22 2:03 AM
You need to switch on VDDA:
// get access to PWR
SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_PWREN);
nop();
// switch voltage monitor on
SET_BIT(PWR->SVMCR, PWR_SVMCR_AVM1EN);
nop();
// wait until ready
while (READ_BIT(PWR->SVMSR, PWR_SVMSR_VDDA1RDY) == 0);
// switch off VDDA isolation
SET_BIT(PWR->SVMCR, PWR_SVMCR_ASV);
// we do not need access to the PWR domain
CLEAR_BIT(RCC->AHB3ENR, RCC_AHB3ENR_PWREN);
See RM0456
Reference manual
STM32U575/585 Arm®-based 32-bit MCUs, section 10.4.4 Independent analog peripherals supply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-09-22 2:06 AM
Sorry,
// switch voltage monitor off
CLEAR_BIT(PWR->SVMCR, PWR_SVMCR_ASV);
should have been
// switch VDDA isolation off
SET_BIT(PWR->SVMCR, PWR_SVMCR_ASV);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-09-22 2:32 AM
Hello @JAltu.1​ and welcome to the Community :)
Is the ADC clock enabled? Are you clearing DEEPPWD?
If possible to share your code, so that it will be easier to understand the issue.
For more details about the ADC voltage regulator enable and disable sequences, refer to the RM0456n in Section 29.4.6: ADC Deep-power-down mode (DEEPPWD) and ADC voltage regulator (ADVREGEN).
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
Imen
Thanks
Imen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-09-22 3:17 AM
It works! Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-09-22 4:27 AM
Integrated into original answer
