cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4xx Internal RTC not Updating when Power is Off.

jay1991
Associate II
Posted on May 11, 2016 at 12:43

I am using Internal RTC of STM32F411RCT6. It's working Perfectly but I cant update it when Power is off. I want to say that i have connected 3 v DC supply with VBAT pin and Run my RTC program, it works good but when i turn off the Power then RTC is not Updating. If i check after some minutes, it starts from where we left it before. I have checked my program. It does not set the time every time we run the program. It just Get the time. Any Help?

Thank you...

#stm32f4-rtc #stm32f4xx #internal-rtc
14 REPLIES 14
Posted on May 12, 2016 at 19:36

One more Query that If i use NVIC priority for USART1 and USART6 then why its not working? I want to say that if i Use IRQ handler for both USARTS 1 and 6 , then its not showing USART6 received data to USART1. If i disable the USART1 IRQ handler then it will show the USART6 received data to USART1 .

Yeah, I'm not entirely sure what you have going on there. I'll observe that the USART's RX buffer is only one byte deep, and you don't check the TXE status of USART1 before stuffing data out. Also you don't need to explicitly clear RXNE, reading the USART->DR achieves that.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jay1991
Associate II
Posted on May 13, 2016 at 07:12

Hey clive1, I appreciate your answer. its helping me alot. now I am confused that if i uncommemt that USART1_IRQHandler() then its not working. So i have to check USART1 RXNE bit in USART6_IRQHandler()?

jay1991
Associate II
Posted on May 13, 2016 at 14:45

Hello Guys, I am using LSE mode configuration here but its not set the time and not updating. I have connected external oscillator at PC14 and PC15 pin of STM32F411RCT6. Any help?

I am mentioning my code for LSE mode

void

RTC_Initialize(

void

)
{
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
/* Allow access to BKP Domain */
PWR_BackupAccessCmd(ENABLE);
status = RTC_ReadBackupRegister(RTC_BKP_DR19);
/* Reset RTC Backup Domain */
/* LSE Enable */
RCC_LSEConfig(RCC_LSE_ON);
/* Wait until LSE is ready */
while

(RCC_GetFlagStatus(RCC_FLAG_LSERDY) == RESET);
/* RTC Clock Source Selection */
RCC_RTCCLKConfig(RCC_RTCCLKSource_LSE);
/* Enable the RTC */
RCC_RTCCLKCmd(ENABLE);
RTC_WriteProtectionCmd(DISABLE);
/* Wait for RTC APB registers synchronisation (needed after start-up from Reset) */
RTC_WaitForSynchro();
/* Enable write protection */
RTC_WriteProtectionCmd(ENABLE);
/* Write status */
RTC_WriteBackupRegister(RTC_BKP_DR19, 0x1234);
RTC_ClearITPendingBit(RTC_IT_WUT);
}

jay1991
Associate II
Posted on May 14, 2016 at 07:30

Hey clive1, I have connected 32k oscillator at PC 14 and PC 15. I want to know that still I need extra oscillator for LSE mode work?

Posted on May 14, 2016 at 15:55

The specifications for the oscillator and capacitors are important. There is an app note about how to select the values. One important consideration is the use of 6-7pF crystals not the 9 of 12pF type.

If the the oscillator is not starting when you enable the LSE, you will need to review the components and circuit. You don't specify a board, or provide a circuit diagram, so providing suggestions about what might be wrong is a bit challenging.

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