cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L476 RTC with SuperCap

gokhannsahin
Associate II
Posted on January 14, 2018 at 10:34

Hi everyone,

Should I connect a any series resistor to the super capacitor while using a super capacitor that is 1F 5.5V instead of a battery? Or I can connect directly the capacitor to VBat pin?

#power-backup-supercapacitor-rtc #rtc
30 REPLIES 30
Posted on January 25, 2018 at 05:52

I tried the following macro, but it didn't solve this problem.

__HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_HIGH);

It waits for the LSE_READY_BIT to be set, finally get the timeout.

/* Wait till LSE is ready */

while(READ_BIT(RCC->BDCR, RCC_BDCR_LSERDY) == RESET)

{

   if((HAL_GetTick() - tickstart) > RCC_LSE_TIMEOUT_VALUE)

   {

   return HAL_TIMEOUT;

   }

}
A. M.
Associate II
Posted on January 25, 2018 at 13:06

I would never do it (put a battery into a device) to others...

I agree though it may depend on a type of a device.If so, a need of a battery replacement needs to be well known to the user (dedicated enclosure, signs, etc).

Especially if devices go through distribution channels, they also work/stay in various env conditions,

and probably none of us would like to buy a device which just stops working after 2 years for an 'unknown reason'...

I've found such a case (closed within an enclosure, even soldered to pcb) in my temperature controller recently (produced by a well-known brand on the stove market) when doing a repair. I threw it out through a window right away and have replaced it by a super-cap :)

gokhannsahin
Associate II
Posted on January 25, 2018 at 21:01

After shorting the pins of capacitor, it can pass LSE ready check. Otherwise,so after the capacitor is charged, it can't pass. I'm so confused. That is a very ridiculous situation. Anybody has a solution or suggetion?

T J
Lead
Posted on January 25, 2018 at 22:52

Your device may be damaged by high current charging the capacitor at any stage in your development.

Have you tried a new processor since the 100R was installed ?

I would adjust that circuit to protect the pin at installation.

3V3  -  diode  -  100R  -  Cap+  -1k -   processor pin

Posted on January 25, 2018 at 22:51

 ,

 ,

After shorting the pins of capacitor, it can pass LSE ready check.

Do you mean, you keep shorted the capacitor pins when starting up, or do you release the short before you start up the mcu?

 ,Otherwise,so ,after the capacitor is charged, it can't pass.

Try to remove the capacitor and short the VBAT pin to VCC.

Does it now pass the LSE ready check?

JW

[EDIT] What's the value of RCC_LSE_TIMEOUT_VALUE? Can you increase it?

https://community.st.com/0D70X000006SzwKSAS

 ,
Posted on January 26, 2018 at 05:33

See this... 

https://xtronic.org/download/schematic-design/aacircuit-v1-28-ascii/

 

Then you can show the text here as a code to keep the formatting. 

gokhannsahin
Associate II
Posted on February 15, 2018 at 07:05

After the capacitor charged, it can't pass systemconfigclock. I tried to short-circuit the pins of supercap and its voltage dropped around 1V. After that, it could pass and charge the capacitor again until its voltage is around 2.3V, but it can't pass again after the restart when its voltage is around 2.3V.

Posted on February 16, 2018 at 00:43

do you have a resistor between the super cap and the processor pin ?

Posted on February 16, 2018 at 05:31

Yes, there is a resistor is 100R. 

Posted on February 16, 2018 at 06:07

can you try a 10k ?  4k7 at worst a 1k.

if the calcs are correct, 36k should provide enough current to supply the RTC memory and counter set.

that will isolate any high current spikes around  1v - 1.4v....

Doc D025976 Rev 4

Table 37 page 116/232

IDD(Standby with RTC)  Supply current in Standby mode (backup registers retained), RTC enabled

about 40uA max at 3.3 V 

Using a resistor in series from the Supercap to the Pin:

A resistor is going to drop some voltage.

Checking the table, a lower voltage draws less, so its irrelevant.

but we must ensure the voltage drop does allow the pin to fall below 1.8v (minimum voltage to support RTC)

V=IR.  we can drop   3.3 - 1.8 = 1.5V     before the RTC input voltage is below spec.1.8V

R = V/I         1.5 / 40e-6  =  37k5                            R needed in series (maximum)

if you use a 36k, R will drop 36k x 40e-6 = 1.4v    across the resistor.

the pin should sit at 3.3 - 1.4 =  1.9V,                     after power off is ok, above 1.8v

maybe too close for comfort.

try a 10k, or 22k, but not  38k

I guess a 38k is the very maximum that will work.

3v3 to diode to 100R to Super cap to 22k to processor pin.

as a suggestion.