How high does the system counter count?
idbruce
Posts: 6,197
Hello Everyone
I need to sync. I have a function that starts a new cog, I need that function and that cog to sync with the system clock. So in other words, I want both the function and the cog to pause execution until they can both start at the same time according to the system clock.
Thanks in advance.
Bruce
I need to sync. I have a function that starts a new cog, I need that function and that cog to sync with the system clock. So in other words, I want both the function and the cog to pause execution until they can both start at the same time according to the system clock.
Thanks in advance.
Bruce
Comments
I think I grasp that. But do I pass StartTime as a pointer or just a varible to the other cog?
Bruce
And also this:
http://forums.parallax.com/showthread.php?107022-How-many-counts-does-it-take-for-the-system-counter-cnt-to-roll-over
Thanks for pointing that out to me, that was very interesting. Have you been using Stefans code? And what do you mean see page 73?
Bruce
Bruce,
never mind page 73 - it really doesn't tell you much.
You'll notice the thread I linked to is over 2 years old, so I don't remember if I ever used Stefan's code per se, but the concept of taking a "snapshot" of the system clock and working with it downstream I think is a valid one. I probably learned it from him, but I just don't recall exactly.
Take special note of what Mike Green has said above.
I took Mikes suggestion and it worked perfectly. The stepper driver now has steps and pulses that are equal, but it is still giving me two extra steps and pulses. Should not be too hard to find. Anyhow thanks for the info, I appreciate it.
Bruce