This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Writing files with 8051

Hello,

I would like some assistance with storing information on a SD card in the format of a text file. This SD card is connected to a 8051 microcontroller. Communication with the card is done via the SPI. I'd really appreciate some sort of #include file or anything that lets me have access to functions such as fprintf and fscanf, fopen, fclose. Also if anyone can tell me weather FATfs (elm-chan.org/.../00index_e.html) files are ok to compile on a 8051.

Parents
  • For wear-leveling, it's possible to use a 2MB memory as a single ring-buffer where the writes not only contains the measurements + time stamps but also (if the time stamps aren't strictly increasing) record sequence numbers that allows the program to know where the current position is for read and write.

Reply
  • For wear-leveling, it's possible to use a 2MB memory as a single ring-buffer where the writes not only contains the measurements + time stamps but also (if the time stamps aren't strictly increasing) record sequence numbers that allows the program to know where the current position is for read and write.

Children
  • For wear-leveling, it's possible to use a 2MB memory as a single ring-buffer where the writes not only contains the measurements + time stamps but also (if the time stamps aren't strictly increasing) record sequence numbers that allows the program to know where the current position is for read and write

    struct
    {
    whatever else
    used
    }
    


    set 'used' to zero when the place is used (it will be 0xff after erase)
    at power up transfer first empty to ram

    Erik

  • struct
    {
    whatever else
    used
    read
    }
    

    if you have no other means of determining which records have been transferred to the PC, expand as the above

    Erik