Shop OBEX P1 Docs P2 Docs Learn Events
Startingout with multiple cogs — Parallax Forums

Startingout with multiple cogs

StephenStephen Posts: 53
edited 2008-02-22 23:55 in Propeller 1
I'm new to the Propeller but I've already written some simple code for a single COG. What's a good example of multiple COGs, say serial comms in one COG, display in another? I did some searching and was unable to find anything...

Thanks!

Comments

  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-02-22 06:06
    Have you looked at the examples/tutorials in the Propeller manual? That has some examples that should help you. You could look at some of the TV, VGA and graphics drivers but all of these are written in assembly and are fairly difficult to understand unless you have a fair amount of experience with assembler.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-22 06:09
    A good example is FemtoBasic. It starts up an I2C/SPI driver, a keyboard driver, and a video driver, each in its own cog.
    The BoeBotBasic version starts up an I2C/SPI driver, a FullDuplexSerial driver, and, on demand, starts up a Spin servo driver, a PING driver, and an assembly routine to calculate arctangents for an HM-55B compass.
  • StephenStephen Posts: 53
    edited 2008-02-22 06:11
    Thank for the quick reply!

    I am experienced with SX assembler, but it's been a little while.

    Actually, I haven't even cracked open the Propeller manual. I've just been working straight from the datasheet. I should RTFM!!
  • StephenStephen Posts: 53
    edited 2008-02-22 06:13
    Ooh, that description of the BoeBotBasic sounds just about perfect for what I am working on... Thanks!
  • dfletchdfletch Posts: 165
    edited 2008-02-22 06:15
    Yep if you haven't read the manual, the documentation of cognew in the spin section is particularly enlightening.

    Cheers,

    --fletch

    UPDATE: Oh yeah and the whole chapter 3 spin tutorial at the top of the manual covers this too.
  • StephenStephen Posts: 53
    edited 2008-02-22 06:58
    Well, there you go. After reading up to chapter 3 I found I am already using 2 COGs and I didn't even know it!
  • JanCardellJanCardell Posts: 10
    edited 2008-02-22 23:55
    Yes! Read the manual!
Sign In or Register to comment.