广州大彩串口屏论坛_大彩开发者交流论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 7607|回复: 5

time base with good accurate

[复制链接]

20

主题

53

帖子

268

积分

中级会员

Rank: 3Rank: 3

积分
268
发表于 2022-10-9 03:14:13 | 显示全部楼层 |阅读模式

I need it for energy measure and etc and I cannot find any info about how u made clock in screen. Specially is no matter that delay betwen each call will be not equal, but I want the same as possible call amount in each next hour in many device.
RTC? Timer callbac?
回复

使用道具 举报

2

主题

1253

帖子

1万

积分

论坛元老

Rank: 8Rank: 8

积分
12619
发表于 2022-10-9 09:16:52 | 显示全部楼层
The timing function can only be implemented by script timer callback at present
Easy doesn't enter into Grown-up life
成年人的生活里面没有“容易”二字
回复

使用道具 举报

20

主题

53

帖子

268

积分

中级会员

Rank: 3Rank: 3

积分
268
 楼主| 发表于 2022-10-9 17:53:58 | 显示全部楼层
本帖最后由 terefere 于 2022-10-9 18:24 编辑

I made timer callback for every 6 second. 1 hour cycle I take from get_date_time() and I get 570+/-1 calback count instead calculated 600.   
get_date_time() is taken from core clock or RTC?, I not see any I2C request in this time. I try to check CLKOUT frequency at PCF chip and is almost perfect, but when I stop RTC osccilator then time/date clock on the screen still run. You take time from RTC only at reset time?. Next, at work, time clock works from CPU crystal?
回复

使用道具 举报

2

主题

1253

帖子

1万

积分

论坛元老

Rank: 8Rank: 8

积分
12619
发表于 2022-10-10 09:25:42 | 显示全部楼层
本帖最后由 If后要接end 于 2022-10-10 09:27 编辑
terefere 发表于 2022-10-9 17:53
I made timer callback for every 6 second. 1 hour cycle I take from get_date_time() and I get 570+/-1 ...

Yes, the RTC operation is implemented by the CPU, and the battery on the back of the screen is used to save the RTC time and maintain the RTC operation after the screen is powered off. In addition, using start_timer to implement the function of counting every 6 seconds, theoretically there will not be such a large numerical difference. How do you test this?
Easy doesn't enter into Grown-up life
成年人的生活里面没有“容易”二字
回复

使用道具 举报

20

主题

53

帖子

268

积分

中级会员

Rank: 3Rank: 3

积分
268
 楼主| 发表于 2022-10-10 15:46:58 | 显示全部楼层
Timer callback increment value every 6s. One hour period I take from minute register in get_date_time and catch value at first change from 59 to 00. Today I will compare get_date_time from phone if core get time from RTC only at reset time.

My task take much core load- every 200ms I take about 150ms. But I not suppose that it is reason for 5% error
回复

使用道具 举报

2

主题

1253

帖子

1万

积分

论坛元老

Rank: 8Rank: 8

积分
12619
发表于 2022-10-10 16:27:14 | 显示全部楼层
terefere 发表于 2022-10-10 15:46
Timer callback increment value every 6s. One hour period I take from minute register in get_date_tim ...

Do not use get_data_time() as a timer, It is recommended to use start_timer (timer_id, timeout, countdown, repeat) to start a timer. The later one is more accurate.
Easy doesn't enter into Grown-up life
成年人的生活里面没有“容易”二字
回复

使用道具 举报

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

本版积分规则

QQ|Archiver|手机版|小黑屋|广州大彩串口屏论坛_大彩开发者交流论坛

GMT+8, 2024-11-23 17:57 , Processed in 0.061316 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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