View previous topic :: View next topic |
Author |
Message |
amirharis
Joined: 27 May 2008 Posts: 7
|
'ex_mmcsd.c ' help me... |
Posted: Mon Sep 15, 2008 12:23 am |
|
|
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
|
Re: 'ex_mmcsd.c ' help me... |
Posted: Mon Sep 15, 2008 5:43 pm |
|
|
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
|
REal |
Posted: Sat Sep 20, 2008 1:00 am |
|
|
i`m used real hardware.. but it doesnt work...
anyway, thx alot... |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
|
amirharis
Joined: 27 May 2008 Posts: 7
|
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Mon Sep 22, 2008 4:59 pm |
|
|
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
|
PICtail Board |
Posted: Tue Sep 23, 2008 9:05 am |
|
|
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
|
|
Posted: Tue Sep 23, 2008 4:40 pm |
|
|
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
|
|
Posted: Wed Sep 24, 2008 1:09 pm |
|
|
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
|
|
Posted: Wed Sep 24, 2008 4:28 pm |
|
|
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. |
|
|
|