Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Chip and Cogs — Parallax Forums

Propeller Chip and Cogs

Dan TaylorDan Taylor Posts: 207
edited 2009-03-19 18:21 in Propeller 1
So I have not used the Propeller Chip before. But saw it and had some questions. When is says that it has 8 processors (cogs). What exactly does that mean? Does it mean that it can run different things at the same time? Like for instance producing sound through·2 piezo speaker at the same time. Unlike the Basic Stamp? How does that work?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dan Taylor

Comments

  • rjo_rjo_ Posts: 1,825
    edited 2009-03-19 17:23
    Exactly,

    AND there are no interrupts to deal with[noparse]:)[/noparse]

    There is a central clock... the only bottle neck is access to central RAM. The benchmark numbers are all wrong...
    because each cog also has a configurable counter mechanism... which for some purposes is equivalent to adding
    two more processors!!!

    AND Prop is made, promoted and supported for complete idiots like me as well as for professional engineers. If you have any background at all...which I didn't... that background is immediately useful and will sort of determine how you approach the Prop.

    Rich
  • rjo_rjo_ Posts: 1,825
    edited 2009-03-19 17:24
    Dan... long shot here... but did you ever serve in the Army?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-19 17:58
    It's helpful to look at the block diagram for the Propeller (www.parallax.com/Portals/0/Downloads/docs/prod/prop/PchipBlockRev.pdf).

    There are indeed 8 separate processors, each with two special purpose counters and each with a video generator. Each processor has access to all 32 I/O pins and each processor gets its own time slot for access to the shared RAM. Practically, you can access a 32 bit word in shared memory once every 3 instructions.

    It's trivial to start up processors with a 5 or 6 line program to drive a piezo speaker, each processor driving one speaker with a different tone. The special purpose counters can each drive a speaker as well if you want for a total of 3 per cog.
  • Dan TaylorDan Taylor Posts: 207
    edited 2009-03-19 18:06
    rj0_, no I have never served in the army.

    How do you access the different Cogs?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dan Taylor
  • rjo_rjo_ Posts: 1,825
    edited 2009-03-19 18:16
    You write the code that you intend to run on a cog as a callable routine and give that routine a name... you then use a command to start a cog and have it run that routine... couldn't be easier.

    The syntax and the basic methodology are all explained in the learning labs... So, the first step is to get the education kit...
    put it together and then go through the labs. If you do nothing else, you can get through the labs in a few days.

    Rich
  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-19 18:21
    Read the description of the following statements: COGNEW, COGINIT, COGSTOP, COGID.

    The only way to access the cogs is via a program loaded into the cog's memory. One cog cannot access another cog's memory. Inter-cog communication is through shared (hub) memory areas. The COGNEW or COGINIT statements (really the same instruction internally) cause the cog's memory to be loaded from shared (hub) memory (ROM or RAM), then the cog's registers are cleared and execution started. Most programs are written in the Spin language which is interpreted by a program in the chip's ROM which is copied to a cog's RAM for execution.
Sign In or Register to comment.