Shop OBEX P1 Docs P2 Docs Learn Events
Data Logging — Parallax Forums

Data Logging

Does anyone have any experience storing data. Moving data from sensor to a memory. Does anyone have code example??

Comments

  • DavidZemonDavidZemon Posts: 2,973
    edited 2016-03-30 01:16
    There's tons and tons of help, but we're going to need lots more information.

    1) How much data (in bytes) in what period of time?
    2) What kind of memory? SD card, EEPROM, SRAM, tape drive, neurons?
    3) Are you looking for a specific language? Here on the forums, we have experts in Spin, C, C++, Forth, Basic, Propeller Assembly, and a few others even.
  • 1. ten Bytes - ten samplings
    2. written into Quick start propeller memory - SRAM
    3. Example in Spin
  • muttvac wrote: »
    1. ten Bytes - ten samplings
    2. written into Quick start propeller memory - SRAM
    3. Example in Spin

    Thank you. This is a good start. Ten bytes isn't much, but it depends how often you need to write those ten bytes.

    The Quickstart does not have SRAM. It has a 64kB EEPROM, and the Propeller's built-in RAM (which is volatile, so I'm guessing not what you're looking for). For just 10-bytes, the EEPROM might work very well for you since no extra hardware or pins will be required, and it has plenty of space for an extra 10 bytes of data.

    At this point though, I'll drop out of the conversation. Once you answer the above, an expert in Spin should be able to point you at the right object in the OBEX and some example code for writing data to the EEPROM.
  • PublisonPublison Posts: 12,366
    edited 2016-03-30 14:13
    muttvac wrote: »
    1. ten Bytes - ten samplings
    2. written into Quick start propeller memory - SRAM
    3. Example in Spin
    You can use the Propeller Memory Card:

    https://www.parallax.com/product/40004

    There is Spin code available in the "Download" on the product page.

    EDIT: The Product is sold out!

    The Human Interface Card has a uSD card holder that is handy for data logging:

    https://www.parallax.com/product/40003
  • The entire 2nd 32K of the EEPROM is available for your use. Have a look at the Basic I2C Driver object in the Object Exchange. It has routines for writing and reading blocks of EEPROM and there's an example of their use in the comments at the start of the source code. Ten samples of ten bytes each is 100 bytes and you might as well use the first 100 bytes of the 2nd 32K of the EEPROM. First sample is EEPROM addresses 0 though 99. Second sample starts at 100, etc. I assume you have your samples in a ten byte array somewhere. The "WriteIt" example in the comments writes a block of 32 bytes. You're just writing a block of 10 bytes.
Sign In or Register to comment.