Skip to content

Commit

Permalink
Lower default SPI clock speed
Browse files Browse the repository at this point in the history
- Testing with TCP/IP (RF24Ethernet and RF24toTUN) indicates a need for
lower SPI clock rates to reduce errors and/or hangs
  • Loading branch information
TMRh20 committed Dec 1, 2014
1 parent a0c8087 commit 3515538
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RF24.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void RF24::csn(bool mode)
#if ( !defined(RF24_TINY) && !defined (__arm__) && !defined (SOFTSPI)) || defined (CORE_TEENSY)
_SPI.setBitOrder(MSBFIRST);
_SPI.setDataMode(SPI_MODE0);
_SPI.setClockDivider(SPI_CLOCK_DIV2);
_SPI.setClockDivider(SPI_CLOCK_DIV4);
#endif
#endif

Expand Down Expand Up @@ -639,7 +639,7 @@ void RF24::begin(void)

#if defined(__arm__) && ! defined( CORE_TEENSY )
_SPI.begin(csn_pin); // Using the extended SPI features of the DUE
_SPI.setClockDivider(csn_pin, 9); // Set the bus speed to 8.4mhz on Due
_SPI.setClockDivider(csn_pin, 37); // Set the bus speed to 8.4mhz on Due
_SPI.setBitOrder(csn_pin,MSBFIRST); // Set the bit order and mode specific to this device
_SPI.setDataMode(csn_pin,SPI_MODE0);
ce(LOW);
Expand Down

0 comments on commit 3515538

Please sign in to comment.