We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bcdd7ac commit 3e01aacCopy full SHA for 3e01aac
src/MCP2515.cpp
@@ -433,7 +433,13 @@ void MCP2515Class::reset()
433
digitalWrite(_csPin, HIGH);
434
SPI.endTransaction();
435
436
- delayMicroseconds(10);
+ // From the data sheet:
437
+ // The OST keeps the device in a Reset state for 128 OSC1 clock cycles after
438
+ // the occurrence of a Power-on Reset, SPI Reset, after the assertion of the
439
+ // RESET pin, and after a wake-up from Sleep mode. It should be noted that no
440
+ // SPI protocol operations should be attempted until after the OST has
441
+ // expired.
442
+ delayMicroseconds(ceil(128 * 1000000.0 / _clockFrequency));
443
}
444
445
void MCP2515Class::handleInterrupt()
0 commit comments