Hi Forum,
i've ran into a problem with configure the nrf24l01. I've disabled all ShockBurst functionality (EN_AA = 0). When putting TX Payload into the Fifo the TX_EMPTY Flag switches from 1 to 0,.. so far so good. Now I want to transmit all the data from the TX FIFO. For that I wake up the chip, put it into TX mode, and then set the CE High. Now I was trying to wait until the TX_EMPTY Flag sets back to one,.. but it wont do that.
What am I missing here?
Since I couldn't find any hint on that problem online, I really hope that you might know the reason for that issue.
Here is my code for Transmitting the Payload:
/**
* TX Payload without adding new
*/
void bsp_nrf24l01_tx_payload()
{
uint8_t status = 0;
// Clear pending TX IRQ
bsp_nrf24l01_clear_irq(IRQ_TX_DS);
// Set nRF to TX Mode
bsp_nrf24l01_set_rxtx(NRF_TX);
HAL_Delay(5);
// WakeUp the Chip
hnrf.CONFIG |= CFG_PWR_UP;
bsp_nrf24l01_write_conf(hnrf.CONFIG, NRF_RADDR_CFG);
HAL_Delay(5);
// Start Transmission with CE Pulse
bsp_nrf24l01_set_ce(1);
// Wait for TX FIFO to be empty
bsp_nrf24l01_read_reg(NRF_RADDR_FIFOSTAT, &status);
while (!(status & FIFOSTATUS_TX_EMPTY)) bsp_nrf24l01_read_reg(NRF_RADDR_FIFOSTAT, &status);
bsp_nrf24l01_set_ce(0);
// Clear TX IRQ
bsp_nrf24l01_clear_irq(IRQ_TX_DS);
// Get back to RX Mode to safe energy
bsp_nrf24l01_set_rxtx(NRF_RX);
}
Thank you in advance!
Kind regards
Tony