View previous topic :: View next topic |
Author |
Message |
dynamitron
Joined: 18 Mar 2009 Posts: 38
|
SD card problem |
Posted: Mon Mar 29, 2010 3:55 pm |
|
|
Hello all,
I have a project where I must use a SD card under fat32.
For starting, I am trying to do simple things with mmcsd.c from the CCS library. I use a SD daughter card from Microchip (AC164122). This card is brand new.
I use this simple code just to test writing a value and read it back just after, it comes from the examples library : ex_mmcsd.c
I had no success getting the card initialized. To make sure the hardware is ok, I am watching the SPI signal with a scope and there? SDI (signal form the card to the pic) stay always at 0V.
What is wrong ? If anyone have some advice, I would be very interested to know it.
Thanks in advance for the answer.
Dynamitron. |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Mon Mar 29, 2010 4:59 pm |
|
|
In order to help you we need more info:
- What is your compiler version number?
- Which processor are you using?
- Describe your hardware connections, or even better post a schematic.
- The pull-up resistors are present on the data lines?
- What voltage is the PIC running?
- And what voltage the SD card?
- Do you get any output printed? What output?
Post a small example program demonstrating your problem. Even when you are using ex_mmcsd.c you would have had to make some modifications for your hardware setup. |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
Re: sd card problem |
Posted: Mon Mar 29, 2010 11:09 pm |
|
|
dynamitron wrote: | I use a sd daughter card from microchip (AC164122). This card is brand new. |
There was an issue that I found with the Rev 3 boards that I reported to Microchip a few years back. The problem manifests itself when using a 5 volt system such as the Microchip HPC board (PIC18F8722). Basically the level translation logic does not work as intended. You can test if this is the problem by reducing the power supply to the PIC to say 4 volts. I solved it by replace the level converter from the PIC to the SD card with resistor dividers. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
dynamitron
Joined: 18 Mar 2009 Posts: 38
|
|
Posted: Tue Mar 30, 2010 1:09 pm |
|
|
Thanks for the first answers.
Some more info :
Compiler version 8.40
Processor Pic 18F8722
Pic voltage 5V
Voltage of the SD card 5V (pic side), 3.3V (card side).
There is 10k pull-up resistor to 3.3V on the daughter card on the SD side.
SD and Pic are interfaced by level converters and everything is as provided by microchip
The code is from ccs exemple ex_fat.c and mmcsd.c |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
|
Posted: Tue Mar 30, 2010 8:07 pm |
|
|
dynamitron wrote: | Thanks for the first answers.
Some more info :
Compiler version 8.40
Processor Pic 18F8722
Pic voltage 5V
Voltage of the SD card 5V (pic side), 3.3V (card side).
There is 10k pull-up resistor to 3.3V on the daughter card on the SD side.
SD and Pic are interfaced by level converters and everything is as provided by microchip
The code is from ccs exemple ex_fat.c and mmcsd.c |
Is the SD PICTail a rev 3? _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
dynamitron
Joined: 18 Mar 2009 Posts: 38
|
|
Posted: Tue Mar 30, 2010 11:58 pm |
|
|
Where do I find this inofrmation ? On the card itself ? |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
|
Posted: Wed Mar 31, 2010 2:07 am |
|
|
dynamitron wrote: | Where do I find this inofrmation ? On the card itself ? |
Yes - or the box it shipped in or the documentation that came with it. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
dynamitron
Joined: 18 Mar 2009 Posts: 38
|
|
Posted: Wed Mar 31, 2010 11:43 pm |
|
|
I have a rev1 card, it is mentionned on the delivery sheet which comes with the card.
I have tried to use a C code from microchip compiled with their student compiler. A this moment, I see indeed that with the scope, the SDI is alive but still the card is not going to initialized state.
The soft is very hard to understand, I do not believe that I will be able to do anything with it. I probably must pursue with ccs.
Any hint before I start modifying the card with my soldering iron ? |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
|
Posted: Thu Apr 01, 2010 3:29 am |
|
|
dynamitron wrote: | I have a rev1 card, it is mentionned on the delivery sheet which comes with the card.
I have tried to use a C code from microchip compiled with their student compiler. A this moment, I see indeed that with the scope, the SDI is alive but still the card is not going to initialized state.
The soft is very hard to understand, I do not believe that I will be able to do anything with it. I probably must pursue with ccs.
Any hint before I start modifying the card with my soldering iron ? |
Did you see my suggestion for delivering a lower voltage to the PIC? If the card is the problem then it will start working correctly. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
dynamitron
Joined: 18 Mar 2009 Posts: 38
|
|
Posted: Thu Apr 01, 2010 6:19 am |
|
|
yes I saw it and it is my next move...
Thanks for this suggestion, I will let you know. |
|
|
|