View previous topic :: View next topic |
Author |
Message |
f00dstamps
Joined: 28 Mar 2006 Posts: 10 Location: Kansas City, MO
|
is SD backwards compatible with MMC? |
Posted: Tue Mar 28, 2006 11:34 pm |
|
|
i am using MMC SPI code to read and write files to MMC. will i be able to use SD interchangeably?
in other words, can i read and write data to the SD without using any of the additional security features that SD offers over MMC? |
|
|
Wizard
Joined: 27 Mar 2006 Posts: 9
|
|
Posted: Wed Mar 29, 2006 2:27 am |
|
|
Hi,
The SD cards are SPI compatibles as the mmc cards, and it uses 7 lines as the mmc, so the socket for the mmc will work. But to reset the SD card and set it in SPI mode, you will have to use others commands that you use with the mmc cards.
I'm also working with mmc cards, so far I have only tried the mmc_spi.c CCS driver with a 1.8K and 3.3K resistors(voltage divider) on the CS, SCK and MOSI lines. I can set the card in SPI mode with some problems. You can check my post. Could you tell me which circuit connection are you using and also which software? Regards, _________________ Tomas L. |
|
|
f00dstamps
Joined: 28 Mar 2006 Posts: 10 Location: Kansas City, MO
|
|
Posted: Wed Mar 29, 2006 2:33 am |
|
|
so, you have to use a different command to reset an SD card than you would to reset an MMC card?
i just started looking at the mmc.spi.c driver today. i am not using a voltage divider on the SPI lines. that driver file seems to be overkill because it doesn't utilize the spi_write() and spi_read() commands.
i am using CCS to compile. i am using 2 MMC slots and am also planning to control the VS1011 mp3 decoder chip with the SPI.
so far, i have can send commands to initialize. later on in my code, i am unable to send SPI commands but i do not know why. |
|
|
Wizard
Joined: 27 Mar 2006 Posts: 9
|
|
Posted: Wed Mar 29, 2006 3:05 am |
|
|
I dont have experience with SD cards, but that is what I have read.
The mmc_spi driver doesnt use the SPI hardware module, in spite of that it implements the SPI by software. To send your owns commands to the mmc you should use the function [code]mmc_send_cmd()[code/]
which pic are you using, it's running at 5V or it's LF and running at 3V? Are you using pull up resitors in the SDO and SDI lines?
Look at this post, and tell me if you have the same problem
http://www.ccsinfo.com/forum/viewtopic.php?t=26522
lets see if we can get something clear _________________ Tomas L. |
|
|
f00dstamps
Joined: 28 Mar 2006 Posts: 10 Location: Kansas City, MO
|
|
Posted: Wed Mar 29, 2006 3:09 am |
|
|
while using the mmc_spi.c driver file, i couldn't get the code to work.
i just stuck with my own. i am using the PIC18LF252. i am not using pull-up resistors on the sdo or sdi lines. should i be? i think i'm ok because i can reset the MMC cards effectively. |
|
|
jaime
Joined: 25 Nov 2005 Posts: 56 Location: Porto - Portugal
|
|
Posted: Wed Mar 29, 2006 7:40 am |
|
|
Hello...
I had read lots of topics about mmc, and i really would like to know some things, that makes me confuse:
We need to use fat 16 to the mmc works with the pic and the pc, ok?
The mmc card will be formated by the pic or must be formated, fat 16, in the pc?
Can we create, with the pic, a file for example data.txt, and inside store the data that we want? for example a data logger, where we can record the information that comes from gps, and then open the file in the pc.
Thanks
jaime |
|
|
rberek
Joined: 10 Jan 2005 Posts: 207 Location: Ottawa, Canada
|
|
Posted: Wed Mar 29, 2006 8:13 am |
|
|
If you are only using the card as a memory element, and you have no intention of making the MMC readable by a PC, then you can write the info into the card any way you like. You can then get info out of the card with the PIC and transfer it to the PC using RS232 or USB, utilizing Hyperterminal or a program of your creation.
If your intention is to have the card readable by a PC, then your PIC wil have to implement the appropriate file system, and be able to create and delete files and directories, maintain the boot sector, update the File Allocation Table, etc. This is a fair bit of coding (or scrounging as the case may be) but you will be able to put the card in card reader, or make your device a USB Mass Storage Device, and connect it to the computer and view your files normally.
I have not personally used these cards however, so perhaps someone with more experience can elaborate. |
|
|
|