View previous topic :: View next topic |
Author |
Message |
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
MMC/SD...... (again) |
Posted: Fri Apr 27, 2007 11:31 am |
|
|
Hello All,
18LF2620 @ 10MHz & 3.3V
3.236
Sandisk 512MB SD card
SD_CS --> RA5
SCL --> RC3
MISO --> RC4 (w/47k pu to 3.3V)
MOSI --> RC5 (w/47k pu to 3.3V)
DAT1 & DAT2 (w/47k pu to 3.3V)
Using mmc_spi.c, and redfined the pins for my hardware.
I've been reading associated threads. Some mention using an spi_setup. Why, if the mmc_spi.c is a bit banged spi? Is there a hardware spi mmc driver out there?
I get:
'mmc spi is busy'
error when it starts after programming.
I get:
'sent cmd 0, arg 0.
err: no start bit waiting for response'
After I disconnect the programmer and restart the PIC.
Where should I start looking?
Thanks,
John |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Apr 27, 2007 1:02 pm |
|
|
These are the default pin assignments in the MMC_SPI.c file.
Code: | #ifndef MMC_CLK
#define MMC_CLK PIN_B1
#endif
#ifndef MMC_DI
#define MMC_DI PIN_B0
#endif
#ifndef MMC_DO
#define MMC_DO PIN_B3
#endif
#ifndef MMC_CS
#define MMC_CS PIN_B2
#endif |
Can you post your #define statements that show your pin assigments ?
In other words:
Code: |
#define MMC_CLK (put your pin here)
#define MMC_DI (put your pin here)
#define MMC_DO (put your pin here)
#define MMC_CS (put your pin here) |
In addition to that, can you put a comment on each line which shows
the pin # and the signal name on the MMC that you have these PIC
pins connected to ?
Also post the manufacturer and part number of your MMC. |
|
![](templates/subSilver/images/spacer.gif) |
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
|
Posted: Fri Apr 27, 2007 1:15 pm |
|
|
EDIT:
Don't make any effort yet. I'm checking the pinout on the connector. I may have gooned that up when I made the foot print.
I'll report back.
PCM,
Thanks. Here's everything:
Code: | //SanDisk’s MultiMediaCards clock data in on the rising edge and out on the falling edge.
#ifndef MMC_CLK
#define MMC_CLK PIN_C3 //SD/MMC Pin#5 CLK
#endif
#ifndef MMC_DI
#define MMC_DI PIN_C4 //SD/MMC Pin#7 MISO
#endif
#ifndef MMC_DO
#define MMC_DO PIN_C5 //SD/MMC Pin#2 MOSI
#endif
#ifndef MMC_CS
#define MMC_CS PIN_A5 //SD/MMC Pin#1 CS
#endif |
I believe this is the card.
http://www.sandisk.com/Products/Item(1088)-SDSDB-512-SanDisk_Standard_SD_Card_512MB.aspx
It's not SDHC or anything special like that. Plain old SD... I think.
Thanks,
John |
|
![](templates/subSilver/images/spacer.gif) |
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
|
Posted: Fri Apr 27, 2007 2:45 pm |
|
|
PCM,
Sorry to have wasted your time.
The footprint was built wrong. I had check it over and over and even used another project on the web as a go-by. Arghhhhh.
Thanks,
John |
|
![](templates/subSilver/images/spacer.gif) |
|