Tick from RTC on RT1170

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

Tick from RTC on RT1170

2,297 次查看
JayCao
Contributor III

Hello Support team,

Our project wants to use a tick from RTC but SDK doesn't support the get tick function.

So we would like to get a tick via register same as getting second value.

JayCao_0-1701736270855.jpeg

It looks like we have to read it via HPRTCMR and HPRTCLR registers.

The second value will be obtained from bits 31-16, and the tick value can be obtained from 15 -0 bit, am I right?

If I am right, could you guide me on the way to get the tick from bit 15-0?

JayCao_1-1701736652762.png

Thanks for your support!

 

标签 (2)
0 项奖励
回复
3 回复数

2,271 次查看
JayCao
Contributor III

Hello Gavin,

Thanks for your response.

We were considered to use systick but our system is using FreeRTOS along with many tasks.

Is it possible to use systick in this case?

Best regards,

0 项奖励
回复

2,262 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @JayCao ,

Yes, it is possible to use systick in this case. And if there are enough hardware resources, using a hardware timer is also a method.

 

Best regards,

Gavin

0 项奖励
回复

2,279 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @JayCao ,

Thanks for your interest in NXP I.MX RT series.

It depends on the resolution of the RTC tick. But on Cortex-M, RTC resolution is 1s, so it can't generate the tick you need.
a) Systick is used by default
b) for low power, it depends what can wake me up from low power (depending on the mode). If Systick wakes me up (basically any interrupt), systick can be used
d) if Systick is not an exit from low power mode,  a low power timer (which usually has a 1 ms resolution which is good enough) is recommended.
e) if you need to go deeper in low power, you could use the RTC. That usually means that the RTC alarm interrupt is the only thing which can wake me up, so the low power timer does not help. But typically the RTC has a resolution of 1 sec which is not appropriate for most cases. 

 

I hope this helps.

Best regards,

Gavin

0 项奖励
回复