To use this file copy and paste this:    // #URL-lib "http://pin1.org/forthlib/flb/SD-Card/stage-2.fth"   into BV Terminal 3 or here to download.

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Simple test program just using the basic address read write interface // see the About.htm file under using stage 1. // This showes how to initialis the card and read a block from it // The chip select pin is p0.3 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

// REQUIRES: // #URL-lib "http://pin1.org/forthlib/flb/General/soft1.flb" sid=99 // #URL-lib "http://pin1.org/forthlib/flb/General/pinsel.flb" sid=100 // #URL-lib "http://pin1.org/forthlib/flb/General/SPI.flb" sid=101 // #URL-lib "http://pin1.org/forthlib/flb/SD-Card/MMC.flb" sid=102 // #URL-lib "http://pin1.org/forthlib/flb/SD-Card/fat-1.flb" // dump is used for debug and so is included in its entirity // #URL-lib "http://pin1.org/forthlib/flb/General/dump.flb" sid=103


Full Contents of File

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// Simple test program just using the basic address read write interface
// see the About.htm file under using stage 1.
// This showes how to initialis the card and read a block from it
// The chip select pin is p0.3
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

// REQUIRES:
// #URL-lib "http://pin1.org/forthlib/flb/General/soft1.flb" sid=99
// #URL-lib "http://pin1.org/forthlib/flb/General/pinsel.flb" sid=100
// #URL-lib "http://pin1.org/forthlib/flb/General/SPI.flb" sid=101
// #URL-lib "http://pin1.org/forthlib/flb/SD-Card/MMC.flb" sid=102
// #URL-lib "http://pin1.org/forthlib/flb/SD-Card/fat-1.flb"
// dump is used for debug and so is included in its entirity
// #URL-lib "http://pin1.org/forthlib/flb/General/dump.flb" sid=103


   
: start// mounts device 0 csel 3 at 4mhz
    4000000  spi.speed  // 4Mhz card
    3  0  mmc.mount 
;

// display device geometry
: gxf.geo.  ;

: disp ( sector -- )   // displays a sector
    f.sec@
    f.fb  bdump  bdump  drop
;