I was just looking over the code out of curiosity and found this in EVE_MCU.cpp:
// --------------------- Chip Select line low ----------------------------------
void MCU_CSlow(void) {
digitalWrite(PIN_CHIPSELECT, LOW); // disable CS#
delayMicroseconds(10);
}
// --------------------- Chip Select line high ---------------------------------
void MCU_CShigh(void) {
digitalWrite(PIN_CHIPSELECT, HIGH); // disable CS#
delayMicroseconds(10);
}
First of all, why is there a 10 microsecond delay after setting CS to low? That is extremely long.
And as long as everything takes when using the Arduino API, a delay should not be required at all.
Second, if for some reason a delay would be required in MCU_CShigh, and I doubt that it is, I would put the delay before setting CS back to high.
But, digitalWrite() takes around 30 to 50 clock-cycles, depending on the Arduino target.
I was just looking over the code out of curiosity and found this in EVE_MCU.cpp:
First of all, why is there a 10 microsecond delay after setting CS to low? That is extremely long.
And as long as everything takes when using the Arduino API, a delay should not be required at all.
Second, if for some reason a delay would be required in MCU_CShigh, and I doubt that it is, I would put the delay before setting CS back to high.
But, digitalWrite() takes around 30 to 50 clock-cycles, depending on the Arduino target.