Shop OBEX P1 Docs P2 Docs Learn Events
Can cogs be synchronized? — Parallax Forums

Can cogs be synchronized?

K2K2 Posts: 691
edited 2008-01-19 16:46 in Propeller 1
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

Comments

  • deSilvadeSilva Posts: 2,967
    edited 2008-01-18 01:07
    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 BakerPaul Baker Posts: 6,351
    edited 2008-01-18 01:16
    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
    Propeller Applications Engineer

    Parallax, Inc.
  • K2K2 Posts: 691
    edited 2008-01-18 02:23
    Excellent. Thanks be to both of you for the help.
  • pgbpsupgbpsu Posts: 460
    edited 2008-01-18 17:27
    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 SchwabeBeau Schwabe Posts: 6,559
    edited 2008-01-18 20:44
    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

    IC Layout Engineer
    Parallax, Inc.
  • K2K2 Posts: 691
    edited 2008-01-19 16:46
    Thank you. You've saved me many hours of grovelling!
Sign In or Register to comment.