cancel
Showing results for 
Search instead for 
Did you mean: 

How to use RTC with battery backup in a 32 pin package?

Tarloth
Associate II

Hi, I did never ask in this forum but used STM32 MCUs for years. Allways I use 48+ pin parts and all work like a charm. I'm very happy with the family and did stop to use other Cortex brands years ago. 

In 2019 I did work in a project that did involves 2k units and use STM32F042K6T6. All working ok, but to overcome the future chips shortage I bought in excess of units to use in the next project that implies the use of RTC calendar and backup registers. COVID and other issues delayed the project until last month that have had the time to start it. When I was finishing the design, last week I notice that parts with less than 36 pins din't have VBat. 

Datasheet announces RTC backuped with VBat as a feature of the entire family and NOTHING say's about "in packages less than 48 pins this function it's not available". When I check with other stm32F devices in 32 or 20 pin packages the same occurs, NO Vbat.

Exist any alternative to overcome this issue? I'm not really comfortable buying a lot of more expensive parts only to have the battery backuped RTC that is announced for all the packages in the datasheet. By the way, what it's the sense of have a full featured RTC even with backup registers if I never can use it when VDD is disconnected? I need to reprogram the device every time that power is off?

Thanks in advance and sorry for my bad english

12 REPLIES 12

No pins for OSC32 either.

On the L series the VBAT was absent too, the idea being it's already battery powered. On those you go into STANDBY to cut power usage,

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Tarloth
Associate II

Tesla, thanks for your answer. Yes, but I need to add a battery and a charger circuit! I not need a circuit that works on battery, only need a RTC working!. Nothing it's said in the datasheet about this limitation. Osc32 it's not a problem to me, I can calibrate internal oscillator with good aproximation for this aplication using external crystall when vdd it's present. By the way, CAN + USB not working together either

Tarloth
Associate II

Any idea? I'm pretty sure that this omission in the data sheet is false advertising from ST. Other features that are not present with less than 48 pins are clearly and unambiguously noted. I have used thousands of ST units with complete success, it is a shame to throw so many years of trust to the floor for this bad move by the company.

I feel your pain but face it. The VBAT pad is simply not brought out to a pin, and there's no way to undo that.

JW

Tarloth
Associate II

Perfect, you answer the obvious here. Vbat isn't at any pin, congratulations, I say that in the first post.

Then my question is: How I can use the RTC when VDD it's off? 

Datasheet says that RTC and register backup is a feature of all the parts, not only the 48 pin part! How is connected internally the Vbat pin when it's no externally connected? How can maintain working the oscillator and all the devices in the VBAT domain (and only those internal devices)? They are simply disconnected? Or internally vbat it's connected to VDD and I need to OR'ing the VDD with a battery and detect when VDD it's off? I need to put ideal diodes to avoid power losses and take off the filter capacitors out of these to avoid battery discharge? 

I asking for a valid and probed ST engineering answer to overcome this issue. NOBODY AT ST ANSWER OR SAY NOTHING. I insist, nothing in the datasheet notice about this issue in low pin count packages but it do in other internal features as Vssa, less SPI, Less I2C, etc, features that are missing in low pin packages! If the datasheet would said "Available only in Vbat pin packages" then there would be no problem at all, customer buy this part to use RTC only with VDD.

Andreas Bolsch
Lead II

See AN4718. Except for two Schottky diodes, it's purely a software issue. You won't get down to the very same current draw as with VBAT pin, but still acceptable.

> If the datasheet would said "Available only in Vbat pin packages"

Wouldn't it be strange the datasheet to say "VBAT pin is available only in VBAT pin packages"? 🙂 I agree that documentation can always be improved, but in this case, as you remarked yourself, RTC is still in fact usable albeit in a limited fashion. And, as Clive pointed out above, in the 32-pin (and less) packages, you don't have OSC32 pins either, so you can't use RTC in its full capacity anyway.

Coincidentally, we've had a thread here recently, where a similarly frustrated user complained that only a limited subset of bootloader options is available on the lower-pin-count deiveces, and also those are in conflict with similarly limited options for peripherals connections. While some such limitations are obvious - e.g. if all pins for a peripheral are available only in higher-pin-count packages - some are rather convoluted - e.g. if *most* pins for a peripheral are available on the lower-pin-count package but those are not sufficient for *every* possible configuration of a peripheral. What to do in that case?

What could be done instead of writing a bunch of "this and that does not work in this and that peripheral" - which will lead to DS bloat and half-truths such as "there's no FSMC in 'F4 below 144 pins" (which is not true, FSMC is still there just not usable for its most common purpose - ST corrected that one later but there was discussion around it) - it might perhaps be better to write an appnote discussing issues arising from omitting pins in depth, perhaps with a bunch of examples like this one; and the add link to that appnote to every smaller-than-maximum-pin-count STM32's web folder. @Imen DAHMEN​  , can such "broad request" be brought up in some way?

> How is connected internally the Vbat pin when it's no externally connected?

It is probably left unconnected, but in fact it does not matter, both ways the result is the same: if there's no VDD, there's no VBAT; and if there's valid VDD, VBAT is internally switched to VDD exactly as it is when VBAT pin is present.

So, in both cases, you need to keep VDD powered, if you want RTC to run.

JW

I can completely understand that you are dissatisfied in this case, however the community relies primarily on mutual help between users (see About Community, General Use).

In addition to the community, you can also get direct and personal support via Online Support OLS, alternatively you can contact your local distributor or the nearest ST office.

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.

One more thing, which you maybe overlooked:

> Osc32 it's not a problem to me, I can calibrate internal oscillator with good aproximation for this aplication

No, you can't use any of the internal oscillators in VBAT mode. Only LSE works in VBAT mode.

0693W00000WJVqsQAH.png 

JW