cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f0 rtc

aaslan
Associate II
Posted on August 21, 2015 at 15:29

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;

1 REPLY 1
Posted on August 21, 2015 at 18:07

[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/stm32f0%20rtc%20pls%20help&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx&currentviews=3]cross posted

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