Hi,
I came across a strange behavior and maybe you can help me. I want to listen to a SPI bus that sends image data to a dot-matrix-display. It all works well with a nano but I want to do some image manipulation and therefore would like to use the power of a Yun. On the Yun I figured out, that PB0 is SS and therefore desoldered the RX LED and attached a wire to pin 8 of the Controller. MOSI and SCK is available at the ICSP header.
I have this working code for a nano:
#include <SPI.h>
void setup (void)
{
pinMode(MISO, OUTPUT);
// turn on SPI in slave mode
SPCR = _BV(SPE);
// now turn on interrupts and configure settings
SPCR |= _BV(SPIE);
SPCR |= _BV(CPOL);
SPCR |= _BV(CPHA);
}
ISR (SPI_STC_vect)
{
// do something with SPDR
}
But when I use this code on the YUN it does not work properly. First of all, the ISR is never called. Second the Display that is attached to this bus does not show the right content anymore. Something is messing up the levels at the pins. During programming I disconnect the wires.
So my question now is: What else does use the SPI pins on the Yun board besides the Linux when it programs the Controller. Do I have to turn of the GPIO from the Linux side somehow?