Shop OBEX P1 Docs P2 Docs Learn Events
asm in 2 cogs. got it workin. — Parallax Forums

asm in 2 cogs. got it workin.

agfaagfa Posts: 295
edited 2008-11-05 02:16 in Propeller 1
having trouble getting 2 asm routines to run in separate cogs.· i created a short program as a test which works, so i'm using it as a model for another program but i get erratic unpredictable results.· i'm sure i have something wrong that is creating a conflict.

i've attached my model program.· is this the correct way to start 2 cogs·running asm?· could someone point me in the right direction for more info on this?

Post Edited (agfa) : 11/5/2008 2:38:07 AM GMT

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2008-11-04 03:58
    set x and y before you launch the cogs as the cogs are probably done before these statements are executed - spin is slow
  • agfaagfa Posts: 295
    edited 2008-11-04 05:35
    thanks for looking at it.

    the program i posted actually works correctly.· the symptoms i get are things like outputs going high that haven't had dirs set, or all cogs apparently shutting down.· weird stuff.· i thought i was going about it all wrong in the dat section or something.

    I'll simplify·the program, with the problem, as much as i can and still get the symptoms and post it tommorrow.
  • nutsonnutson Posts: 242
    edited 2008-11-04 08:19
    - Rename the labels :loop (used twice) to :loop1 and :loop2
    - place an ORG after TST2, you want the second part of the DAT section to be assembled starting from·location 0 again.···
  • agfaagfa Posts: 295
    edited 2008-11-04 19:18
    i've posted the program.

    my goal is to become more familiar with asm.· i wrote this to·read pulse widths from a RC receiver, process it,·and generate servo outs.· the first asm cog generates servo outputs, the second measures input pulse widths.· as a test i want to measure it's own output pulses.· i was able to·do this with spin, but wanted to do it in asm.

    the first problem i had was with the waitpeq, my attempts to troubleshoot it created other unusual operation.

    when i add the org·as nutson suggested i don't get any·PWM output and i get a return (pulsout) value of 666, as expected.· without the org i get PWM but the return value is 33947910 instead of 666.

    i have I/O 0·toggle an LED along with the debug statement.· in both cases the LED will eventually quit·toggling but the debug continues to·occur.

    any insight?
  • agfaagfa Posts: 295
    edited 2008-11-05 02:16
    thanks Cluso99 and nutson, for the suggestions.

    agfa

    Post Edited (agfa) : 6/14/2009 1:20:07 PM GMT
Sign In or Register to comment.