LPC4350 Simultaneous LPC_TIMER0 reads from M4 and M0

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

LPC4350 Simultaneous LPC_TIMER0 reads from M4 and M0

跳至解决方案
1,329 次查看
gregdunn
Contributor I

Is there any problem with initializing LPC_TIMER0 on the M4 core and then calling Chip_TIMER_ReadCount(LPC_TIMER0) asynchronously on both the M4 and M0 cores to allow for synchronized timing functions between both cores?  

Thanks,

Greg Dunn

标签 (1)
0 项奖励
回复
1 解答
1,231 次查看
bernhardfink
NXP Employee
NXP Employee

There shouldn't be a problem. Both cores are bust masters and can read at any point in time from peripheral resources. The one which reads first will get first.

What is always dangerous:

while (x < 1000)

{

   x = read_timer(timer0);

}

If you poll with full CPU speed on a register, even simultaneously with two different cores, then you might see weird system behavior.

Regards,

Bernhard.

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,232 次查看
bernhardfink
NXP Employee
NXP Employee

There shouldn't be a problem. Both cores are bust masters and can read at any point in time from peripheral resources. The one which reads first will get first.

What is always dangerous:

while (x < 1000)

{

   x = read_timer(timer0);

}

If you poll with full CPU speed on a register, even simultaneously with two different cores, then you might see weird system behavior.

Regards,

Bernhard.

0 项奖励
回复
1,231 次查看
gregdunn
Contributor I

Thank you very much for the clarification!

Greg

0 项奖励
回复