Shop OBEX P1 Docs P2 Docs Learn Events
Cogs, stack space, etc., — Parallax Forums

Cogs, stack space, etc.,

HughHugh Posts: 362
edited 2009-07-15 19:17 in Propeller 1
Hi,

I have a couple of cogs monitoring switch positions and storing the position of the switches as global variables.

A main subroutine then accesses these values to take actions, etc.,

As I have built-up the main subroutine I have reached a point where the switches appear to be rapidly toggling on/off as the application progresses.

I've tried changing the stack-space allocated to the cogs monitoring the switches, but with no lock. Could the size of the main routine have reached the point where it has 'spilled over' into one of the switch-monitoring cogs, or could it be 'something else'?

Its got me scratching my head anyway.

Thanks
Hugh

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Hugh - the thinking woman's Geoffrey Pyke.

Comments

  • KyeKye Posts: 2,200
    edited 2009-07-15 17:19
    The main rountines stack space starts after all other allocated stack space.

    More likely the main rountine is having problems with its stack or that you didn't give enough stack to the other cogs.

    You code however is more likely the problem.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • kwinnkwinn Posts: 8,697
    edited 2009-07-15 17:34
    Hugh, I have posted a timer/switch sensing routine that does the same. The et-tester is a small test program that shifts data out to 3 '595's. Part of the data is the switch position. It only writes the data to hub ram when the switches change state. Hope it helps.

    PS Please post or PM your routine to me so I can see how you approach it.
  • HughHugh Posts: 362
    edited 2009-07-15 19:17
    I think I had cogs 'overlapping'. When I removed the 'VGA_Drive' object I had added to assist with debugging the problem went away.

    Another lesson learned!
    Thanks

    Hugh

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Hugh - the thinking woman's Geoffrey Pyke.
Sign In or Register to comment.