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

nRF24LU and nRF51822 ESB Lib

Hello , RX: nrf24LU Tx: nrf51822 use ESB Lib. But the nrf24 Can't receive data continuous. if I Want receive 2th data , I must power up the nrf24. This is my Code : RFCTL = 0x10; RFCKEN = 1; RF = 1; EA = 1; hal_nrf_set_operation_mode(HAL_NRF_PRX);
hal_nrf_set_rf_channel(Test_Channal);
hal_nrf_set_output_power(HAL_NRF_0DBM);
hal_nrf_close_pipe(HAL_NRF_ALL);
hal_nrf_set_rx_payload_width((int)HAL_NRF_PIPE1, PayLoad_Length); PayLoad_Length as receiver hal_nrf_set_rx_payload_width((int)HAL_NRF_PIPE2, PayLoad_Length);
PayLoad_Length as receiver hal_nrf_set_rx_payload_width((int)HAL_NRF_PIPE3, PayLoad_Length);
PayLoad_Length as receiver hal_nrf_set_rx_payload_width((int)HAL_NRF_PIPE4, PayLoad_Length);
PayLoad_Length as receiver hal_nrf_set_address(HAL_NRF_TX , Rf_pipe_0_address);
transmitter hal_nrf_set_address(HAL_NRF_PIPE1 , Rf_pipe_1_address);
hal_nrf_open_pipe(HAL_NRF_PIPE1 , true);
hal_nrf_open_pipe(HAL_NRF_PIPE2 , true);
hal_nrf_open_pipe(HAL_NRF_PIPE3 , true);
hal_nrf_open_pipe(HAL_NRF_PIPE4 , true);
hal_nrf_set_auto_retr(10,250);
hal_nrf_enable_ack_payload(false);
hal_nrf_enable_dynamic_ack(true);
hal_nrf_setup_dynamic_payload(0x1E);
hal_nrf_enable_dynamic_payload(true);
hal_nrf_set_datarate(HAL_NRF_2MBPS);
hal_nrf_set_crc_mode(HAL_NRF_CRC_16BIT);
hal_nrf_set_power_mode(HAL_NRF_PWR_UP);
CE_HIGH();

==============================THIS IS RF ISR ============================ NRF_ISR() { uint8_t irq_flags; uint8_t Loc_length;

irq_flags = hal_nrf_get_clear_irq_flags(); //hal_nrf_write_ack_payload(0,tx_payload,TX_PAYLOAD_LENGTH); switch(irq_flags&((1<<(uint8_t)HAL_NRF_RX_DR)|
(1<<(uint8_t)HAL_NRF_TX_DS)|
(1<<(uint8_t)HAL_NRF_MAX_RT)) ) { case (1<<(uint8_t)HAL_NRF_RX_DR): Loc_length = hal_nrf_read_rx_payload_width(); if(Loc_length <= 32) { LED_1_On; while(!hal_nrf_rx_fifo_empty()) { hal_nrf_read_rx_payload(Glb_Rf_Desc.Payload); } Glb_Rf_Desc.Rf_Link_Lay_State.Rf_Link_Lay_State_val_Bit.Phy_Layer_updata = 1; } else { /** FIFO May be Flush ! **/ } break; case (1<<(uint8_t)HAL_NRF_TX_DS): break; case (1<<(uint8_t)HAL_NRF_MAX_RT): break; default:

}

}

  • Hi, I guess you have already taken a look at our nAN24-12 Software examples using ShockBurst modes in nRF24L01 and nRF24LU1 application note.

    Please also check you follow our description in the datasheet:

    • The RX_DR IRQ is asserted by a new packet arrival event. The procedure for handling this interrupt should be:
    1. read payload through SPI,
    2. clear RX_DR IRQ,
    3. read FIFO_STATUS to check if there are more payloads available in RX FIFO,
    4. if there are more data in RX FIFO, repeat from step 1).
    • If dynamic payload length is used, then always check if the packet width reported is 32 bytes or shorter when using the R_RX_PL_WID command before 1) read out payload through SPI. If its width is longer than 32 bytes then the packet contains errors and must be discarded. Discard the packet by using the Flush_RX command.
Related