Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Mp3 project: SPI to MMC/SD card problem

Status
Not open for further replies.

pepillo

Advanced Member level 4
Joined
Jan 23, 2006
Messages
114
Helped
3
Reputation
6
Reaction score
0
Trophy points
1,296
Location
Spain
Activity points
2,382
I am building an MP3 player with MMC/SD card interface to a PIC18F4550 through SPI, but I cannot get any response from the card, here are the details, anyone can help me?

- When I read from the card, the MISO line is all the time high or "1". I expect to receive an R1 command or "0x01" but I see no movement on the line.
- I am implementing the SPI read and write routines as "bit banging", with data valid on the rising edge of the clock
- The card and the microcontroller are powered at 3.3V
- There are no other chips using SPI on the bus
- The command initialization sequence is correct (the first command I send is CMD0, including staffing zeroes and the corresponding precalculated CRC).
- The socket is for MMC cards (has 2 pins less at the edges) and the card is a microSD, but this shouldn't affect no?
- The card is a microSD in an adapter to SD, instead of a proper SD, this shouldn't be a problem either?
- Do I need to send the SPI commands at an specific frequency or bitrate? The PIC is running off a 20MHz oscillator and the SPI routine is bit-banged so it should be relatively slow but this should help.
- The card is not broken as I can read and write using on my laptop's MMC/SD card reader
- Any consideration regarding data polarity?

I have followed the directions given by and the SD card Association.

I have no idea what else I can try... Anyone who has worked in a similar project can assist? Thx
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
48,408
Helped
14,251
Reputation
28,763
Reaction score
12,940
Trophy points
1,393
Location
Bochum, Germany
Activity points
280,133
You should try to get a response to CMD0 (soft reset) first. Maximum clock rate is specified as 400 kHz in identification mode, although
most cards most likely support higher rates. As you should have read from the said documentation, SPI mode 0 is needed for SD/MMC
card. The byte sequence for cmd0, including a correct CRC is {0x40, 0, 0, 0, 0, 0x95}. CMD0 should be preceeded by ten 0xFF bytes
to clear the card interface.
 

    pepillo

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top