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

SPI Slave


  • Please log in to reply
3 replies to this topic

#1 rstofer

rstofer

    New Member

  • Members
  • Pip
  • 2 posts

Posted 12 January 2012 - 01:43 AM

I read in the documentation that SPI is configured as a master only. That's not helpful. What I need is a fast SPI slave that can generate an interrupt on each transaction so I can write a handler to stuff the data into a queue. The code will then extract data from the queue, mangle it up quite a bit and send it to a LaserJet using TCP/IP. How deep into the firmware would I have to get to implement an interrupt driven SPI slave? Is this possible/practical? I have built this application with two other platforms (mbed and LPC2106) so it isn't terribly critical that I get the Netduino Basic to function. It's just that the single board with integrated ethernet is a much simpler platform for others to duplicate. Thanks Richard

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 12 January 2012 - 05:10 PM

Hi rstofer, While .NET Micro Framework only supports SPI Master natively, you could create SPI Slave support in the firmware. It would require digging into the native code side a bit. Not terribly difficult, and we did expose the SPI_SS pin, but I'd only venture there if you are comfortable with C++ and microcontroller code (which it sounds like you're good with). The biggest reason that .NET MF probably doesn't have support for SPI Slave natively is that most SPI slaves seem to need to respond to an incoming request within the same SPI transaction and typically within 1 SPI clock cycle...and .NET MF is not real time. If you're just wanting to send data to the Netduino, that should totally be possible. Chris

#3 rstofer

rstofer

    New Member

  • Members
  • Pip
  • 2 posts

Posted 12 January 2012 - 07:02 PM

Chris, Thanks for the reply. I have been wandering around and stumbled into the code for the AT91SAM7X-EK which has all the basic components and FreeRTOS has implemented uIP for the same platform. My previous LP2106 incantation used uIP and the mbed version used lwIP. What I am currently thinking about is just building the application as native to the hardware and skipping the framework altogether. In this way, the code will be a lot like what I have already done on the other platforms. The Netduino hardware is a LOT cheaper than the Atmel board and the hardware design, from 10,000 feet up, looks quite similar, at least from the ethernet point of view. Thanks again! Richard

#4 skyjumper

skyjumper

    Member

  • Members
  • PipPip
  • 15 posts

Posted 07 July 2012 - 08:02 PM

The biggest reason that .NET MF probably doesn't have support for SPI Slave natively is that most SPI slaves seem to need to respond to an incoming request within the same SPI transaction and typically within 1 SPI clock cycle...and .NET MF is not real time. If you're just wanting to send data to the Netduino, that should totally be possible.


Chris, about the real time constraint, is it possible to write an ISR to handle the incoming data from SPI? Your earlier note seems to imply that the code would have to poll the SPI registers for incoming data. I'm okay with code and micro processors, but I know nothing at all about .NET.




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.