Skip to main content
migmel
Associate III
March 23, 2023
Solved

Cannot make ADC example working with RTC when using LSE crystal source

  • March 23, 2023
  • 2 replies
  • 1106 views

Hello guys,

I have adapted this example from repository to work with a STM32L071CB:

STM32Cube\Repository\STM32Cube_FW_L0_V1.12.2\Projects\NUCLEO-L073RZ\Examples_LL\ADC\ADC_SingleConversion_TriggerSW_DMA

It works fine until I want to add RTC and select LSE as RTC clock source.

If I select LSI as clock source for RTC, it works fine.

I have a loop showing the converted data every second, but when selected LSE as clock source for RTC, it does not show any results.

I think it makes not sense to use LSI as clock source for RTC, so I am stuck in this point.

Any idea on what might be the problem?

This topic has been closed for replies.
Best answer by Peter BENSCH

Well, you have to make sure that LSE works, of course.

Have you set the LSE to Crystal/Ceramic (assuming you are using a Crystal)?

You can also enable the Master Clock Output (MCO) and set the MCO Source Muxer to LSE, then the LSE frequency will be visible on the MCO pin if the LSE is working.

Feel free to share here the components used on the LSE, if possible also the layout section around the LSE. You can also check the latter yourself with AN2867, section 7.

Regards

/Peter

2 replies

Peter BENSCH
Peter BENSCHBest answer
Technical Moderator
March 23, 2023

Well, you have to make sure that LSE works, of course.

Have you set the LSE to Crystal/Ceramic (assuming you are using a Crystal)?

You can also enable the Master Clock Output (MCO) and set the MCO Source Muxer to LSE, then the LSE frequency will be visible on the MCO pin if the LSE is working.

Feel free to share here the components used on the LSE, if possible also the layout section around the LSE. You can also check the latter yourself with AN2867, section 7.

Regards

/Peter

In order 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.
migmel
migmelAuthor
Associate III
March 23, 2023

Thank you for your reply,

I think the LSE might be malfunctioning

I will do what you've suggested