Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

8051 MicroC Mp3 Project (SD Card Initialisation)

duncanheavenduncanheaven Posts: 4Member
[color=Red]Hi.....[/color]
[color=Black]I'm currently working on a mp3 project using 8051 Microcontroller. I'm facing problems in interfacing the SD Card. I have no idea on how to [color=Orange][b]INITIALISE[/b][/color] the SD Card using [color=Orange]C Code[/color].Can anyone help me up with this problem. Hope can get some examples or any info from you. Your help is much appreciated. :-) [/color]


[color=Orange]Thank you for your replies. Can I know where can I get some examples on writing SPI software using C Code in order for me to interface with 8051 Micro controller. My project required me to use 8051 micro controller so I can't change to other more modern Micro controller.:-(

I hope can get some info on writing C Code to interface 8051 micro controller using SPI mode.[/color]

Comments

  • LundinLundin Posts: 3,711Member
    Yeah, call the function initialize_generic_sound_card()...

    Seriously, that's all hardware-specific stuff. You'll have to check the data sheet for the particular soundcard.
  • anthrax11anthrax11 Posts: 511Member
    I think he means a Secure Digital card, not a sound card.

    Anyway, these cards can be somewhat tricky to initialize. There are
    different vendors and different versions/configurations of the card
    with slightly varying software commands. It's all thoroughly covered
    in the official documentation, though:
    http://www.sdcard.org/about/memory_card/pls/Simplified_Physical_Layer_Spec.pdf

    Btw, I couldn't find any project that interfaces an 8051 to an SD card and
    that's probably because the 8051 lacks an internal SPI interface, which is
    commonly used in homemade projects using a memory card. You can still do
    this in software with a bit more work. Plenty of code examples for other
    processors can be found if you google for keywords such as "sd", "card",
    "avr", "pic" and "project".
  • LundinLundin Posts: 3,711Member
    Ok. The curse of acronymns.

    Are you serious about the SPI interface though? Every micro has one nowadays. There are loads of 8051 derivates too, there ought to be one with SPI. If not from Intel, then surely from Phillips/NXP or Atmel. Intel derivates all of it.

    Yeah it is quite possible to write a software SPI by using timers, but that's the painful way... There is probably code for that on the net though. I know that Freescale has a software SPI available for their micros, though I'm not sure if it is written in C or asm.

    But I'd consider switching to a modern micro instead of using software SPI... 8051 is quite ancient by now.
  • anthrax11anthrax11 Posts: 511Member
    : Are you serious about the SPI interface though? Every micro has one
    : nowadays. There are loads of 8051 derivates too, there ought to be
    : one with SPI. If not from Intel, then surely from Phillips/NXP or
    : Atmel. Intel derivates all of it.
    :
    [color=Blue]Ok, looks like you're right about that. It just seemed like most of them
    didn't have SPI, because I c[color=Blue][/color]ouldn't find any project involving an 8051
    and an SD card.. At least the older versions certainly didn't have it.[/color]

    : Yeah it is quite possible to write a software SPI by using timers,
    : but that's the painful way... There is probably code for that on the
    : net though. I know that Freescale has a software SPI available for
    : their micros, though I'm not sure if it is written in C or asm.
    :
    [color=Blue]Actually, the good thing about SPI is that the master controls the clock
    itself. The clock doesn't have to be constant, so no timing is needed
    except maybe a few delays during initialization. It shouldn't be too hard.[/color]

    : But I'd consider switching to a modern micro instead of using
    : software SPI... 8051 is quite ancient by now.
    :
    [color=Blue]Agreed.[/color]
  • LundinLundin Posts: 3,711Member
    : [color=Blue]Actually, the good thing about SPI is that the master
    : controls the clock
    : itself. The clock doesn't have to be constant, so no timing is needed
    : except maybe a few delays during initialization. It shouldn't be too
    : hard.[/color]


    SPI isn't standardized... a device could demand a certain frequency in order to work. It is all device-specific.
  • siramin056siramin056 Posts: 1Member
    Hi Duncanheaven,
    I have the same problem and can not find any sample code for SD device, however I found sample codes for SD Host. Did you solve your problem? did you find any sample code? if yes, can you send them to me? my mail address is: siramin056@gmail.com
    thanks.

    also any help by others will be helpful.

    --
    Regards
    Amin
  • honford_chonford_c Posts: 2Member
    Hi guys,

    I am looking for the sample code of SD device too. Can you please send me the code, my email is honford_c@hotmail.com

    thanks.
  • honford_chonford_c Posts: 2Member
    Hi guys,

    I am looking for the sample code of SD device too. Can you please send me the code, my email is honford_c@hotmail.com

    thanks.
Sign In or Register to comment.