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

Andreas, THANKS for your answer. I did read this application note, similar to all solutions in internet for MCU's without dedicated Vbat pin, and would be nice that exist the same AN for F series for few reasons, first of all it's that L series it's designed to be used in a battery environment and F series not.

The C's to filter VDD in STM32F series drain from battery, if it is connected to VDD's, almost as much current than the RTC. I did measure with 5x100nf+2x4.7Uf+1uF murata X53 a total drainage of 1.4 uA, typical RTC drainage at 3.3 volt it's 1uA. 

This reduce the battery life to half in the better case. It's acceptable? Yeeeees, but the extra coin cell in the next year cost more than change to an LQFP48 package and use specific Vbat pin. 

If I add the cost and PCB space of the diodes, using a 32 pin package the situation gets worse. If I need to control a transistor to connect or disconnect coin cell from MCU use the same or more pins that "I did gain" when st did replaced the Vbat pin for a port pin. In all cases it's preferable to buy a 48 pin package. 

For all of this I ask to ST that warning in the datasheet that RTC and register backup it's only available in 48 pin packages with Vbat pin.

Thanks for your answer, was more constructive than others, Oring the external VDD and the coin cell was my first impulse but in a cost analysis it's better that I buy new MCU batch with 48 pin package and maybe use this 32 pin units in any project in the future that not use RTC.

THANKS AGAIN

Jan, I did use thousands of units of STM32 MCU with more than 64 pin with RTC and Vbat, and use 2 thousand of the 32 pin in an application that not use RTC, I carefully read datasheets and design in function of that. Allways the missing features are warning in the family table description.

I not bother with OSC32 when I see that are not present in less than 48 pin packages, because a "friend", a designer of another company, when can't use (cost issues) a extra crystal, connect VDDA to VBAT (with their schottky's) and he disconnect by software all the vdda domain but the LSI (and I think that IWDG is on too). I never used it but seems correct. I did see their proyects working, when I will have some time in the future I will change some development board to do this and check how he do this.

"Wouldn't it be strange the datasheet to say "VBAT pin is available only in VBAT pin packages"?"

Sorry for my bad english, I refer to that several time and you deliberately misrepresents what I said. The complete phrase it's " RTC and backup registers are available only in Vbat pin packages".

" 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."

I answer that, LSI it's in VDDA domain that can be energized without Vdd. "The VDDA voltage level must be always greater or equal to the VDD voltage"

"where a similarly frustrated user complained that only a limited subset of boot loader options is available on the lower-pin-count devices, and also those are in conflict with similarly limited options for peripherals connections."

ALL OF THAT have warnings in the datasheets.

"there's no FSMC in 'F4 below 144 pins"

AGAIN, that's it's warned !!!! In the datasheet, FOR EXAMPLE https://www.st.com/resource/en/datasheet/stm32f405rg.pdf Table 2 WARNING for the R package NO FSMC and in note 1 of the same table SAYS "For the LQFP100 and WLCSP90 packages, only FSMC Bank1 or Bank2 are available...."

CATCH MY POINT?

When a FEATURE announced to ALL the family it's NOT present a appropriate warning CLEARLY mark that some device it's not present or crippled!

" 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 (ST Employee)​ , can such "broad request" be brought up in some way?"

Finally!!!! Some common sense here and not unconditional brand defense! Bravo! Please, ST, warning this in all less than 48 pin packages and ALL would be ok, I use the part when I not need RTC without VDD.

"It is probably left unconnected, but in fact it does not matter,"

If it's connected I can use it to perhaps (I not verify that) measure the VDD voltage.