PDA

View Full Version : Can cogs be synchronized?



K2
01-18-2008, 07:49 AM
Can assembly language routines in each cog be synchronized so as to allow each cog to read the same external port in evenly spaced intervals?

Dave

deSilva
01-18-2008, 08:07 AM
Yes, you have to "post" some future time to all the involved COGs, so they can sync by WAITCNT to this time stamp. This is possible, because all COGS see the same CNT.

It is also possible to do this using a "pin", waiting by WAINTPEQ...

Paul Baker
01-18-2008, 08:16 AM
As deSilva has said, yes it is possible. There are a few objects which have synchronized cogs, take a look at any of the vga drivers with higher resolution (1024x768, 1600x1200) to see how it can be done.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker (mailto:pbaker@parallax.com)
Propeller Applications Engineer
[/url][url=http://www.parallax.com] (http://www.parallax.com)
Parallax, Inc. (http://www.parallax.com)

K2
01-18-2008, 09:23 AM
Excellent. Thanks be to both of you for the help.

pgbpsu
01-19-2008, 12:27 AM
Hi David-

I had to get some help to do this very thing. Have a look at this thread for some code examples:
http://forums.parallax.com/forums/default.aspx?f=25&m=231571&g=231636#m231636

Scroll down to Ariba's first post. He makes it pretty clear how to do this. If you have questions about the code I posted, don't hesitate to ask.

Good luck.
p

Beau Schwabe (Parallax)
01-19-2008, 03:44 AM
David,

There are several discussions on this subject... here is another example of Syncing more than one COG together on one Propeller and even Syncing more than one COG between two different Propellers together...

http://forums.parallax.com/showthread.php?p=689451

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe (mailto:bschwabe@parallax.com)

IC Layout Engineer
Parallax, Inc.

K2
01-19-2008, 11:46 PM
Thank you. You've saved me many hours of grovelling!