SPI 16 Bit

Hallo,

ich möchte mit einem Arduino Uno (master) mit einem Controller (slave) über SPI kommunizieren. Das erste Problem ist, dass der slave Datenpakete als 16-Bit erwartet. Wenn ich das richtig sehe, sendet der Arduino nur 8-Bit mittels SPI.transfer und selbst über SPI.transfer16 (entspricht zweimal SPI.transfer).

Im Handbuch heißt es "The CS-signal divides the command packet into 16-bit data words. The CS-signal becomes low while a 16-bit data word is transferred. With the rising edge of CS the controller internally saves the last 16-bit data word."

Gibt es da irgendeine Möglichkeit, dass ich mein Vorhaben umsetzen kann?

Falls weitere Informationen nötig sind, steht im sehr knapp gehaltenen Handbuch noch:

"SCLK: Serial Data Clock from Host
The serial clock is active only while data bits are transferred. The reason for this is that some devices do not have enable inputs for the serial clock."

"DCLK: Data Output Clock
The PI-controller returns the SCLK as DCLK line (see next figure). The host can use the DCLK line for the reception of the MISO line. With this method the delays caused by the transmission line, the LVDS-divers and receivers can be compensated. For this reason higher data rates are possible with DCLK.
It is possible to run the interface without using the DCLK line. But in this case the delays on the transmission lines and the driver and receiver components become the limiting factor for the transmission rate. For proper data transfer it is therefore recommended to use the DCLK line in every case with data rates higher than 15 MHz."

"Serial Transmission
CS is set low before a new word is transferred and set high when a word transfer is completed.
All bytes of a packet are transferred serially with the highest bit first. The data bits of the MISO line change with the falling edge of SCLK. The data bits of the MOSI line are latched with the rising edge of SCLK. The SCLK line is active only while data bits are transferred."

Hallo,

du kannst ohne Probleme mehrere Bytes hintereinander übertragen bzw. lesen. Du legst mit CS fest wann der Slave angesprochen wird und wann nicht. Das macht nicht die Transfer Funktion. Hardware SPI nimmt dir viel ab. Anschaulicher zum Verständnis ginge das auch per Software SPI, wo man selbst jedes Datenbit samt Takt rausschickt bzw. einlesen würde.

Wenn ich das richtig sehe, sendet der Arduino nur 8-Bit mittels SPI.transfer und selbst über SPI.transfer16 (entspricht zweimal SPI.transfer).

Und, wo ist das Problem?

2 mal 8 Bit sind 16 Bit.
Und damit ist deine Anforderung vollkommen erfüllt.