Shop OBEX P1 Docs P2 Docs Learn Events
Auto deleting datalogger?!?!? — Parallax Forums

Auto deleting datalogger?!?!?

Van DesselVan Dessel Posts: 15
edited 2010-01-27 04:07 in Propeller 1
'm not sure really where to post this post, already tried the sandbox with no luck and I guess my project is related to the propeller and i already got loads of help from here, so....

·What i basicly want to do is log gps data and temperature onto a flash drive via Parallax's datalogger. I already got the gps part working, the temperature part working, and I had the datalogging part working. Up to a few days ago i could write information to a .txt file however after the prop and logger synced and once i try to open that file the data logger's red led just blinks repeatdly. My program is still running just nothing is being written to the file. I tried different files that i'm writting too, different flash drives, all with the same result.

·One thing that i'm noticing though is that when I use chkdsk I'm missing some file that i need to recover. I suspect my data logger is deleting something however I have no idea how to fix it.

Thanks in Advance!

Comments

  • SRLMSRLM Posts: 5,045
    edited 2010-01-24 02:11
    You might want to try this object to log the data... obex.parallax.com/objects/534/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Powered by enthusiasm
  • Van DesselVan Dessel Posts: 15
    edited 2010-01-24 14:17
    @SRLM
    thanks for the object. It seems to work sometimes and other times the led is blinking too [noparse]:([/noparse]. I've never dealt with PASM but i'll give it a go. Any pointers on how to use?
  • VIRANDVIRAND Posts: 656
    edited 2010-01-25 00:28
    I wouldn't even think of adding a delete function to a datalogger unless it was remote controlled
    like a space probe.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    VIRAND, If you spent as much time SPINNING as you do Trolling the Forums,
    you'd have tons of awesome code to post!
    (Note to self)
  • SRLMSRLM Posts: 5,045
    edited 2010-01-26 00:58
    Have you hooked it up right? The flashing light (in this case) means that the Propeller and datalogger got out of sync. Things to check:

    1. Is the Propeller running at 80MHz?
    2. Do you have the right connections to the datalogger? It's described in Autodatalogger.spin, and you'll need four resistors and a couple of wires.
    3. Are you using all the right pins?
    4. Is the mode jumper (UART/SPI) on the datalogger in the correct place?

    It might help if you post the code that you're using (or clarify: are you running the demo code straight?), and perhaps a picture.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Powered by enthusiasm
  • Van DesselVan Dessel Posts: 15
    edited 2010-01-26 02:40
    @ SRLM
    1. the propeller is running at 80Mhz
    2. Does the Cts pin of the datalogger need to be connected to the prop? Usually i connect it directly to ground through a 1k resistor as well as the RTS pin. With that configuration i could write to it too.
    3. I know i'm using the right pins since I had it working through another object (http://obex.parallax.com/objects/368/)
    4. Jumper mode is correct.
    I'll try again to see whether i'll have some better luck with it next time with your object.

    code that I was using (with the other object) until it failed skull.gif
    if USB.checkErrorCode == 0 
          repeat                                    'loop process
            leds(1)                               
            USB.OpenForWrite(string("data.txt"))    'Writes to the data.txt file and records the coordinates
            pause.pause1ms(10)                
            usb.write(gps.time)                     'time
            usb.writeline(string("   "))
            Usb.Write(gps.longitude)                'longitude
            usb.writeline(string("   ")) 
            Usb.Write(gps.latitude)                 'latitude
            usb.writeline(string("   "))  
            USB.write(gps.altitude)                 'gps altitude
            usb.writeline(string("   "))           
            Usb.Write(nums.decf((temps.gettempc) / 10, 3))    'temperature 1 whole numbers
            usb.write(string("."))
            usb.write(nums.dec((temps.gettempc) // 10))       'temperature 1 decimal numbers
            usb.writeline(string("   "))      
            Usb.Write(nums.decf((temps2.gettempc) / 10, 3))   'temperature 2 whole numbers
            usb.write(string("."))                                       
            usb.write(nums.dec((temps2.gettempc) // 10))      'temperature 2 decimal numbers
            usb.writeline(string("   "))          
            Usb.Write(nums.decf((temps3.gettempc) / 10, 3))   'temperature 3 whole numbers
            usb.write(string("."))
            usb.write(nums.dec((temps3.gettempc) // 10))      'temperature 3 decimal numbers
            usb.writeline(string("   "))
            usb.write(nums.decf((press.getsample), 6))        'pressure
            usb.writeline(string("   "))
            press.sendreset                
            USB.Close(string("data.txt"))                     'closes the data.txt         
            pause.pause1s(10)     
    
  • SRLMSRLM Posts: 5,045
    edited 2010-01-26 03:43
    For my object, you must have all three of the specified pins connected to the propeller. Otherwise, the propeller sends the data faster than the datalogger can handle, and so then it all gets hung up (with the red flashing light).

    Hardware Setup
    
    
    --------------------
    Datalogger:
    Connect the Datalogger to the Propeller as follows:
    1. Datalogger pin 2 to Propeller CTS
    2. Datalogger pin 4 to Propeller TX
    3. Datalogger pin 5 to Propeller RX
    4. Datalogger pin 6 to system ground
    
    Each connection has a 2K resistor, although down to 100ohm will probably be fine.
    Don't forget to connect the datalogger to a 5v supply.
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Powered by enthusiasm
  • Van DesselVan Dessel Posts: 15
    edited 2010-01-26 03:58
    okay, i'll try that tommorrow. Thanks!
  • Van DesselVan Dessel Posts: 15
    edited 2010-01-27 04:07
    THANK YOU SRLM!!!

    seems like it was the cts pin on the mcu not on the datalogger that needed to be connected. THANK YOU!!!!!!
Sign In or Register to comment.