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

Netduino SPI as Slave


  • Please log in to reply
6 replies to this topic

#1 ColorRed

ColorRed

    New Member

  • Members
  • Pip
  • 4 posts

Posted 07 December 2011 - 02:52 PM

I am a beginner of micro controller area. I have a project I need to set my Netduino as SPI Slave for 2MHz CLK SPI Master. I read from this forum that currently Netduino cannot be set as SPI slave because .NET MF doesn't support it. Does anybody know how to achive it with Netduino? Thank you.

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 07 December 2011 - 08:48 PM

Hi ColorRed, We achieve this in some other projects here at Secret Labs by using the SPI Slave feature in native code (and using FIQ to handle the incoming requests). Since SPI Slave is typically a "request and response...with specific timing needs" hardware feature, it is not supported in NETMF. Chris

#3 ColorRed

ColorRed

    New Member

  • Members
  • Pip
  • 4 posts

Posted 07 December 2011 - 09:10 PM

Chris, May I have any resource how you achieved it? I am totally newbie for Netduino (.NET MicroMF, too )and ARM processor. I used Arduino for few weeks. :D I tried to find a way/resource last couple of days, and I found some ideas I may need to do this with interop. Would you please shed some lights here? Thank you, ColorRed.

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 08 December 2011 - 06:30 AM

Hi ColorRed,

Implementing FIQ-based interrupts and SPI slave in native code is probably a fairly advanced project.

If you're interested, here are some tips. Writing native code can be a great learning experience and lots of fun.

Chris

#5 ColorRed

ColorRed

    New Member

  • Members
  • Pip
  • 4 posts

Posted 08 December 2011 - 03:22 PM

Chris, Thank you for the info. Please correct me if I am wrong. The link reminds me that it is about reading data programatically. But, I read the AT91SAM has H/W support to be set as SPI slave. Do you think the following can be feasible? o external C/C++ codes are created and it supports Master/Slave. It uses ARM H/W SPI setup. o the external C/C++ codes linked with C# (aka interop) and build them as a SPI library. o Netduino uses the SPI library in .NET MF for SPI Slave mode. Please understand me that I researched only a couple of days and I am not very familiar with embedded system. I am a merely Bus. app. developer by using Java. :P Thank you, ColorRed.

#6 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 08 December 2011 - 05:44 PM

Hi ColorRed, You could certainly use SPI Slave from NETMF. However, NETMF is not a real-time OS/runtime so it is generally not suitable for that. If you got a request via SPI slave and a response was expected in a certain amount of time (typically a few nano/microseconds), NETMF wouldn't have even started processing the request by the time that the master was expecting your answer to be clocked out. That said, if all you need to do is receive data via SPI...you could implement SPI slave in native code and then bubble up that data via an event to your NETMF app. Chris

#7 ColorRed

ColorRed

    New Member

  • Members
  • Pip
  • 4 posts

Posted 08 December 2011 - 06:14 PM

Chris, I appreciate your great tips. I bought some of ARM7 programming books. Also, I am practicing interop procedures as described in http://informatix.mi...ls/Interop.aspx B) Yeah.... it is very long way to go and it is certainly huge challenge already. Thank you, ColorRed.




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.