Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

SD Card Shield


  • Please log in to reply
10 replies to this topic

#1 amphibian

amphibian

    Member

  • Members
  • PipPip
  • 16 posts

Posted 23 August 2010 - 03:17 AM

I got my Netduino last week and have been playing around with it while reading through "Expert .Net Micro Framework". I'm an experienced .Net developer but very new to MF and embedded systems in general.

I got the SD Card Shield from MakerShed and I'm just trying to do some simple file IO.

When I try to enumerate volumes and file systems from Microsoft.SPOT.IO it doesn't find anything. I'm assuming this is because Netduino is missing a driver. I started looking at the Arduino Fat code to see about porting it, but I'm really not sure where to start. Honestly I'm not even sure how this shield works, the documentation for it leaves quite a bit to be desired. "You can select 3.3V or IO port power supply with the switch on board in order to work with different library."

Can anyone point me in the direction of some good resources? Am I just making this too hard (hopefully)?

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 23 August 2010 - 03:28 AM

Hi amphibian, Welcome to the community! We've baked SD support into the Netduino firmware, and will be exposing a set of methods to mount your card in the upcoming v4.1.1 release. The beta is scheduled for ~2 weeks, and the 4.1.1 release just a few weeks later. You'll simply use the System.IO functions to list the directory, open and read files, etc. The SD card will be mounted as "\SD1\" In the meantime, could you please double-check and verify that your SD card reader board is 3.3V compatible (so you can get started right away when the new firmware comes out)? The Adafruit DataLogger shield and Adafruit MicroSD card expansion board both work great with 3.3V and 5V microcontrollers for sure. A few SD card reader boards are 5V only. Chris

#3 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 23 August 2010 - 03:32 AM

You are correct, you need a driver to use that as a PersistentStorage object. Coding and rolling a custom version of NETMF is probably going to be a little difficult for someone new to NETMF, so you may want to see if there are any current drivers around, although I don't think there are (for the Netduino). :)

Now, that said, you could try to port the Arduino's driver code over to NETMF. That would be a lot easier, but I don't think you will be able to use it with NETMF's native storage options.


EDIT: Dang, you beat me to it, Chris :)

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 23 August 2010 - 03:36 AM

EDIT: Dang, you beat me to it, Chris :)


Phew, finally... :)

Actually, peer support is fantastic. I'll slow down if I need to... Much appreciated!

#5 amphibian

amphibian

    Member

  • Members
  • PipPip
  • 16 posts

Posted 23 August 2010 - 04:06 AM

Wow, thanks for the quick response.

It sounds like I'd better just chill out and wait for the experts.

As for if it's 3.3/5v I'm not really sure. Like I said the documentation is somewhat lacking. There is a switch on it which says I can select 3.3 or IO port power, so it sounds like it's 3.3. The io port it's talking about is pin 9 so it looks like it's a PWM device? (Haven't gotten that far in the book yet:) )

#6 amphibian

amphibian

    Member

  • Members
  • PipPip
  • 16 posts

Posted 23 August 2010 - 03:33 PM

Nevermind I think I understand what they're saying now. You can power it either by the 3.3 (on if the netduino is on) or by turning on the GPIO on Pin 9. The communication is done via serial then right?

#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 23 August 2010 - 03:37 PM

Nevermind I think I understand what they're saying now. You can power it either by the 3.3 (on if the netduino is on) or by turning on the GPIO on Pin 9. The communication is done via serial then right?


Yes. The communication is done via SPI (pins D11-D13, and one of the other pins as a "chip select"). It's a serial interface very similar to a serial port (UART) but instead of having a baud rate the Netduino's clock line "clocks" out the communication with the SD card.

Most SD cards support "SPI mode"--which is what you'll be using. I'd stick with <=2GB cards for the time being.

Chris

#8 amphibian

amphibian

    Member

  • Members
  • PipPip
  • 16 posts

Posted 23 August 2010 - 03:58 PM

Duh, I was counting pins the wrong direction. For some reason I was thinking it wasn't plugging into 11-13 (so I didn't think it was spi). Thanks for the clarification. I'm starting to get the hang of this.

#9 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 02 September 2010 - 06:21 PM

We've added SD card support to the Netduino firmware and are sharing an early build over in the beta forum: http://forums.netdui...e-v411-alpha-1/ If you have a chance to test this with the shield you got from MakerSHED, that would be fantastic. If it doesn't use pin D10 for the SD card's chip select, let me know...we'll have an updated built which enables other chip select options in the next week or so. Chris

#10 amphibian

amphibian

    Member

  • Members
  • PipPip
  • 16 posts

Posted 02 September 2010 - 06:37 PM

Awesome, I will try it out tonight and post the results. Based on the arduino code that's availible for it D10 should be the right pin for chip select.

#11 amphibian

amphibian

    Member

  • Members
  • PipPip
  • 16 posts

Posted 03 September 2010 - 03:29 AM

I posted in the other thread, but I might as well post here too in case someone comes across it. The seeedstudio sd card shield works fine with the new firmware




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.