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 support@ccsinfo.com

'ex_mmcsd.c ' help me...

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



Joined: 27 May 2008
Posts: 7

View user's profile Send private message

'ex_mmcsd.c ' help me...
PostPosted: Mon Sep 15, 2008 12:23 am     Reply with quote

hi,

I had used the ex_mmcsd.c, but when I connect to mmc/sd card, it always shown 'Could not initialize The MMC/SD card!'.

I used the right 3.3volt cct connection between PIC18452 and MMC/SD.

Please help me to solve this problem.

Thanks.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

Re: 'ex_mmcsd.c ' help me...
PostPosted: Mon Sep 15, 2008 5:43 pm     Reply with quote

amirharis wrote:
I used the right 3.3volt cct connection between PIC18452 and MMC/SD.
How can you say the connection is right if it doesn't work?

Always post you compiler version!

Are you using Proteus or is this real hardware?

There are at least two problems with the CCS mmcsd driver in v4.077.
Check out some hints in this thread
amirharis



Joined: 27 May 2008
Posts: 7

View user's profile Send private message

REal
PostPosted: Sat Sep 20, 2008 1:00 am     Reply with quote

i`m used real hardware.. but it doesnt work...

anyway, thx alot...
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Sat Sep 20, 2008 5:58 am     Reply with quote

How do you have the jumper set on the PICtail Board?
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en537238

What is your compiler version number? You can find it at the top of the list file (*.lst).
amirharis



Joined: 27 May 2008
Posts: 7

View user's profile Send private message

JUMPER
PostPosted: Mon Sep 22, 2008 12:28 am     Reply with quote

I'm using pic18f452 which connecting to PICtail Board for SD& MMC
( http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en537238)

I'm using the default. Like the datasheet said, SCK is RC3 in the pictail board. I think it doesnt matter about the connection.

I'm using PCW :
Code:


CCS PCH C Compiler, Version 4.057, xxxxx              22-Sep-08 14:15

               Filename: C:\Program Files\PICC\Examples\ex_mmcsd.lst

ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon Sep 22, 2008 4:59 pm     Reply with quote

Are you sure the PICtail Board is connected right? It is possible to mount it 180 degrees wrong...

What type of card are you using? MMC / SD / SDHC?
What memory size has your card?
amirharis



Joined: 27 May 2008
Posts: 7

View user's profile Send private message

PICtail Board
PostPosted: Tue Sep 23, 2008 9:05 am     Reply with quote

hi ckielstra,

yes.. the board is connected... but, it doesnt work...

I'm using SD card, Kingston, 1GB...
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue Sep 23, 2008 4:40 pm     Reply with quote

The card should be ok.

Quote:
yes.. the board is connected... but, it doesnt work...
I don't want to know if it is connected, but if it is connected right. You can connect the board in two directions. One wrong, one good.
How do you know it is connected right?

On which pin have you defined the Chip Select (CS) signal?
The PICtail has it on pin B3 by default but the mmcsd.c driver uses C2 if you don't define it.
In your main.c, before the include of mmcsd.c, add the following code:
Code:
#define MMCSD_PIN_SCL     PIN_C3
#define MMCSD_PIN_SDI     PIN_C4
#define MMCSD_PIN_SDO     PIN_C5
#define MMCSD_PIN_SELECT  PIN_B3
amirharis



Joined: 27 May 2008
Posts: 7

View user's profile Send private message

PostPosted: Wed Sep 24, 2008 1:09 pm     Reply with quote

Hi there...

It doesn't work...
I had change the program..

But still cannot initialize the card.

hmm.. what is the problem do u think?
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Wed Sep 24, 2008 4:28 pm     Reply with quote

amirharis wrote:
hmm.. what is the problem do u think?
I'm running out of quick options. I gave you a lot of hints but I can not verify you did everything right. Best is to start all over from the beginning.

1) what hardware board is your processor mounted on? If you bought it please mention type / number and brand. If you designed it yourself describe the circuit (posting a schematic would be great).

2) Can you run a program on the board that blinks a LED once per second? Verify the rate to be 1 second by clocking 10 blinks on a stopwatch, this should total close to 10 seconds.

3) Extend the program from question 2 to blink the LED only when a card is present (card detect signal is on pin RB4).

If you get it working this far we have proved the hardware is connected correct and working as expected.

Post the program you created in step 3, I'll use it to design the next step.
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