How to find the address of stored data on a SD memory card?


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323

    Default How to find the address of stored data on a SD memory card?

    I've got a 2GB SD memory card that's formatted for FAT16, and I've put some data on it (just drag 'n' drop from windows) and now I need to read it back with my "device".
    The catch is, I can't look up the data by filename... I need to know the physical memory address to retrieve the goods.

    Is there an easy way (some kind of cute little utility?) that will tell me the starting addresses of the data items on my card?


    Thanks!

    steve

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    If you are using SDFS from MeLabs here is a snippet that might help.
    Code:
    SDOPEN_W:
    ' Open a file for write
    	FAT_mode = "A"		' Write mode
    	Gosub FSfopen		' Open file pointed to by Byte array FAT_FileName
    
      Serout2 PORTC.6, 16572, ["Open for write Error: ", Dec FAT_error, $d, $a]
    
    Serout2 PORTC.6, 16572, [ "FILE NAME  ", STR FAT_FileName\11, $d, $a]
    Serout2 PORTC.6, 16572, [ "DISK_fat  ", Dec DISK_fat, $d, $a]
    Serout2 PORTC.6, 16572, [ "DISK_buffer  ", Dec DISK_buffer, $d, $a]
    Serout2 PORTC.6, 16572, [ "SDC_sector_addr  ", Dec SDC_sector_addr, $d, $a]
    Serout2 PORTC.6, 16572, [ "FAT_ccls   ", Dec FAT_ccls, $d, $a]
    Serout2 PORTC.6, 16572, [ "LAST_CLUSTER ", Dec LAST_CLUSTER, $d, $a]
    Serout2 PORTC.6, 16572, [ "FAT_c  ", Dec FAT_c, $d, $a]
    Serout2 PORTC.6, 16572, [ "DISK_maxcls:  ", Dec DISK_maxcls, $d, $a]
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    If you are using SDFS from MeLabs here is a snippet that might help.
    Errr... welll... no... I'm not using SDFS. In fact I had to do a search just now to find out what the heck you're talking about.

    But I've downloaded the files and have the SDReadme.txt open in front of me now and it looks like this is going to be very helpful for me.

    It looks like I've got some reading to do... will be back later with more questions I'm sure.


    Thanks Dave!!

    steve

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    If you want to get into FAT32???
    http://www.picbasic.co.uk/forum/showthread.php?t=11700
    The new link to the file is near the end of the thread..
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default

    Thanks Dave, but I can't use FAT32. The SD card lives inside another device that doesn't play FAT32.

    Still researching my options....


    steve

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    The origional SDFS is FAT16.
    A cool thing about the SDFS32 is if you build your own card reader thingy it will be able to read or write to either one. It detects the format for you.
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 04:47
  2. Need the code to write to a memory
    By Hamlet in forum General
    Replies: 0
    Last Post: - 20th August 2007, 00:22
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  4. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 14:50
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 28th November 2004, 23:56

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts