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
  • It's really not that complicated - once ChaN has done most of the work for you!

    FatFs gives you just a couple of dozen functions - and, as already noted, many (most?) of those are not relevant to your simple application.

    The functions you requested are there: f_open, f_close, f_write, f_putc, f_puts, f_printf, etc...

    If you do it all yourself, you will still end up having to write equivalent functions anyhow.

    And you will have to delve into the arcane world of the SD Card SPI protocol, and implement that yourself.

    "I need the 8051 (C8051F040 specifically) for its ADC"

    But why an 8051? Plenty of microcontrollers have on-board ADCs these days!

    Since the SD Card part seems to be the big obstacle to you, why not look for a board that comes complete with SD Card socket & examples, and work from there...?

Reply
  • It's really not that complicated - once ChaN has done most of the work for you!

    FatFs gives you just a couple of dozen functions - and, as already noted, many (most?) of those are not relevant to your simple application.

    The functions you requested are there: f_open, f_close, f_write, f_putc, f_puts, f_printf, etc...

    If you do it all yourself, you will still end up having to write equivalent functions anyhow.

    And you will have to delve into the arcane world of the SD Card SPI protocol, and implement that yourself.

    "I need the 8051 (C8051F040 specifically) for its ADC"

    But why an 8051? Plenty of microcontrollers have on-board ADCs these days!

    Since the SD Card part seems to be the big obstacle to you, why not look for a board that comes complete with SD Card socket & examples, and work from there...?

Children