Skip to content

Commit 7214b0d

Browse files
authored
RF24: Add delay after power-up (#1193)
1 parent 966c5d7 commit 7214b0d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/RF24/RF24.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ LOCAL void RF24_standBy(void)
295295
RF24_DEBUG(PSTR("RF24:SBY\n")); // put radio to standby
296296
RF24_ce(LOW);
297297
RF24_setRFConfiguration(RF24_CONFIGURATION | _BV(RF24_PWR_UP));
298+
// There must be a delay of up to 4.5ms after the nRF24L01+ leaves power down mode before the CE is set high.
299+
delayMicroseconds(4500);
298300
}
299301

300302

@@ -421,7 +423,6 @@ LOCAL int16_t RF24_getSendingRSSI(void)
421423
LOCAL void RF24_enableConstantCarrierWave(void)
422424
{
423425
RF24_standBy();
424-
delayMicroseconds(1500);
425426
RF24_setRFSetup(RF24_RF_SETUP | _BV(RF24_CONT_WAVE) | _BV(RF24_PLL_LOCK) );
426427
RF24_ce(HIGH);
427428
}
@@ -522,10 +523,8 @@ LOCAL bool RF24_initialize(void)
522523
// attach interrupt
523524
attachInterrupt(digitalPinToInterrupt(MY_RF24_IRQ_PIN), RF24_irqHandler, FALLING);
524525
#endif
525-
// CRC and power up
526-
RF24_setRFConfiguration(RF24_CONFIGURATION | _BV(RF24_PWR_UP)) ;
527-
// settle >2ms
528-
delay(5);
526+
// power up and standby
527+
RF24_standBy();
529528
// set address width
530529
RF24_setAddressWidth(MY_RF24_ADDR_WIDTH);
531530
// auto retransmit delay 1500us, auto retransmit count 15

0 commit comments

Comments
 (0)