找回密码
 立即注册

微信扫码登录

查看: 11|回复: 0

[Timer] Clock overflow handling

[复制链接]

1

主题

0

回帖

17

积分

英勇黄铜

积分
17
发表于 昨天 21:14 | 显示全部楼层 |阅读模式 来自 美国
Information
说明:   建议参照本版块置顶帖内容输入必要信息
芯片型号: tlsr8251
驱动SDK版本: V3.4.2.1_Patch_0005
Hello,

I'm implementing a millisecond counter using reg_system_tick on the TLSR8251.
The timer overflows every ~268 seconds (268000ms) due to its limited range.

Currently, I detect overflow in software by comparing consecutive readings:
- If (current_value < previous_value) → overflow occurred

However, I'm wondering if there's a more efficient approach using hardware
interrupts. Specifically:

1. Can I configure a timer (TIMER0?) to generate an interrupt just before
   reg_system_tick overflows?

2. What's the recommended approach for maintaining a long-running millisecond
   counter on TLSR8251?

3. Are there any SDK examples for handling system tick overflow?

My current implementation works but has overhead on every millis_get() call.
I'd prefer an interrupt-driven approach if the hardware supports it.

Thank you!

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Telink forum ( 沪ICP备17008231号-1 )

GMT+8, 2025-11-14 00:57 , Processed in 0.097782 second(s), 20 queries .

Powered by Discuz! 隐私政策

泰凌微电子版权所有 © 。保留所有权利。 2024

快速回复 返回顶部 返回列表