Shop OBEX P1 Docs P2 Docs Learn Events
Data Aquisition System shuts down after 4 minutes and 42 seconds — Parallax Forums

Data Aquisition System shuts down after 4 minutes and 42 seconds

OndweyOndwey Posts: 1
edited 2012-03-30 13:10 in Propeller 1
For a science project I designed a data acquisition system that takes data from a temperature pressure and wind speed sensor and logs the data on an attached micro SD card. The program runs smoothly, but at 4 minutes 42 seconds the program freezes preventing any of the collected data from being saved. I'm just wondering if it sounds like i'm doing something obviously wrong. I just can't figure out why it always crashes at the exact same time.

possibilities I've thought of:

the actual writing of data is taken care of by one of the cogs not the main object
thus the cog might be running out of memory

or i could be missing a wait command causing the program to have to recycle through the code

again if there's something obvious i;m missing please let me know.

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-03-30 07:53
    Welcome to the forum, Ondway!

    There's not much we can do to help until you post your code.

    -Phil
  • RaymanRayman Posts: 14,844
    edited 2012-03-30 08:56
    One commonly seen issue is starting new cogs with giving them enough stack space...

    You might make sure all your SPIN cogs have enough stack space reserved...

    If you are storing data in buffers, you might also check you don't have a buffer overrun problem...
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-30 10:26
    I agree, this sounds like you're over running a buffer.

    Use the "file\archive\project" feature in the Propeller Tool to zip you project up and post it.

    I just made data logging project of sorts in the robot forum. I used a uSD card with a PropBOE to record the servo data as I drove my PropBOE bot around (which could then be replayed). The code is posted in the last post of the thread.
  • LawsonLawson Posts: 870
    edited 2012-03-30 11:00
    The other thing that can catch people is directly using CNT in a conditional.

    this code fails when cnt is > $8000_0000 or on rollovers. ( "<" is signed, while CNT is not. I use (x >>1) < (y>>1) when i want an unsigned comparison.)
    C1 := cnt + wait
    repeat
      "do something"
      if C1 < cnt
        break
    

    This code works all the time due to a useful side effect of limited precision math.
    C1 := cnt
    repeat
      "do something"
      if (cnt - C1) > wait  
        break
    

    Lawson
  • MagIO2MagIO2 Posts: 2,243
    edited 2012-03-30 13:10
    A special case of overrun and stack space is having recursive function calls somewhere in the code. But I agree to the proposals above: Post your code if it's not rocket science ;o)
Sign In or Register to comment.