CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

MMC/SD...... (again)

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

MMC/SD...... (again)
PostPosted: Fri Apr 27, 2007 11:31 am     Reply with quote

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
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Apr 27, 2007 1:02 pm     Reply with quote

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.
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

PostPosted: Fri Apr 27, 2007 1:15 pm     Reply with quote

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
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

PostPosted: Fri Apr 27, 2007 2:45 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group