Shop OBEX P1 Docs P2 Docs Learn Events
using BSII's memory bank for data logging — Parallax Forums

using BSII's memory bank for data logging

evergreenevergreen Posts: 43
edited 2006-04-15 20:00 in BASIC Stamp
Hello, may someone please show me a sample of how to use BSII's memory bank for data logging? I realize there's not much space, but I need to store about log about 30 samples from a 12-bit ADC (is this even possible?).

Thanks!

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-04-15 06:50
    Hello,

    ·· Check the Help File or the BASIC Stamp Manual on the WRITE command.· There's an example included as well.· Bear in mind that with 12-bit data you will actually be writing 16-bit values (Words) to the EEPROM so you will use 2 bytes per sample.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • evergreenevergreen Posts: 43
    edited 2006-04-15 18:18
    Whoa, sweet. Sorry if this sounds like a dumb question.. but if the BS1 has a 256 byte EEPROM, and half of it is used for a program, does that mean I can store 64 values from my 12 bit ADC (256/2=128 128bytes/2bytes per sample = 64 samples)?

    Thanks
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-15 20:00
    Yes. Be sure to use the Memory Map function of the IDE to see exactly how much space your program is using. Your program can actually prevent overwriting program tokens by looking at the value in EEPROM location 255: this is the address of the last user-EEPROM location available; if your write past this you will clobber your program.· Note that this feature is only available on the BS1.

    Addendum: I've attached a screen cap of the Memory Map to show you how location 255 works.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax

    Post Edited (Jon Williams (Parallax)) : 4/15/2006 8:14:31 PM GMT
    714 x 437 - 170K
Sign In or Register to comment.