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.
Netduino SPI as Slave
Started by ColorRed, Dec 07 2011 02:52 PM
6 replies to this topic
#1
Posted 07 December 2011 - 02:52 PM
#2
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
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.
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
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
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
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.
Thank you,
ColorRed.
#6
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
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
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