The photo was so blurry it was useless. And most of the wires being the same colour don't help.
Look, with the scope, if you see a certain set of signals going in from one processor in terms of timing, relationship to each other and so on, and it works with one board, then the exact same set
must work with another. The DAC doesn't know what board it is connected to.
You need to identify what is different between what works, and what doesn't. Clock polarity, timing, relationships, gaps between bytes, whatever it is. There must be something.
On the Arduino capture, mode 0, the data pin is going high to idle on the falling edge of the clock. This would result in a 1 at the end of the byte that isn't suppose to be there. Is there some config option to make the data pin idle low? This is the case on the NETMF target.
Ah, there's a good thought. I noticed something similar when trying to do VGA timings. The data line does indeed tend (or always) idle high. I don't think you can change that.
You can "bit bang" the SPI, something I normally try not to do. However I had to do it in another project where I needed two SPI (and also async serial). Here is the code I used:
// bit banged SPI pins
const byte MSPIM_SCK = 4; // port D bit 4
const byte MSPIM_SS = 5; // port D bit 5
const byte BB_MISO = 6; // port D bit 6
const byte BB_MOSI = 7; // port D bit 7
// for fast port access (Atmega328)
#define BB_MISO_PORT PIND
#define BB_MOSI_PORT PORTD
#define BB_SCK_PORT PORTD
const byte BB_SCK_BIT = 4;
const byte BB_MISO_BIT = 6;
const byte BB_MOSI_BIT = 7;
// control speed
const byte BB_DELAY_MICROSECONDS = 4;
// Bit Banged SPI transfer
byte BB_SPITransfer (byte c)
for (bit = 0; bit < 8; bit++)
// write MOSI on falling edge of previous clock
if (c & 0x80)
BB_MOSI_PORT |= _BV (BB_MOSI_BIT);
BB_MOSI_PORT &= ~_BV (BB_MOSI_BIT);
c <<= 1;
// read MISO
c |= (BB_MISO_PORT & _BV (BB_MISO_BIT)) != 0;
// clock high
BB_SCK_PORT |= _BV (BB_SCK_BIT);
// delay between rise and fall of clock
// clock low
BB_SCK_PORT &= ~_BV (BB_SCK_BIT);
} // end of BB_SPITransfer
In your case you might want to set the data bit back to off just before the "return" to make sure it idles low.
Of course, you also need to manually set up the pin modes for all lines (data, clock, ss) and set up your default state for them as you want it to be. eg.
pinMode (MSPIM_SS, OUTPUT);
digitalWrite (MSPIM_SCK, LOW);
pinMode (MSPIM_SCK, OUTPUT);
pinMode (BB_MOSI, OUTPUT);
Note the pins in this example are different from the normal SPI ones (see the comments).