Shop OBEX P1 Docs P2 Docs Learn Events
Clobbered Data ? — Parallax Forums

Clobbered Data ?

bambinobambino Posts: 789
edited 2009-03-03 13:53 in Propeller 1
I've made a routine in assembly that runs in it's on cog from another object file. I pass it the starting address of some 2700 longs and it fills it with data from a convertor. When it gets done it terminates it'self with a cogstop command.

The app works perfect after being loaded from the IDE, but if I place the Cog in a repeat loop it works one time and after that I get garbage in the buffer I send it. What are some things that could cause my data to be clobbered the second time around. I would think that the cogstop and the next instance of cognew would start my routine with a clean slate, but it's not! Any tricks to starting the cog again or should I longfill the buffer before the second cognew?

Thanks!

Comments

  • Erik FriesenErik Friesen Posts: 1,071
    edited 2009-03-02 15:06
    Can we see code?
  • bambinobambino Posts: 789
    edited 2009-03-02 15:12
    Yes, I am at another job at the moment, but possible tonight I can post.
    At the moment I was just looking for some general tips on restarting cogs.
  • mctriviamctrivia Posts: 3,772
    edited 2009-03-02 16:12
    is your loop waiting for the cog to finish or just creating a new cog until all 8 are full? or is the objects cog start routine stopping the cog and restarting continuously?

    that would be my guess without seeing code

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Need to make your prop design easier or secure? Get a PropMod has crystal, eeprom, and programing header in a 40 pin dip 0.7" pitch module with uSD reader, and RTC options.
  • bambinobambino Posts: 789
    edited 2009-03-02 17:12
    no, The routine in question sets a flag when it is about to terminate it'self and the top object upon seeing the flag reads out the data to the terminal screen then queries for a restart. I restart the loop again from the terminal, but the data I get·is garbage.

    I do wish I had been able to bring the code with me this morning, but maybe later!
  • bambinobambino Posts: 789
    edited 2009-03-03 00:51
    As I said before any general clues to be able to start with a clean slate from within a loop without having to reset would be great. I say that because understanding my code may be a chore! Even I have to back up and punt if I put this project aside for a few days. But here is the code if anyone is of a brave nature!
  • kuronekokuroneko Posts: 3,623
    edited 2009-03-03 01:22
    FWIW, you seem to use #511 in variable Debug as "buffer ready" condition. This is never reset inside the loop so during the second run you don't even wait for the cog to finish (as Debug is still 511).
  • bambinobambino Posts: 789
    edited 2009-03-03 13:53
    kuroneko, Yep, That would certainly do it! So Obvious! When I get through beatin my face for this I'll correct the error. Thanks.

    PS. Don't tell anyone I spent the better part of sunday going over my assembly looking for this error!
Sign In or Register to comment.