PDA

View Full Version : SD card reader



Klap
03-30-2009, 02:33 PM
I need some help involving the SD Card Adapter.

I just got an SD card adapter and have been playing with it for over a few days. I got a lot of help from the fsrw-and-friend file which I downloaded off of the parallax forum. I do not have a TV connection so I rewrote some of the code to work on the Serial Terminal. I got the code to work last night so it could Identify the SD card I was using and read/write files. Then this morning I made some more adjustments and I could not get the program to work again. I spend 5 hours straight trying to undo what I did and rewrote everything again from scratch but could not find the problem. I know it has got to be something simple because I got it working just yesterday in less than an hour. This is driving me crazy. If anyone could look over my code I would really appreciate it. I am including all of the code I have writing and also a readme file containing all of the work I have been doing and all of my notes about how to use my files.

Thank you ahead of time,
Aaron Klapheck
www.AaronKlapheck.com

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

mosquito56
03-30-2009, 03:36 PM
и Real simple fix, redownload the fsrw and friends and start over.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
иииииии

иииииии "What do you mean, it doesn't have any tubes?"
иииииии "No such thing as a dumb question" unless it's on the internet
ииииииии

Klap
03-30-2009, 03:41 PM
I did that. I still couldn't get the files to work. (I have to rewrite them because I don't have a connection for a TV so I must use the Serial Terminal)

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

MagIO2
03-30-2009, 04:36 PM
Hi Klap,

have a look at thread http://forums.parallax.com/forums/default.aspx?f=25&m=338494 . Search for PASMStore.zip which currently is in the last post.
There I also used the fsrw object without TV but with Serial interface. I don't see why you had to change the fsrw.

QuattroRS4
03-30-2009, 04:43 PM
Klap,
Just a thought here - did the SD card get corrupted - Do you need to reformat it ?

Regards,
John

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'

Those who can, do.Those who can’t, teach.

ElectricAye
03-30-2009, 09:52 PM
QuattroRS4 said...
Klap,
Just a thought here - did the SD card get corrupted - Do you need to reformat it ?

Regards,
John


Quattro has a good point. Sometimes if a file isn't formally closed out, the whole SD card will become unusable until it is reformatted. When I first started using SD cards, I had to reformat the card almost every time after running a program to debug it, otherwise the Propeller would get hung up because (I guess) it was waiting for the corrupted SD card to respond. In one case the card got so messed up, reformatting was impossible and I had to start with a fresh card. Make sure you are closing out each file properly before shutting off power or trying to start new files, etc.

good luck,
Mark

Oldbitcollector (Jeff)
03-30-2009, 10:40 PM
Klap,

You might try starting with a copy of FemtoBASIC (http://obex.parallax.com/objects/212/) (DongleBASIC) for use with serial.
This will allow you to confirm that your card/interface is working correctly, then move
back to dong your own code.

OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Visit the: The Propeller Pages (http://www.warrantyvoid.us/tiki-index.php?page=Propeller) @ Warranty Void.

heater
03-30-2009, 10:52 PM
I have had problems with the sd card SPI driver (I don't use the FAT file system stuff just read/write blocks) such that some times it refuses to work until I have powered by board down and up again. Just a reset would not get it unstuck.
Have yet to find out why this happens.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.

KPR
03-30-2009, 11:06 PM
Simple Question, is there a size limit for the SD Card that can be used other than the DOS Limitations??

Dos does a max of 2 gig right?? I have a 4 gig SD Card, would it still work?

k.

lonesock
03-30-2009, 11:15 PM
The High Capacity SD spec is a little different (SDHC cards are the ones over 2GB). See this thread here:

http://forums.parallax.com/showthread.php?p=746666

Jonathan

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lonesock
Piranha are people too.

Klap
03-31-2009, 04:43 AM
ARRRRRR!!

I can't believe I wasted all of my time on this one stupid error. My code was perfect, my SD card was perfect, all of my electrical connections were also correct. All of this time the problem was that uController.com sold me a defective product! I took a quick look at the schematics for the uController SD Card Adapter and took a closer look at the hardware they used. As I was doing this I noticed that there was a small spherical metallic ball near one of the pins. After using uControllers products ONE TIME one of their wields came loose. After re-welding the pin back to the board the all of my programs worked perfectly. There is always at least a one in a thousand chance of getting a defective product. It seems as though everyone else has a good working product from uController so I suppose that in this case I was that one thousandth person. If a large amount of others have had the same problem though then perhaps uController is loosing their touch.

Thanks for your ideas on reformatting though. I will keep those in mind when I use the SD card.

Oldbitcollector (Jeff)
03-31-2009, 04:49 AM
Be sure and message Brian about this. I know he'll take care of it.
uController stuff is generally solid and of good quality.
You might have gotten the "unlucky" board.

OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Visit the: The Propeller Pages (http://www.warrantyvoid.us/tiki-index.php?page=Propeller) @ Warranty Void.

Klap
03-31-2009, 04:52 AM
Thank you for your comment MagIO2. I will take a look at the thread you posted. Perhaps I can incorporate the work you did with the code I am now writing. I an rewriting all of the files, specifically fsrw, for two main reasons.
(1) The basepin terminology is confusing: You have to figure out which pin is the base pin then you have to figure out which way the pin numbers are increasing: for example you may have the right base pin but if you flip the SD Card Adapter around then the pins will not line up to the code. In addition to that if a person was to make their own connect to the SD card then they may not have the pins line up the exact same way. Lining up the clk pin to the clk pin, the do pin to the do pin, etc. I think would be much easier to understand.
(2) I am using the Serial Terminal so I had to at least edit the top file.
(3) The naming system for the files I thought was very confusing. I am an ME so it took me a while to understand everything that was going on and how to use the programs. I always try to dumb my code down so that I will remember what I am doing when I come back to this several years from now.

I will be working on finishing up writing my code today or tomorrow and will post is shortly after. I hope others will find it as useful as I do.

parts-man73
03-31-2009, 04:58 AM
I'm dismayed to hear this. I do test each one before shipping, and as you said, it worked once on your side as well. Tell me, is it the new surface mount design? I didn't like the amount of solder that the stencil that I use deposits on the circuit board, I may have to refine the assembly process. I certainly don't want any defective products, and I must say, this is the first defective that I've heard back about.

Please contact me privately if there's anything I can do to make up for the defective part.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Brian

uController.com (http://uController.com) - home of SpinStudio - the modular Development system for the Propeller

PropNIC (http://uController.com) - Add ethernet ability to your Propeller! PropJoy (http://uController.com) - Plug in a joystick and play some games!

SD card Adapter (http://uController.com) - mass storage for the masses Audio/Video adapter (http://uController.com) add composite video and sound to your Proto Board

Klap
03-31-2009, 05:09 AM
Thank you for your concern.

The SD Card Adapter I am using is a surface mount (not a through hole). A through hole would definitely be more stable, but I am not sure if the cost of building it would be prohibitive. The amount of solder used, although small, I believe is adequate. All of the other connects are in solid condition. If I am the only person who has had a problem with it then as I mentioned I am probably the one in a thousandth person who got the bad product.

Klap
03-31-2009, 07:56 AM
See this thread for my programs:
http://forums.parallax.com/forums/default.aspx?f=25&m=339479

QuattroRS4
03-31-2009, 10:24 AM
Klap,
I am glad you got to the bottom of it. I know Brian (uController) would like to know the details as he has a great product and would like to ensure that this does not happen again..

Regards,
John Twomey

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'

Those who can, do.Those who can’t, teach.