I think I have found the problem, but I am not sure how to solve it.
I am switching between two chips, one (ADXL312) is CPOL=1 and another (ADS1292) CPOL=0. The problem is, that the switch occurs when the data is transmitted, with SPI.transfer(), rather than when SPI.beginTransaction(settingsSpi) is called. This means that the chip select is pulled low before the clock is returned to low, and then (I believe) the chip takes this switching from CPOL = 1 to CPOL = 0 as a clock pulse, when it is not. I am not sure how to address this.
Is it possible to change the CPOL before or without transmitting any data?
I have attached some images of the data transfer, and the same transfer zoomed in. My code snippet, for reference:
Code:
registerToRead=(registerToRead|0x20);
SPI.beginTransaction(settingsSpi);
delayMicroseconds(5);
digitalWrite(respPinSelect,LOW);
SPI.transfer(registerToRead);
SPI.transfer(B00000000); // One read to one register
dataOut=SPI.transfer(B00000000);
delayMicroseconds(5);
digitalWrite(respPinSelect,HIGH);
SPI.endTransaction();

