Blue Pill crystal does not start

flodejr
Sat Oct 21, 2017 8:57 pm
Hi,

I am trying to use the RTC functions on the blue pill using backup vbat, but the LSE crystal doesn’t seem want to start at all.
Any recommendations of crystals that could be used to replace it? Must I use another MC-306 or can I use a tuning fork crystal?


RogerClark
Sat Oct 21, 2017 9:00 pm
This question has been asked before, mainly by people using boards without the crystal.

Try Googling this site for terms like RTC crystal, or 32khz crystal.


edogaldo
Sun Oct 22, 2017 1:05 pm
[flodejr – Sat Oct 21, 2017 8:57 pm] –
Hi,

I am trying to use the RTC functions on the blue pill using backup vbat, but the LSE crystal doesn’t seem want to start at all.

How did you check the problem is in the LSE?
Anyway base on my experience, problems in the crystal startup can be due to shortcuts between the crystal pins.


ahull
Mon Oct 23, 2017 9:18 am
[flodejr – Sat Oct 21, 2017 8:57 pm] –
Hi,

I am trying to use the RTC functions on the blue pill using backup vbat, but the LSE crystal doesn’t seem want to start at all.
Any recommendations of crystals that could be used to replace it? Must I use another MC-306 or can I use a tuning fork crystal?

Are the load capacitors fitted to your board? I have used a bunch of different 32768 Hz cheap watch crystals some from ebay, some recovered from my junk bin, and they all just worked. Others on this forum have not been so lucky.

Which board are you using?

The supplier I bought from in 2015 is still listing them (first item on the list)… https://www.ebay.co.uk/sch/sis.html?_nk … 2749.l2658
… and that ebay link will get you lots of similar options.


flodejr
Wed Oct 25, 2017 1:36 am
[edogaldo – Sun Oct 22, 2017 1:05 pm] –

[flodejr – Sat Oct 21, 2017 8:57 pm] –
Hi,

I am trying to use the RTC functions on the blue pill using backup vbat, but the LSE crystal doesn’t seem want to start at all.

How did you check the problem is in the LSE?
Anyway base on my experience, problems in the crystal startup can be due to shortcuts between the crystal pins.

I did a code debug and the code was waiting on settings on the RTC register, that means the clock signal is not running.


flodejr
Wed Oct 25, 2017 1:53 am
[ahull – Mon Oct 23, 2017 9:18 am] –

[flodejr – Sat Oct 21, 2017 8:57 pm] –
Hi,

I am trying to use the RTC functions on the blue pill using backup vbat, but the LSE crystal doesn’t seem want to start at all.
Any recommendations of crystals that could be used to replace it? Must I use another MC-306 or can I use a tuning fork crystal?

Are the load capacitors fitted to your board? I have used a bunch of different 32768 Hz cheap watch crystals some from ebay, some recovered from my junk bin, and they all just worked. Others on this forum have not been so lucky.

Which board are you using?

The supplier I bought from in 2015 is still listing them (first item on the list)… https://www.ebay.co.uk/sch/sis.html?_nk … 2749.l2658
… and that ebay link will get you lots of similar options.

I have ordered some crystals and waiting for delivery. Anyway right now I have some other problems on the RTC. I may have to rely on an external RTC and if thats the case, I would rather go on the Amtel platform.


ahull
Wed Oct 25, 2017 9:47 am
[flodejr – Wed Oct 25, 2017 1:53 am] –
I have ordered some crystals and waiting for delivery. Anyway right now I have some other problems on the RTC. I may have to rely on an external RTC and if thats the case, I would rather go on the Amtel platform.

What problems are you having? In my opinion, I found the RTC pretty easy to use, and very flexible, (once I had figured out how it worked :oops: ).

Any issues I encountered were related to the type of STM32 board I was using. Some boards implement the RTC circuitry correctly. Others take a few liberties.


Squonk42
Wed Oct 25, 2017 7:34 pm
Here is the must-read application note on the STM32 oscillator design:
http://www.st.com/content/ccc/resource/ … 221665.pdf

ahull
Wed Oct 25, 2017 8:07 pm
Any of the Bluepills I used, just worked, so you may simply have a defective board. I tend to buy these cheap boards two at a time, partly because there is no quality guarantee. Having said that, all the boards I have bought, did work.

I touched on this briefly in this thread -> viewtopic.php?t=79&start=40#p2844
.. and here … -> viewtopic.php?t=658

If you have access to an oscilloscope, you can verify if the oscillator is working.


flodejr
Wed Oct 25, 2017 8:36 pm
[ahull – Wed Oct 25, 2017 9:47 am] –

[flodejr – Wed Oct 25, 2017 1:53 am] –
I have ordered some crystals and waiting for delivery. Anyway right now I have some other problems on the RTC. I may have to rely on an external RTC and if thats the case, I would rather go on the Amtel platform.

What problems are you having? In my opinion, I found the RTC pretty easy to use, and very flexible, (once I had figured out how it worked :oops: ).

Any issues I encountered were related to the type of STM32 board I was using. Some boards implement the RTC circuitry correctly. Others take a few liberties.

I am not sure if I have implement the alarm function correctly. It seems that the RTC clock will stop when the alarm interrupt is triggered and you have to re-engage it, losing a few ticks or more depending on how your ISR works. Anyway, I have reverted to polling and RTC with Alarm is working now off LSI, waiting for the crystals to arrive, hopely I can resolve the LSE problem.


asmallri
Thu Dec 07, 2017 3:23 pm
This is the same behaviour I am seeing. If I do not use the alarm function the RTC keeps accurate both when the system is continually powered up and when the system is shutdown for hours or days. However if I put the processor into a deepsleep and wake-up every 2 minutes then the RTC will lose several minutes per day.

RogerClark
Thu Dec 07, 2017 7:59 pm
are you sure this is the same problem

It potentially sounds like a software issue related to waking and sleeping


ahull
Fri Dec 08, 2017 11:38 am
It sounds to me like you are setting the wrong clock source for the RTC (or the wrong source is set by some other code within the libs you are using), when entering your sleep mode. You need to ensure the 37768 Hz crystal remains the clock source for the RTC, otherwise you may end up loosing accuracy, or stopping the RTC completely.

https://electronics.stackexchange.com/q … ock-source


ag123
Sat Dec 09, 2017 6:27 am
more recently i’ve somewhat improved on my 32k crystal soldering, a recent attempt here
viewtopic.php?f=3&t=2602&p=38423#p38423
oh yes, on another note, i keep vbat powered on a coin cell battery (cr2032), rather often i simply unplug usb, cutting off power, leaving rtc running on the coin cell. reconnect, and time is kept, no issues, i didn’t meddle with alarm or sleep though. i’m not too sure if on MM, BP if 3v3 is connected to VBAT
i think i read somewhere it is recommended if you do not power vbat separately

Leave a Reply

Your email address will not be published. Required fields are marked *