Hi guys I'm sending data from an nexys 4 fpga through an spi to my nRF51 (pca10028) I have the fpga set as the master and I'm able to read data sent to the nRF51 through my tera term when I have my spi.format set to (8,2)... but for some reason when I set the format to (16,2) I'm getting a runtime error. Or at least the (led1,led3) and (led2,led4) are flashing in an alternating pattern which I think is a runtime error. I have my fpga actually set to 16 bits and running on mode 2 as well so I find it odd that it's giving me this error. They also are running at the same frequency as well.
////////// Here's the simple code I have on my Nordic
// Reply to a SPI master as slave
#include "mbed.h"
SPISlave spi(P0_16, P0_15, P0_14, P0_13); // mosi, miso, sclk, ssel
Serial pc(USBTX, USBRX);
int main() {
spi.format(8,2);
spi.frequency(100000);
pc.baud(9600);
spi.reply(0x00); // Prime SPI with first reply
while(1) {
if(spi.receive()) {
int v = spi.read(); // Read byte from master
// v = (v + 1) % 0x100;
spi.reply(v); // Make this the next reply
pc.printf("Received Data = 0x%X\n\r",v);
}
}
}
Has anyone run into something similar?