hi there
i have been trying all day long to create link between two NRF24L01
the TX nrf which sending data gets the ACK of data received at RX (status- TX_DS is set)
the RX nrf seems not to get any of this data, both (status-RX_DR) and (FIFO_STATUS)
shows that no data, has been received
on the RX nrf CE is always set, i do FLUSH_RX every RX FIFO read
on my next step, i made TX continue to send data. on the RX i have only read the status and and the FIFO registers
but still no data received
TODAY TEST
RX NRF register data
RX_PW_P0- data pipe0 status is 5, thats equal to the number of bytes i am sending with the TX NRF
FIFO_status=0x11 no data on both of the FIFO
status=0x0E no data received
TX NRF register data
status=0x2E ACK received from RX
how this is possible??
the TX int is the same as the RX but,
on TX the config_register is set to 0x1F
int code of the RX
void nrf24L01_init(void)
{
_delay_ms(100); //allow radio to reach power down if shut down
uint8_t val[5];
val[0]=0x01;
WriteToNrf(W, EN_AA, val, 1);
//enable auto acknowledge on data pipe0- transmiter gets ack from reciver
val[0]=0x3F;
WriteToNrf(W, SETUP_RETR, val, 1);
//0b0010 00011 "2" sets it up to 1mS delay between every retry
//(at least 500us at 250kbps and if payload >5bytes in 1Mbps, and if payload >15byte in 2Mbps)
// "F" is number of retries (1-15, now 15)
val[0]=0x01;
WriteToNrf(W, EN_RXADDR, val, 1);
//enable data pipe 0
val[0]=0x03;
WriteToNrf(W, SETUP_AW, val, 1);
//RF_Adress width setup set to 5byte RF_Adress
val[0]=0x01;
WriteToNrf(W, RF_CH, val, 1);
//RF channel setup
//RF channel registry 0b0000 0001 = 2,401GHz
//RF setup -
val[0]=0x07;
WriteToNrf(W, RF_SETUP, val, 1);
int i;
for(i=0; i<5; i++)
{
val[i]=0x12; //RF channel registry 0b10101011 x 5 -
}
WriteToNrf(W, RX_ADDR_P0, val, 5);
//RX RF_Adress setup 5 byte
for(i=0; i<5; i++)
{
val[i]=0x12; //RF channel registry 0b10111100 x 5 - skriver samma RF_Adress 5ggr för att få en lätt och säker RF_Adress (samma på Reciverns chip och på RX-RF_Adressen ovan om EN_AA enablats!!!)
}
WriteToNrf(W, TX_ADDR, val, 5);
//TX RF_Adress setup 5 byte
val[0]=dataLen; //=5
WriteToNrf(W, RX_PW_P0, val, 1);
//sets the max byte recived on data pipe0
//RX_POWERUP;
val[0]=0x1F;
WriteToNrf(W, CONFIG, val, 1);
SETBIT(PORTB,CE);
_delay_ms(100);
//sei();
}
read payload on RX
uint8_t receive_payload(uint8_t *data)
{
uint8_t val=0;
CLEARBIT(PORTB,CE);
_delay_us(40);
WriteToNrf(R,R_RX_PAYLOAD,data,dataLen);
_delay_us(40);
WriteToNrf(R, FLUSH_RX, val, 0);
nrf_reset();
_delay_us(40);
SETBIT(PORTB,CE);
}