2016-05-11 03:43 AM
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-rtc2016-05-11 05:33 AM
You have an external LSE crystal? You place the chip in STANDBY?
2016-05-11 06:12 AM
No external crystal used. i want to use internal crystal. I use LSI mode. i am turning off the device but when it turn off the device VBAT pin will get 3 v immediately.
2016-05-11 07:21 AM
Hi tira.jay,
Are you putting the device into standby mode correctly before turn off the main supply. It will better you share code. -Hannibal-2016-05-11 08:18 AM
No external crystal used. i want to use internal crystal. I use LSI mode. i am turning off the device but when it turn off the device VBAT pin will get 3 v immediately.
Last I checked the LSI isn't in the low power domain.2016-05-11 10:25 PM
Hey Hannibal, the device is not in standby Mode. It continuously updating RTC and do other IOs On and Off as requirements.
2016-05-11 10:32 PM
Hey clive1, Is it required that we need external crystal for Internal RTC working? Means for LSE mode is must for Internal RTC drive, when Power is not available?
2016-05-11 10:54 PM
2016-05-11 11:07 PM
Here i have shared my code. I enable RTc Using RTC_Initialize function. 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 .
Here is stm32f4xx_it.c file i use.
#include ''stm32f4xx_it.h''
/******************************************************************************/
/* Cortex-M3 Processor Exceptions Handlers */
/******************************************************************************/
/**
* @brief This function handles NMI exception.
* @param None
* @retval None
*/
void
NMI_Handler(
void
)
{
}
/**
* @brief This function handles Hard Fault exception.
* @param None
* @retval None
*/
void
HardFault_Handler(
void
)
{
/* Go to infinite loop when Hard Fault exception occurs */
while
(1)
{
}
}
/**
* @brief This function handles Memory Manage exception.
* @param None
* @retval None
*/
void
MemManage_Handler(
void
)
{
/* Go to infinite loop when Memory Manage exception occurs */
while
(1)
{
}
}
/**
* @brief This function handles Bus Fault exception.
* @param None
* @retval None
*/
void
BusFault_Handler(
void
)
{
/* Go to infinite loop when Bus Fault exception occurs */
while
(1)
{
}
}
/**
* @brief This function handles Usage Fault exception.
* @param None
* @retval None
*/
void
UsageFault_Handler(
void
)
{
/* Go to infinite loop when Usage Fault exception occurs */
while
(1)
{
}
}
/**
* @brief This function handles SVCall exception.
* @param None
* @retval None
*/
void
SVC_Handler(
void
)
{
}
/**
* @brief This function handles Debug Monitor exception.
* @param None
* @retval None
*/
void
DebugMon_Handler(
void
)
{
}
/**
* @brief This function handles PendSVC exception.
* @param None
* @retval None
*/
void
PendSV_Handler(
void
)
{
}
/**
* @brief This function handles SysTick Handler.
* @param None
* @retval None
*/
__IO uint32_t TimmingDelay;
void
SysTick_Handler(
void
)
{
if
(TimmingDelay !=0)
{
TimmingDelay --;
}
}
/******************************************************************************/
/* STM32Fxxx Peripherals Interrupt Handlers */
/* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */
/* available peripheral interrupt handler's name please refer to the startup */
/* file (startup_stm32fxxx.s). */
/******************************************************************************/
/**
* @brief This function handles PPP interrupt request.
* @param None
* @retval None
*/
/*void PPP_IRQHandler(void)
{
}*/
/**
* @brief This function handles EXTI0_IRQ Handler.
* @param None
* @retval None
*/
int
cnt1, cnt2, cnt_neww ;
extern
int
PWM_period, hh, decrem,cnt_nmbr,Nmbr_turns,Sampling,macro, limites,steps,test;
void
TIM2_IRQHandler(
void
)
{
}
void
TIM3_IRQHandler(
void
)
{
}
void
TIM4_IRQHandler(
void
)
{
}
void
TIM1_CC_IRQHandler(
void
)
{
}
/*
#define max_wordlen1 18000
extern void Delay(__IO uint32_t nCount);
volatile char received_str1[max_wordlen1+1];
volatile char ascii_of_char1[1024];
extern void USART_puts(USART_TypeDef *USARTx, volatile char *str);
//volatile char a[20][100];
void USART1_IRQHandler(){
while (USART_GetITStatus(USART1, USART_IT_RXNE)) {
static int cnt1=0;
char ch1;
ch1= USART_ReceiveData(USART1);
received_str1[cnt1] = ch1;
USART_SendData(USART1, received_str1[cnt1]);
cnt1=cnt1+1;
if(received_str1[cnt1] == '
')
{
cnt1=0;
}
USART_ClearITPendingBit(USART1, USART_IT_RXNE);
}
}
*/
extern
int
e;
#define max_wordlen6 18000
extern
void
Delay(__IO uint32_t nCount);
volatile
char
received_str6[max_wordlen6+1];
volatile
char
ascii_of_char6[1024];
volatile
char
p[1024];
extern
void
USART_puts(USART_TypeDef *USARTx, volatile
char
*str);
volatile
char
a[20][100];
void
USART6_IRQHandler(){
while
(USART_GetITStatus(USART6, USART_IT_RXNE)){
static
int
cnt6=0;
static
int
m=0;
char
ch6;
ch6= USART_ReceiveData(USART6);
USART_SendData(USART1, ch6);
/*//received_str6[cnt6] = ch6;
//memset( p, '\0', sizeof(p) );
//if((e>=9)){
//p[m]= received_str6[cnt6];
//USART_SendData(USART1, received_str6[cnt6]);*/
cnt6=cnt6+1;
//m=m+1;
if
(received_str6[cnt6] ==
'
'
) {
//strcpy(ascii_of_char6,p);
cnt6=0;
//m=0;
}
//}
}
}
/**
* @brief This function handles EXTI15_10_IRQ Handler.
* @param None
* @retval None
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
Help with this also.
2016-05-12 10:26 AM
Is it required that we need external crystal for Internal RTC working? Means for LSE mode is must for Internal RTC drive, when Power is not available?
When the primary power is removed the LSI will stop, only the LSE is in the low power domain provided by the battery. This is why my first question was are you using the external clock.This could be due to the higher consumption of the LSI, or it's generally lack of stability for timing application, even with stable voltage and temperature.