Announcement

Collapse
No announcement yet.

SANDBOX-0003 uDRIVE with BASIC Stamp 2

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SANDBOX-0003 uDRIVE with BASIC Stamp 2

    ID: SANDBOX-0003
    STATUS: 100% complete
    AUTHOR: Anna Ceguerra
    DATE: 6 December 2009
    Copyright (C) 2009 Anna Ceguerra

    Introduction
    This document describes how to log an incrementing counter onto 4D Systems' uDRIVE-uSD-G1 and read back the file using PBASIC and a BASIC Stamp 2.
    4D's uDRIVE-uSD-G1 gives embedded applications the ability to read and write files to a microSD card using serial DOS commands. An example is given using a BASIC Stamp 2 module within the Parallax Board of Education, where the BASIC Stamp 2 is the host processor and the uDRIVE is the slave device.

    Parts needed
    • Parallax BASIC Stamp 2
    • Parallax Board of Education
    • 4D uDRIVE-uSD-G1 ( http://www.4dsystems.com.au/prod.php?id=22)
    • microSD card formatted to FAT16 ( http://www.4dsystems.com.au/prod.php?id=36)
    • 2 x 2k2 resistors
      Related documentation
      • 4D uDRIVE-uSD-G1 Datasheet, and Command Set ( http://www.4dsystems.com.au/prod.php?id=22)Parallax BASIC Stamp Syntax and Reference Manual (web-BSM-v2.2.pdf)
        Software needed
        Parallax BASIC Stamp Editor v2.4.2 and aboveSendReadCommandTo_uDrive_16bitfilesize.bs2 (attached)SendWriteCommandTo_uDrive_16bitfilesize.bs2 (attached)

      Circuit diagram software:
      PEBBLE schematic program ( http://www.4dsystems.com.au/prod.php?id=93)PEBBLE circuit diagram code (attached)


    Circuit diagram
    The uDRIVE-uSD-G1, containing the microSD card, is attached to the Parallax Board of Education breadboard, and the pins are connected as follows:
    pin 1 - (none)
    pin 2 - Vss
    pin 3 - 2k2 resistor - P1 BS2
    pin 4 - 2k2 resistor - P0 BS2
    pin 5 - Vdd
    NOTE: The PEBBLE diagram shows yellow as the link to P1 and green as the link to P2 on the BASIC Stamp 2. Black is the link to Vss, and red is the link to Vdd.

    How it works
    1)The PmmC file for the uDRIVE-uSD-G1 defines the library functionality of the module. Ensure that you have the latest from the 4D website product page.
    2)The BASIC Stamp 2 that has been programmed using BASIC Stamp Editor with the following file: (SendWriteCommandTo_uDrive_16bitfilesize.bs2) will send serial commands to write the program's counter onto the file in the uDRIVE-uSD-G1's microSD card as the counter is incremented.
    3)The BS2 programmed with the following file (SendReadCommandTo_uDrive_16bitfilesize.bs2) sends serial commands to read the file and displays it to the terminal.

    Until next time!

    Regards,
    Anna.
    Attached files SANDBOX-0003_uDRIVE_BS2.zip (3.6 KB)
Working...
X