Shop OBEX P1 Docs P2 Docs Learn Events
Memory stick datalogger & basic stamp 2P problems. — Parallax Forums

Memory stick datalogger & basic stamp 2P problems.

CuriousOneCuriousOne Posts: 931
edited 2013-12-05 17:01 in BASIC Stamp
Hello.

I got Basic Stamp 2P24 module, Stamps in class board and bought memory stick datalogger from parallax. Connected them as in datasheet, and downloaded the sample code.

So far, tried two low capacity flash drives, 1GB and 4GB. With both, symptoms are the same, I'm getting the following output:

Memory Stick Datalogger Test V1.1
Synchronizing...
Checking for USB Flash drive...
Drive D: Ready...
Random Number (Seed) = 7618
Error reading the seed file -- Halting execution!


I've double checked the code and wiring, everything is OK. The power is also OK - I'm using AC power supply.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-12-04 08:01
    The Memory Stick Datalogger sample code uses the SERIN and SEROUT statements to talk to the Datalogger and those statements are Stamp model dependent. The Baud constant is different for the BS2 and the BS2p. Make sure you've changed the Baud constant in the sample code. For the BS2, it's 84. For the BS2p, it's 240.
  • CuriousOneCuriousOne Posts: 931
    edited 2013-12-04 10:42
    So basically, if I would insert plain BS2 module, everything should work properly?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-12-04 12:02
    Well yes, but you can use the BS2p if you change the affected command values accordingly. Mainly the baud rate value.
  • CuriousOneCuriousOne Posts: 931
    edited 2013-12-05 11:54
    Yes, I've installed BS2, reflashed and everything now works just fine.

    However, why there's no sample SIMPLE code, which will look like:

    To read file from flash disk, use this code, to write file to flash disk, use this code and so on.

    Why there's only one example, and complicated one? from the first look, it creates expression that it is necessary to use random seed to work with adapter.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-12-05 17:01
    It's really not that simple. In order to write to the drive a number of values need to be calculated specifically for the exact number of bytes you're writing. This varies from one program to the next so the example shows one way to do it and you can get the details from the firmware documentation on how to make changes.
  • And almost 10 years passed :smiley:
    Demo code seems to be gone from Parallax website
    but I still have these laying around.
    Any place where I can download it?

  • Thanks, but it seems like there's nothing to download regarding the statements needed to control this device.....

  • I use this one with my FTDI Vdrive3, works with no problem

  • I've used the vDrive extensively with the Stamp for weather data logging in long term remote deployments. I always include means to cycle the power. The vDrive has no other way to give a hard reset, and it can and does occasionally get locked up either through firmware errors or through bumps in the night. Also, for infrequent logging, turning off the power prolongs the battery life. I'll attach a test program, a terminal that allows the user to type in vDrive short commands and see the responses to commands like file and disk info and to experiment with opening and reading files.

    Note that the baud constant for the BS2p is different from the BS2pe in the demo. Use $F0 (240 decimal) instead of $54 (84 decimal) as the baud constant.

    I'll also attach my driver for the vDrive that occupies its own program slot on a BS2pe. It allows writing data records to a file, for reading back the file, and housekeeping chores. It is quite specific to my multi-slot programming templates, and is sub-slot, not a main program. but it might give you some ideas about how to proceed.

Sign In or Register to comment.