Prop BOE SD Card not working
smithdavidp
Posts: 146
I am having problems with the Prop recognizing the SD card. When I run the test I get this:
Are there some jumpers I need to hook up. I should also add that I have an XBee module installed over the SD socket. The jumpers for the XBee are installed and the XBee does work. (Jumpers from D0 to Pin0 and DI to pin 1) Tried two different cards and both had the same results.
Both cards are formatted FAT 32 and at 32k. Somthing tells me this has to be a simple thing I am missing but as they say "I may be too close to the problem to see the solution".
Are there some jumpers I need to hook up. I should also add that I have an XBee module installed over the SD socket. The jumpers for the XBee are installed and the XBee does work. (Jumpers from D0 to Pin0 and DI to pin 1) Tried two different cards and both had the same results.
Both cards are formatted FAT 32 and at 32k. Somthing tells me this has to be a simple thing I am missing but as they say "I may be too close to the problem to see the solution".
Comments
What program are you using?
It looks like one of Kye's.
I'm pretty sure you don't need to hook anything up to use the SD card with the PropBOE. You do need to have the pins set correctly in the program.
I've used a SD with my PropBOE and I'll cut my program done to just a quick demo for you to try. I'll post it later today. (Probably soon.)
Edit: Kye's driver is very picky about errors on a SD card. I've had to reformat more than one SD card before it would work correctly with Kye's driver. "Quick" format doesn't solve the problem. It needs to be the normal format (that take a long time).
the etching on the bottom of the board which shows the SD card reader pins on the R/H Side of the XBee socket marked DAT1, DAT2, DO8, and PWM1. The sysdep_demo_ser parameters are set up like this:
con
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
sd_DO = 0
sd_CLK = 1
sd_DI = 2
sd_CS = 3
obj
term : "FullDuplexSerial"
{{
This should start stdin and out, but *not* anything on the
secure digital card.
}}
pub start
term.start( 31, 30, 0, 115200 )
The term start is just for the serial terminal interface right?
Stick with brand name cards only. They're not that much more expensive.
I have had good success with SanDisc 2GB cards. They cost about $4 each in bulk packages of 2 or 4.
As the type, make, and model of your card matters, please share that info, and we can build a database of what cards will work, and what won't.
One last thing: You really have to press that card into the uSD slot. Remove it, and plug it back in. Try it several times. Once seated it should be okay, but several times my card just wasn't making good connection. (I am also using a pre-release board, so this could be something not present in the production models.)
-- Gordon
I'm minutes away from posting some demo code.
I don't think you have your pins set correctly.
Here's my pin settings.
While I agree with Gordon's suggestion to use name brand SD cards. I disagree with his suggestion to avoid the high capacity cards.
I've used several different 4GB and 8GB uSD cards with Kye's driver.
The only SD card (or a dozen or so I've tried) that hasn't worked with his driver is a 256MB card I purchased a long time ago.
I would take Gordon's advice about using the smaller capacity cards if you want to be able to use all the various SD drivers available. Many of them wont work with the HC cards.
I for one, don't see my robots taking over the world using just 1GB and 2GB cards.
Though to tell the truth, I've never needed more than a megabyte of storage so far.
I'll have that demo up shortly.
is comfortable 4096 at 1024 being read/written just a hair over 1050ms. I'm happy........and impressed! Thanks for the help guys!!!!!!!
I'm not sure how I feel about disagreeing with Gordon about something! I've been using the "bulk" SD, microSD cards and thumbdrives I get from microcenter for years and have never had a problem with them. This is the lowest priced memory I've found anywhere! I've also dealt with the sub-gig flash memory and found that the smaller cards were much less likely to follow the letter of the standard then the larger ones. It's also getting harder to get small cards. I haven't seen anything smaller then 2gig for years now and even they're getting harder to find.
Currently every propeller board with a microSD card I have has a 4gig card in them and while I agree that it's a stupid amount of space I've never had a problem with them.
Amazon, Computer Geeks, and even Wal-Mart (though mostly online) sell the 1-2GB cards. The cheapest brand at Wal-Mart is WinTec, and they seem to be okay. I try to get them when they're on sale, preferably in the $3/each (or less!) range.
-- Gordon
You don't really need the schematic, though it's never a bad idea to check it. The pin numbers are printed on the board. The numbers are above the resistors, but as there are no other components or sockets adjacent, the pin numbers there must be for the SD card.
For those not as comfortable reading schematics, as you say the pin numbers for the SD card (and most other integrated components) may be found starting on page 3 of the PropBOE documentation.
-- Gordon
Sorry, I'm out of time right now so I can't explain the program as much as I'd like. I did try to comment the code some.
Here's the output the first time the program is executed. (The forum software removed some blank lines.)
Subsequent times the program is run, th previous log files will be found and a new log file will be created numbered one higher than the last log file found of the SD card.
Here's a partial output from the second run of the program.
I used numbered log files in my own projects, and I've seen several requests on the forum on how to number log files, so I thought it would be a good feature to include in the demo.
I'm always unsure how simple to make a demo vs how many features to include.
I tried to take a middle road with a relatively simple demo that has some of the features I've frequently seen questions about.
Kye's driver doesn't have a way to write variable as ASCII characters directly. The "Dec" method in this demo does this.
One thing I really like about Kye's driver is the ability to timestamp the files with a RTC. This code does not use a RTC so the files wont have an accurate timestamp.
You'll see I use a green and red LED in the progarm. The pins used with the LEDs are listed in the "CON" section.
Let me know if you have any questions.
I agree.
Darn it! I was just enjoying my disagreement with you and I go and agree.
Instead of listing the SDHC cards that do work with the PropBOE, I think it would be easier to list those that don't. As I mentioned earlier, I haven't found any SDHC cards that don't work. I suppose I've only tested a few different brands though.
I think it will be the exception to the rule when one is found not to work.
Again, this doesn't pertain to all the SD drivers available for the Prop. Many (most?) wont work with SDHC cards. It's just Kye's driver that doesn't seem to have a problem with any of the SDHC cards I've used with it.
Glad you pointed this out because I was going to mention it, as this is something I feel fairly passionate about. People tend to forget there are a lot of examples out there (OBEX, this forum, various blogs and Web sites) with earlier versions of drivers such as fsrw that don't handle FAT32. For first-timers downloading these projects, they'll get stuck when things won't work, and then need to learn all about FAT sizes, clusters, and capacities before they can even move to square one. In the shoes of a beginner imagine how frustrating that is.
Example: If you download Ray's excellent WavePlayers example, you'll get fsrw 1.5. Will beginners know to upgrade?
As the problem is not likely to be the PropBOE hardware, I believe the best way to start the troubleshooting is to suggest to use a 1 or 2 GB card, which are in fact still plentiful and cheap (Parallax could sell 'em, too). By inference the majority of these cards will come formatted FAT16 (that's not always true, of course), and therefore will work on all the SD objects out there. Ray's wonderful examples will suddenly spring to life!
If we want to attract more beginners to the Propeller we need to change our own mindset, especially if we hope for the PropBOE to make strides into the same markets now dominated by the Arduino. That should start, IMO, with an SD object that comes with the IDE. As *experts* we can use anything we want, because we'll know there are later versions of these objects that support FAT32 and SDHC.
Duane, I wonder if that small card was formatted for FAT12. That would be my assumption, anyway.
-- Gordon
I'm not trying to be argumentative but this is going to become a bigger problem that's going to need to be addressed. I'm not sure how different fat16 and fat32 and how much work it'll take to update fsrw to work with fat32 but I don't see 2gig cards being available for much longer.
It looks like it has for a while as well. I also need to correct the prices I mentioned for the microSD cards I bought. I quoted the prices on the bin but they were on sale for $3.50 and $4 ea!! :-)
Yes, the wrong size SD card would be one more thing that could go wrong for a beginner.
I remember (just a couple of years ago), when I started using microcontrollers, a couldn't get a lot of my first projects to work correctly. There were just so many little details one needed to know to get sensors and programs to work correctly. Using the wrong object when using a SDHC card would have been frustrating.
So yes, using an 1GB or 2GB card would eliminate some of the possible errors a beginner could make. (Did I just lose a bet?)
Personally, I was very pleased when Kye added SDHC support to his driver. I no longer needed to purchase some cards just to use with the Propeller. With Kye's driver I could use cards purchased for cameras and other devices with the Prop.
Edit: I hadn't read the previous three posts when writting this one.
Some palliative steps could include having the authors of objects in the OBEX review their submissions, making sure they include the latest SD driver. The next update to the Propeller Tool should include it, or Kwabena's, or someone's that's been shown to work with FAT32 and SDHC. Many users aren't even aware of the issues of FAT sizes and capacities in these cards, so maybe a writeup on the subject in the learn.parallax.com site for the PropBOE might be useful. I'm pretty sure the latest fsrw is drop-in compatible with the older versions, so it ought to be a case of just replacing files. I hope so.
It might also be useful if Parallax sold some 2 GB non-HC cards. As you've noted, price is very reasonable. I do most of my buying online, where they are still plentiful (for how long, who knows?), but just having them as an option on the Parallax shopping pages would be helpful in establishing a baseline for support.
While I don't get furious about it, a pet peeve of mine from an education standpoint is that the Prop Tool comes with no fewer than three serial objects, and their syntax is completely different. I rather like fsrw's methods -- like just specifying the base pin if the other three are connected consecutively -- and I hope similar objects could be written or revised to be a little more standardized. I like having multiple objects to choose from, but I often pass up the option to switch because it can be such a hassle to go through and change all the code.
Those in the Arduino space know that with their latest release they put a lot of effort into making methods more compatible and self-discoverable across objects. By deriving from a standard Stream base class, objects like serial, I2C, ethernet, and even SD communication now have shared methods that make coding easier. It also makes maintaining these individual objects simpler. I'm all for the Propeller adopting more base classes (that are in the IDE) that other objects can be derived from.
All in all, I don't ask for much!
-- Gordon
Good question, and I don't have the answer. I'm just being an observer here, and comparing what appears to be working in other open source models.
I do think that if A creates a popular object and B wants to improve upon it, A's object should be enhanced rather than releasing a whole new (and possibly different working) object. That's the spirit of the open MIT license that nearly all of the objects are released under. If that's not practical -- it's a whole new idea -- I think it makes sense to try to follow A's lead, assuming A's object was decent to begin with. If it uses methods that have a reasonable naming structure, why not keep it. Why reinvent that wheel for each object?
I return to the varieties of serial objects, and the sometimes mystifying differences in method names and syntax. Which syntax is better I can't say, but I think having consistent method calls between them would benefit all users, especially newcomers. With that said, GCC offers a fresh chance, and I'll be interested to see how that develops. As I'm more of a C programmer, that's something I can finally contribute to.
-- Gordon
I'm not sure who (person or group) would be the arbitrator but the internet uses the RFC process to generate standards. Maybe something like it could be adopted with the object exchange. My first thought would be that Parallax would take the role that the ietf has in the RFC process. I do know that they're looking to add more in the way of standards to the objects in the obex. Somethin like an RFC process would allow others working on a similar object or process to to offer comments about the directions they're going in order to utilize the best ideas of all involved.
On a side note all this talk about sd, sdhc cards as well as fat16 and fat32 has triggered my OCD and not long after I got home from my first trip to Microcenter with my 2gig microSD cards I went back and got a bunch ( 25 ) more. This is more then I will ever have any use for with any propeller I projects I'll ever need an microSD (not sdhc) with fat16 so now the world is safe and sdhc with fat32 will become mainstream with!!! :-)
Haha! I'm the same way. Once I get a bug in my ear I go hog-wild.
Dave, Duane's demo looks like a great way to test the functionality of the SD services, while providing some helpful tips at the same time. Duane, can you put it in the OBEX so when folks have an SD problem we can point to a convenient download location?
-- Gordon
http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=250987330642#ht_4047wt_1141
@Gordon, I feel kind of silly putting a demo of someone else's object in the OBEX but if you think it would be a good idea, I'll do it.
The demo I posted does a few of the things with a SD card I've seen questions about here on the forum. It numbers the log files. It writes data as comma delimited ASCII characters that could be read by Excel or other speadsheet programs.
One thing the demo doesn't do that I'd want to add before putting it in the OBEX is to read the ASCII characters from the file and store the numbers to variables that could be manipulated mathematically by the Prop.
The demo does read the file it creates but it just outputs the ASCII characters to the terminal window.
My PropBOE-Bot code that can record the robot's movements does convert ASCII characters to numbers the Prop can use. I'll add this ability to the demo and post it to the OBEX.
@Dave, I agree there are a lot of things people who have been use uCs for a while take for granted. It's often hard for people to remember what it was like when they were first learning about microcontrollers. I hope you've felt welcome to ask questions here on the forum.
@Don, I hope you let us know how those uSD cards work. I've heard of generic cards using memory that doesn't hold up to multiple writes as well as name brand cards. Hopefully these cards work as well and last as long as name brand cards.