Hi,
I got an SD Card reader module a while ago and just now got around to play with it. Sourced an old SanDisk 512MB SD card and formatted it to FAT16.
There was basically no documentation for the card reader module (this one: http://www.elecfreaks.com/store/sdmmc-c ... p-448.html ) and all it says on their website is "The module can work with 5V power supply" and "Note:If you use 3.3V power supply, please switch to 3.3V side" but what on earth is "3.3V side" ? there are no sides to this reader.
Anyway, it isn't working with my PIC18F4550 no matter what I do. I have tried 5V logic level, 3.3V logic level, hardware SPI, software SPI, set prescaler to 64 (instead of 16), tried all sorts of different clock speeds on the PIC itself.
Granted I might have binned it by using 5V logic levels to begin with. All I get is 0xFF when I try to initialize the FAT component. If I insert the card while the program is running it resets the PIC and again display "Waiting for Card" on the LCD (I used the code from the FAT example files) In the loop where it waits for init_FAT to reply 0x00 the LCD displays the retval value instead of "Waiting for Card" so that is how I know it is resetting the PIC when the card is inserted into the reader.
So, what SD Card reader do you recommend I buy? The objective is to find a good reader that works with any and all SD cards. The bigger the better. It will ultimately end up paired to a dsPIC33EP for data logging of many many data sources so speed and capacity is important. One data source will provide GPS data at 10Hz.
I hope to be able to stream data to an SD card using a file format like CSV or similar to simplify post processing of the data. Any thoughts on that?
I appreciate any and all help I can get.
/Daniel
recommended SD Card reader for FAT32?
Moderator: Benj
-
- Posts: 528
- Joined: Sat Dec 01, 2012 1:23 pm
- Location: Sweden
- Has thanked: 49 times
- Been thanked: 101 times
- Contact:
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
- Contact:
Re: recommended SD Card reader for FAT32?
I have moved you post to the Flowcode 5 forum as it is a question, not a tip or trick... Please do not use the "Programming Tips & Tricks" section for questions.
Regarding your question, have you considered (starting with) EB037? I know the name states MMC, the documentation shows it works with (512 byte sector) SD cards as well.
(What is the sector size of your card??)
Looking at the circuit diagram of your reader it seems unlikely you damaged it using it at 5V. Have you tested the SD card to check it is still working correctly?
Regarding your question, have you considered (starting with) EB037? I know the name states MMC, the documentation shows it works with (512 byte sector) SD cards as well.
(What is the sector size of your card??)
Looking at the circuit diagram of your reader it seems unlikely you damaged it using it at 5V. Have you tested the SD card to check it is still working correctly?
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis
-
- Posts: 528
- Joined: Sat Dec 01, 2012 1:23 pm
- Location: Sweden
- Has thanked: 49 times
- Been thanked: 101 times
- Contact:
Re: recommended SD Card reader for FAT32?
I have tried the card and it is working just fine in my USB card reader and I have tried formatting the card with both FAT16 and FAT32, both using a sector size of 512 byte.
No I have not considered using the EB037 as I do all my prototype work on breadboard and don't want nor need E-blocks.
Next on my to-do list is testing this with another PIC. Probably the PIC18F27J53 or the PIC18F26K80.
No I have not considered using the EB037 as I do all my prototype work on breadboard and don't want nor need E-blocks.
Next on my to-do list is testing this with another PIC. Probably the PIC18F27J53 or the PIC18F26K80.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: recommended SD Card reader for FAT32?
Hello,
Your PIC should be fine to use. Why not use the EB037 schematic as a guide to getting your hardware correct. If you have driven the card's VDD or it's I/O at 5V then it is likely the card will be damaged. Remember E-blocks are designed to save you time even if you don't actually use them.
Your PIC should be fine to use. Why not use the EB037 schematic as a guide to getting your hardware correct. If you have driven the card's VDD or it's I/O at 5V then it is likely the card will be damaged. Remember E-blocks are designed to save you time even if you don't actually use them.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 528
- Joined: Sat Dec 01, 2012 1:23 pm
- Location: Sweden
- Has thanked: 49 times
- Been thanked: 101 times
- Contact:
Re: recommended SD Card reader for FAT32?
The card reader has a 3.3V regulator for the VDD supply so I "only" applied 5V to the IO pins.
Card still works as far as I can see.
Will order a new one as they are very inexpensive and then connect it correctly this time
Card still works as far as I can see.
Will order a new one as they are very inexpensive and then connect it correctly this time
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: recommended SD Card reader for FAT32?
Ok you might be alright then, work a go before you buy new hardware. You could use resistors to create potential dividers for the PIC -> SD type I/O. The SD -> PIC I/O will not need to be level shifted.Card still works as far as I can see.
e.g.
MOSI -> PD -> SD
SCK -> PD -> SD
CS -> PD -> SD
SD -> MISO
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel