Is RTC crystal necessary on blue board ?

DrBanana
Thu Sep 15, 2016 1:03 am
I have one of STM32F103C8 blue board, Im wondering, if I remove the RTC, will it cause any kind of problem ? I want to make it work on battery and make the board run on least power possible.

RogerClark
Thu Sep 15, 2016 1:47 am
Why do you want to remove the crystal

You may just be able to turn off the LF oscillator, e.g. there is probably a control reg for this.

Normally people want the RTC crystal for low power operation as its used for the low power modes.

If you just want to run off the main clock, you can change the main PLL multipler, or you can change the main clock input to bypass the PLL multiplier entirely, and in my tests this reduces the power to around 10mA, as its running on an 8Mhz clock


DrBanana
Thu Sep 15, 2016 1:58 am
I want to make board more clean, and it already using 8Mhz crystal, and I’m not using RTC, so basically 32.768k crystal seems useless. I’m wondering if it is removed, will there be a problem?

RogerClark
Thu Sep 15, 2016 2:10 am
I don’t think anyone has tried removing it from a Blue Pill, but the Maple mini doesn’t have one and it works and the codebase is the same (as far as I’m aware)

https://github.com/leaflabs/maplemini/b … lemini.pdf

So I think it would be fairly low risk to remove it, even if you had to make a minor change in the core code (which I don’t think you will need to)


Pito
Thu Sep 15, 2016 8:18 am
There is no risk to remove it.
Mind the PC13/14/15 have got different parameters (see the datasheet), and there are 2 capacitors against the ground hanging at the pins as well..

ahull
Thu Sep 15, 2016 8:32 pm
Pito wrote:There is no risk to remove it.
Mind the PC13/14/15 have got different parameters (see the datasheet), and there are 2 capacitors against the ground hanging at the pins as well..

DrBanana
Fri Sep 16, 2016 12:40 am
Thank you everyone, I will remove that crystal and it’s caps.

Nutsy
Fri Sep 16, 2016 2:02 pm
What some boards have a time keeping RTC built in?

Or am I getting confused?

Ive actually ordered a real time clock board to add to my project, simply to keep date and time on…


ahull
Fri Sep 16, 2016 2:59 pm
Nutsy wrote:What some boards have a time keeping RTC built in?

Or am I getting confused?

Ive actually ordered a real time clock board to add to my project, simply to keep date and time on…


Nutsy
Fri Sep 16, 2016 5:38 pm
ahull wrote:

Not just some, but all STM32F103XXXX chips have a built in RTC, as do a most F0 F2 F3, F4 and L1 series… check the datasheet for other STM ARM devices, as they too probably have one. You simply add the caps, crystal and battery. Most of the suitable STM32duino boards are either already populated with the crystal and caps, or there is provision for them on the board. Depending on the board, adding the battery can be the only trick part.

The built in RTC is not as accurate as say time derived from a GPS, since it uses a 32676 kHz crystal, same as most wrist watches, but for most purposes it is perfectly acceptable. Occasionally an external RTC board might be a better bet, but only if you need more accuracy than the STM provides. I would say that the DS1302 “arduino RTC” boards that litter the dark corners of the internet are probably no better at keeping time than the STM32F103.


martinayotte
Fri Sep 16, 2016 6:26 pm
Personally I don’t like DS1302 or DS1307, because they don’t have any alarm.
I like more the DS1337 or PCF8563.

ahull
Fri Sep 16, 2016 11:15 pm
The date and time are saved as a unix time stamp which is preserved so long as there is a usable voltage on vbat. If that voltage drops below the safe threshold then the time goes back to zero which is defined as 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970.

Conventionally on most STM32duino compatible boards the VBat for the RTC is a separate feed from the main voltage for the ARM processor and other peripherals. On some boards however, the “ugly board” for example, the two tied together. This is usable, for battery projects, but you do need to ensure that the microprocessor makes good use of sleep and deepsleep modes, and will not wakeup, or run the battery down further when the voltage of the combined battery source is getting close to the minimum allowed by the RTC power domain, otherwise the battery will go sufficiently flat to loose the time and date at regular intervals. and the time and date will need to be reset. If you power the RTC from a separate coin cell, it will probably last several years, depending on the capacity and self discharge rate of the coin cell.


Leave a Reply

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