TRC KL25 RTC_TSR not updating

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

TRC KL25 RTC_TSR not updating

1,132 次查看
Edrianocarlos
Contributor IV

I am using KL25 RTC for a while. the alarm interrup is working right as i can set an alarm and get an interrupt at the right time.

but when i try to read RTC_TSR i can not see it changing each 1 sec as it would be.

I tried timestamp = RTC_TSR and also RTC_HAL_GetDatetimeInSecs(RTC,&timestamp);

I am doing something wrong? the module seems to be ok as the alam interrup is working nice.

0 项奖励
回复
3 回复数

993 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Edriano,

Please check whether the SR[TOF]  or SR[TIF] are set ?

pastedImage_0.png

Hope it helps

Alice

0 项奖励
回复

993 次查看
Edrianocarlos
Contributor IV

Ok. now i got what is happening.

I am using LPO clock just for test and as i can't change the prescale it will only increment each 32,7 seconds.

I will try to find a 32Khz clock source to use as rtcclk.

0 项奖励
回复

993 次查看
Edrianocarlos
Contributor IV

Hello Alice.

both flags are zero, it is not the problem. i have investigated a little more futher and tried many others ways of reading the TSR. And what i see is that.

RTC_HAL_GetDatetime(RTC,&date);

  RTC_HAL_ConvertDatetimeToSecs(&date, &timestamp);

Or if i simple try to read TSR timestamp = RTC_TSR;

i get the same result RTC_TSR value divided by 2.

0 项奖励
回复