Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

TRAVEO™ T2G Forum Discussions

kk211911
Level 1
Level 1
10 replies posted 10 sign-ins 5 sign-ins

关于ethif的中断配置有btsu_time_match 和btsu_sec_inc , btsu_sec_inc是1s一次中断,btsu_time_match有点不明白,能否稍微解答一下,关联的ETH_TSU_SEC_CMP,ETH_TSU_NSEC_CMP寄存器吗?

另外能否通过配置tsu_timer产生自定义间隔,类似1ms一次的中断?

 

0 Likes
5 Replies
Jimmy-Liu
Moderator
Moderator
Moderator
First like received 100 sign-ins 50 replies posted

Hi kk211911,

btsu_time_match是TSU time match event匹配配置,ETH_TSU_SEC_CMP对应的是second级compare,ETH_TSU_NSEC_CMP是nano second级compare,具体可以查看寄存器表https://www.infineon.com/cms/en/product/microcontroller/32-bit-traveo-t2g-arm-cortex-microcontroller...

1ms的中断应该可以基于ETH_TSU_NSEC_CMP产生,我们有一个1 second中断的sample可以参考一下附件。

0 Likes
kk211911
Level 1
Level 1
10 replies posted 10 sign-ins 5 sign-ins

这个1s的sample用的就是btsu_sec_inc,时间是固定的吧。

btsu_time_match比较是两个时间戳必须完全相等吗, 还是tsu timer大于配置的参数就可以了? 

我刚验证了一下,第一次将TSU_NSEC_CMP配置成1000000ns,收到中断后TSU_NSEC_CMP加1ms,第4ms的时候中断就触发不了了,

TSU_NSEC_CMP寄存器的值是 0x003d0900 = 4000000ns = 4ms

0 Likes
kk211911
Level 1
Level 1
10 replies posted 10 sign-ins 5 sign-ins

TSU_NSEC_CMP的值是22位的,看样子不太可行了,还有其他的方法通过tsu产生1ms的中断吗?

0 Likes
Jimmy-Liu
Moderator
Moderator
Moderator
First like received 100 sign-ins 50 replies posted

你好,

这是寄存器的限制,估计是没有办法了。如果只是要产生1ms的中断,是否可以通过中断后把寄存器清除重新开始计数来实现?

0 Likes
kk211911
Level 1
Level 1
10 replies posted 10 sign-ins 5 sign-ins

按我的理解和验证结果来看,22Bits的TSU_NSEC_CMP与29Bits的TSU_TIMER_NSEC数据是没法做到按1ms来进行匹配的。多谢。

0 Likes