Shop OBEX P1 Docs P2 Docs Learn Events
CogInit doesn't — Parallax Forums

CogInit doesn't

steprogsteprog Posts: 227
edited 2010-07-26 06:01 in Propeller 1
Hi Guys,
Trouble with coginit.· I was trying to load assem routines in all 8 cogs, but doesn't seem to work.· Mainly I need to load assem into the cog 0 where the main program is working.· I thought that should work, but it seems to ignore me.
Perhaps this is too general a question, but I thought an assem could be loaded on the same code asking for it. True?
Gre

Comments

  • w8anw8an Posts: 176
    edited 2010-07-26 00:04
    Normally the first response to this type of question is..

    Can you post a code example?
  • steprogsteprog Posts: 227
    edited 2010-07-26 00:07
    Yes I know I just hate bothering people with my silly problems, but I must admit Im stuck. Let me figure out how to cut and past and I will. Thanks, Greg
  • steprogsteprog Posts: 227
    edited 2010-07-26 00:15
    This shows that the method has been defined
    ·obj
    · FreqLast······ : "mixerLast"


    This code basically gets a command from the gui and starts loading the cogs
    ··· if strcomp(@RunCLK, @command)
    ······ Freqlast.start(LO2,Fo2A,Fo2B,Frequency2,delay2,deg180_2,1)
    ······ Freqlast.start(LO3,Fo3A,Fo3B,Frequency3,delay3,deg180_3,2)
    ······ Freqlast.start(LO4,Fo4A,Fo4B,Frequency4,delay4,deg180_4,3)
    ······ Freqlast.start(LO5,Fo5A,Fo5B,Frequency5,delay5,deg180_5,4)
    ······ Freqlast.start(LO6,Fo6A,Fo6B,Frequency6,delay6,deg180_6,5)
    ······ Freqlast.start(LO7,Fo7A,Fo7B,Frequency7,delay7,deg180_7,6)
    ······ Freqlast.start(LO8,Fo8A,Fo8B,Frequency8,delay8,deg180_8,7)
    ······ Freqlast.start(LO1,Fo1A,Fo1B,Frequency1,delay1,deg180_1,0)
    This code that resides in "mixerlast" calls the coginit command and loads up the assembly

    PUB start(LO,FA,FB,Period4,dely,deg180,cognum)

    · D180 := deg180·
    · LOpin := |< LO
    · FApin := |< FA
    · FBpin := |< FB

    · Delay := dely
    · Per4:= Period4
    · Phase1:= 1
    · Phase2:= 0
    · If Delay > Per4
    ··· Delay:= Delay - Per4··
    ··· Phase1:=0
    ··· Phase2:=1
    ·
    ··· coginit(cognum,@entry,PAR )
    '
    · return
  • kuronekokuroneko Posts: 3,623
    edited 2010-07-26 00:25
    With that indentation coginit is only ever executed when Delay > Per4. Is that the idea? Also - out of curiosity - why do you pass par as a parameter?
  • steprogsteprog Posts: 227
    edited 2010-07-26 01:00
    The indentation was it. I must of moved the code without thinking earlier.
    Thanks for the help.
    Greg
  • potatoheadpotatohead Posts: 10,261
    edited 2010-07-26 01:48
    There is a show indentation function in the Prop tool. It has helped me big with this issue.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    8x8 color 80 Column NTSC Text Object
    Wondering how to set tile colors in the graphics_demo.spin?
    Safety Tip: Life is as good as YOU think it is!
  • steprogsteprog Posts: 227
    edited 2010-07-26 06:01
    Hi potatohead,
    I use it I just boneheaded it.
    Thanks,
    Greg
Sign In or Register to comment.