This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

CARRIERs SCAN PROCEDURE With nRF24L01+

Dear Sr.,

Can't detect carrier

They are two PCB one TX Carrier and other mush Detect the carrier
--------------------------------------------------------------------------------------------------------------------------
PCB1 TX CARRIER AT Channel 2.410 Ghz (Without data). This module generate only carrier for detecting for PCB2
PCB1 SW:
5 mS
CE=0
wSPI,#00100000b ;WR CONFIG Register SELECT
wSPI,#00001010b ;EN_CRC bit3 Set=1,PWR_UP bit1 Set=1,Set as PTX bit0=0
5 mS
wSPI,#00100101b ;WR RF_CH Register SELECT
wSPI,#10 ;Channel 2.410Ghz
5 mS
wSPI,#00100110b ;WR RF_SETUP Register SELECT
wSPI,#10001110b ;Continous Carrier Tx, 2Mbis/s, 0dBm Tx
CE=1
HALT
This SW run the carrier is OK
--------------------------------------------------------------------------------------------------------------------------
PCB2 RX CARRIER AT Channel 2.410 Ghz. This module mush detect carrier from PCB
PCB2 SW:
1 munute after PCB1 power on
5 mS
CE=0
wSPI,#00100000b ;WR CONFIG Register SELECT
wSPI,#00001011b ;EN_CRC bit3 Set=1,PWR_UP bit1 Set=1,PRX bit0 Set=1
5 mS
wSPI,#00100101b ;WR RF_CH Register SELECT
wSPI,#10 ;Channel 2.410Ghz
5 mS

CE1:

CE=1
5 mS
CE=0
wSPI,#00001001b ;RD RPD Register SELECT
rSPI,RD STATUS ;RD STATUS
rSPI,RPD ;Lee RPD

All Time Bit0=0 ;For Carrier Detec mush be =1
GOTO CE1
This SW don't detect the carrier
--------------------------------------------------------------------------------------------------------------------------

What I do wrong ?

Thank

  • Thanks Hakon for your support,
    but need understand as this RPD bit is detected as one easy secuence or flowchart mode.
    I work in assembler and don't understand well C, but I had found one C secuence than is possible can run, if you can explain it terms as I explain at the top of this Nordic Case Info.

    Thanks,
    LPO

    -----------------------------------------
    The source code I found is:
    -----------------------------------------
    #define CE 9

    #define CHANNELS 64 // Define as array to hold channel data
    int channel[CHANNELS];


    #define _NRF24_CONFIG 0x00 // Registers 0x00
    #define _NRF24_EN_AA 0x01 // Registers 0x01
    #define _NRF24_RF_CH 0x05 // Registers 0x05
    #define _NRF24_RF_SETUP 0x06 // Registers 0x06
    #define _NRF24_RPD 0x09 // Registers 0x09

    // Get the value of the NRF25L01 Registers
    byte getRegister(byte r)
    {
    byte c;
    PORTB &=~_BV(2);
    c = SPI.transfer(r&0x1F);
    c = SPI.transfer(0);
    PORTB |= _BV(2);

    return(c);
    }

    // set the value of a nRF24L01p register
    void setRegister(byte r, byte v)
    {
    PORTB &=~_BV(2);
    SPI.transfer((r&0x1F)|0x20);
    SPI.transfer(v);
    PORTB |= _BV(2);
    }


    void powerUp(void) // power up the nRF24L01p chip
    {
    setRegister(_NRF24_CONFIG,getRegister(_NRF24_CONFIG)|0x02);
    delayMicroseconds(130);
    }

    // switch nRF24L01p off
    void powerDown(void)
    {
    setRegister(_NRF24_CONFIG,getRegister(_NRF24_CONFIG)&~0x02);
    }

    void enable(void) //Activate RX
    {
    PORTB |= _BV(1);
    }

    void disable(void) //Deactivate RX
    {
    PORTB &=~_BV(1);
    }

    // setup RX-Mode of nRF24L01p
    void setRX(void)
    {
    setRegister(_NRF24_CONFIG,getRegister(_NRF24_CONFIG)|0x01);
    enable();

    // this is slightly shorter than
    // the recommended delay of 130 usec

    delayMicroseconds(100);
    }

    //SCANNING ALL CHANNELS IN 2.4GHz Band

    void scanChannels(void)
    {
    disable();
    for( int j=0 ; j<200 ; j++)
    {
    for( int i=0 ; i<CHANNELS ; i++)
    {
    // select a new channel
    setRegister(_NRF24_RF_CH,(128*i)/CHANNELS);

    // switch on RX
    setRX();

    // wait enough for RX-things to settle
    delayMicroseconds(40);

    // this is actually the point where the RPD-flag
    // is set, when CE goes low
    disable();

    // read out RPD flag; set to 1 if
    // received power > -64dBm
    if( getRegister(_NRF24_RPD)>0 ) channel[i]++;
    }
    }
    }

  • Hi,

     

    Thanks for the example code.

    You need to wait atleast 130 us (Ramp-up time) before reading the RPD bit, and I would also recommend reading this prior to disabling the RX. Could you try this and see if you get the expected result?

    Best regards,

    Håkon

Related