Hi i have made a some nrf24l01 boards and im having troble with reciving data.
I can read/write all the registers of the nrf and the txfifo gets cleard if i disable autoack.
i have tested on a distance of less than 5mm but i still cant se any incoming packets in the statusregister on the reciver.
-------- sender code-----------------------
void NRF24l01_init()
{
unsigned char kaka,kaka2,data[6];
NRF_PORT = (1 << NRF_CS);// | (1 << NRF_CE);
NRF_write_reg(NRF_CONFIG,NRF_CONFIG_DEFAULT_VAL);
NRF_write_reg(NRF_EN_AA,NRF_EN_AA_DEFAULT_VAL);
NRF_write_reg(NRF_EN_RXADDR,NRF_EN_AA_ENAA_P0);
NRF_write_reg(NRF_SETUP_AW,NRF_SETUP_AW_4BYTES);
NRF_write_reg(NRF_SETUP_RETR,NRF_SETUP_RETR_DEFAULT_VAL);
NRF_write_reg(NRF_RF_CH,NRF_RF_CH_DEFAULT_VAL);
NRF_write_reg(NRF_RF_SETUP,NRF_RF_SETUP_DEFAULT_VAL);
data[0]=192;
data[1]=168;
data[2]=0;
data[3]=3;
NRF_write_adr(NRF_RX_ADDR_P0,data,4);
NRF_write_adr(NRF_TX_ADDR,data,4);
NRF_read_adr(NRF_RX_ADDR_P0,data,4);
write_hex_buff(data,4);
NRF_write_reg(NRF_RX_PW_P0,0x02); //2byte
NRF_write_reg(NRF_CONFIG,NRF_CONFIG_EN_CRC | NRF_CONFIG_PWR_UP | NRF_CONFIG_PRIM_RX);
//NRF_write_data(0xa0,data,2);
NRF_PORT |= (1 << NRF_CE);
//DDRD=0x03;
//while( (PIND & (1 << 2) ) == 1);
while(uart_getchar() != 'p')
write_hex_8(NRF_read_reg(NRF_STATUS));
LED_PORT |= (1 << LED3);
}
on the reciver i have just changed to
--------------reciver-------------------------------
NRF_write_reg(NRF_CONFIG,NRF_CONFIG_EN_CRC | NRF_CONFIG_PWR_UP | NRF_CONFIG_PRIM_RX);
NRF_PORT |= (1 << NRF_CE);
while(uart_getchar() != 'p')
write_hex_8(NRF_read_reg(NRF_STATUS));
all the register defs are from brennens code and to not make this post to long
the full code and eagle files can be found @http://www.ing.umu.se/~dizzey/nrf24l01/