RF24 / NRF24L01 - Can I set "setPALevel" on the fly ??

I have been using the basic PCB antenna NRF24L01+ devices with the 8 pin header for a lot of testing

I have found a situation where these jiggers put out too much power for my application, but only sometimes (its complex to go into right now)

I have been setting radio.setPALevel(RF24_PA_HIGH); but I believe the HIGH setting is only available on the PA+LNA version

So then I guess it drops back to a default setting,

so for powerLevels we have ...
RF24_PA_MIN = -18dBm, RF24_PA_LOW = -12dBm, RF24_PA_HIGH = -6dBm, RF24_PA_MAX = 0dBm

If I want to swap between two power levels would I need to powerDown the radio first ?
Can I just change it on the fly ?

Does anyone have any other info ?

and the answer is YES !

Snippet....

void loop()
{
  if (millis() - refreshTimer > 5000) {
    radio.powerUp();
    refreshTimer = millis();
    digitalWrite(LED,HIGH);
    delay(100);
    for (x=0; x<3; x++) {
      radio.setPALevel(POWER[x]);    // POWER[0] = RF24_PA_MIN, [1] = LOW, [2] = HIGH
      radio.openWritingPipe(RXTXaddress[0]); 
      payload[1] = x; // just a byte containing the power level
      radio.stopListening();
      radio.write( payload, sizeof(payload) ); 
      radio.startListening();
      
      radio.openWritingPipe(RXTXaddress[1]); 
      radio.stopListening();
      radio.write( payload, sizeof(payload) );
      radio.startListening();
      delay(10);
    }
    radio.powerDown();
    digitalWrite(LED,LOW);
  }
}
2 Likes

Alternate addressing used to communicate with the pingPair example (not important for this example)