AnsweredAssumed Answered

[solved]stm32f0 rtc pls help

Question asked by aslan.mehmet on Aug 21, 2015
Latest reply on Sep 6, 2015 by aslan.mehmet
I downloaded application note write code.my device(stm32f0discovery,stm32f051r8t6).the weird thing with cube generated code it doesnt work either.In addition if I put breakpoint on while loop when I look rtc I see RTC->ISR INIT(7.) not set it is weird if somebody knows answer thanks before hand



RTC->WPR = 0xCA;
RTC->WPR = 0x53;
RTC->ISR |= (1<<ISR_INIT_BIT);
while((RTC->ISR & (1<<ISR_INITF_BIT)) == 0){}//the program stucks here
RTC->PRER = 0;
RTC->PRER |= (127<<16);
RTC->PRER |= 255;
//here i will put time values
RTC->TR = 0;
RTC->TR = (5<<0);//second units
RTC->TR |= (1<<4);//second tens
RTC->TR |= (4<<8);//minute units
RTC->TR |= (2<<12);//minute tens
RTC->TR |= (5<<16);//hour units
RTC->TR |= (1<<20);//hour tens
//here i will put date values
 
RTC->CR &= ~(1<<CR_FMT_BIT);
     
RTC->ISR &= ~(1<<ISR_INIT_BIT);
     
RTC->WPR = 0xFF;

Outcomes