I hope someone can help, I am stumped! Using COGs
Tomlikesrocks
Posts: 5
Hi guys,
Ive put together some code to run the Sure Electronics 2416 Led Matrix and it works great.
However Im planning to use 6 of these screens to make a bigger display.
My code can do this (run multiple screens) except it slows down way too much.
What Ill like to do is make use of the other COGs to speed things up.
And this is where i'm stuck, I understand allocating Stack space and running a method in a new COG but everything else is a little confusing. Are variables you allocate global?? As in all COGs can read from the same variable.
Ive attached the code and what Im really trying to do is run the function shadowdsp(chipno) twice at the same time.
As in shadowdsp(0) and shadowdsp(1) where both cogs would need to read from the variable shadowram[96*NUM_DEVICES]
Any help would be greatly appreciated.
Tom
Ive put together some code to run the Sure Electronics 2416 Led Matrix and it works great.
However Im planning to use 6 of these screens to make a bigger display.
My code can do this (run multiple screens) except it slows down way too much.
What Ill like to do is make use of the other COGs to speed things up.
And this is where i'm stuck, I understand allocating Stack space and running a method in a new COG but everything else is a little confusing. Are variables you allocate global?? As in all COGs can read from the same variable.
Ive attached the code and what Im really trying to do is run the function shadowdsp(chipno) twice at the same time.
As in shadowdsp(0) and shadowdsp(1) where both cogs would need to read from the variable shadowram[96*NUM_DEVICES]
Any help would be greatly appreciated.
Tom
Comments
Any variables that you declare in the VAR block will be accessible to all cogs.
The best approach is to create Methods that perform certain tasks, then launch those methods into various cogs. For detailed information on doing that, take a look at Chapter 5, page 67 of the PE Lab manual:
http://www.parallax.com/Portals/0/Downloads/docs/prod/prop/PELabsFunBook-v1.1.pdf
hope that helps,
Mark
That looks like a good read.
I don't know why i've never come across it before.
Cheers