LPC4350 Simultaneous LPC_TIMER0 reads from M4 and M0

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC4350 Simultaneous LPC_TIMER0 reads from M4 and M0

Jump to solution
693 Views
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

Labels (1)
0 Kudos
1 Solution
595 Views
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.

View solution in original post

0 Kudos
2 Replies
596 Views
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 Kudos
595 Views
gregdunn
Contributor I

Thank you very much for the clarification!

Greg

0 Kudos