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
SPI Slave
Started by rstofer, Jan 12 2012 01:43 AM
3 replies to this topic
#1
Posted 12 January 2012 - 01:43 AM
#2
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
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
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