tecnico.solarboat
Member
If SPI settings are set to SPI_MODE3 clock signal should idle at HIGH but before doing:
and after doing SPI.begin(); being
the clock is idling LOW.
The problem of this behaviour is that the first message is ignored by the slave. After doing
for the first time the clock will start idling at HIGH as expected.
This bug is present at least with the Teensy 3.2 using VSCode and Platformio but I think this may be related to the Arduino SPI library itself since the function void SPIClass::begin() in the Arduino SPI library only does pinMode(SCK, OUTPUT); which by default sets the SCK pin LOW. This function should take into consideration the SPI_MODE that the user whats to operate in.
Code:
SPI.beginTransaction(LTC6811_SPI_config);
and after doing SPI.begin(); being
Code:
LTC6811_SPI_config = SPISettings LTC6811_SPI_config(SPISettings(500000, MSBFIRST, SPI_MODE3));
the clock is idling LOW.
The problem of this behaviour is that the first message is ignored by the slave. After doing
Code:
SPI.beginTransaction(LTC6811_SPI_config);
This bug is present at least with the Teensy 3.2 using VSCode and Platformio but I think this may be related to the Arduino SPI library itself since the function void SPIClass::begin() in the Arduino SPI library only does pinMode(SCK, OUTPUT); which by default sets the SCK pin LOW. This function should take into consideration the SPI_MODE that the user whats to operate in.