Shop OBEX P1 Docs P2 Docs Learn Events
Problem: Bouncing through cogs — Parallax Forums

Problem: Bouncing through cogs

steprogsteprog Posts: 227
edited 2011-03-26 19:58 in Propeller 1
Hi Guys,
I got a problem. I have a 2 prop circuit board. One of the props all the cogs get used including overwriting Cog 0. The other prop can set a line high or low to get the attention of the first prop. The prop that is all used up has 8 assembly routines running, but can poll this I/O line.

My question is how can I leave these assembly routines and restart Cog 0 with the initial spin code without reseting the processor.
Thanks for any ideals

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2011-03-26 04:05
    Provided there is still a valid SPIN program present in hub RAM just restart the SPIN interpreter in any cog you like.
    coginit spin                    ' launch SPIN interpreter
    
    ' initialised data and/or presets
    
    spin            long    $0004 << 16 | $F004 << 2 | cogID
    
  • steprogsteprog Posts: 227
    edited 2011-03-26 11:39
    It seems pretty cryptic, but I will give it a try.
    Thanks,
    Greg
  • kuronekokuroneko Posts: 3,623
    edited 2011-03-26 19:58
    OK, the $0004 is the expected par value for the SPIN interpreter (running the primary program) $F004 is its address in hub ROM. The cogID is your responsibility (%0xxx). I can't do anything about the instruction format though :)
Sign In or Register to comment.