SPI limitations

The chip I want to talk to talks in 16bit SPI words. The arduino Mega 2560 doesn't state the word size, but the data sheet for the chips says it is 8 bit SPI. Is the chip 8 bit SPI because it is an 8 bit processor?

If the word size is a multiple of 8 you can just send multiple bytes. You cannot use the hardware SPI for sending 11 bit words but 16 bits should not be a problem. You just have to take care that the two bytes are in the right order.

In cases where odd sizes are needed you can omit the hardware SPI and implement the protocol in software. It's not as fast as the hardware version (of course) but fast enough for most situations.

For odd word size, often times you can send leading bits that are just shifted thru the receiving device & ignored, the last bits in being the bits that are saved when chip select goes high.

Is the chip 8 bit SPI because it is an 8 bit processor?

No, there are ways around that, for example you have 16-bit timers. This was just a design decision by Atmel.


Rob

thanks for the info. So i can send 2 8bit SPI bytes without skipping a clock?

Yes, typically:

digitalWrite(your_device_SS, LOW);
SPI.transfer(byte1);
SPI.transfer(byte2);
digitalWrite(your_device_SS, HIGH);