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

the communication of nRF51822 and nRF24l01P

Hi, I want to use the nrf51822 to communicate withe the old module of 24l01p, in the module of 24l01p, the Address is addrofch[0] = 0xe7; addrofch[1] = 0x7e; addrofch[2] = 0xe3; addrofch[3] = 0x0; addrofch[4] = 0x0; the power is 0db, the rate is 1M,and the length of data is 8,and the crc is two bytes. the frequncy is 9. In the 51822 the radio I configure: NRF_RADIO->TXPOWER = (RADIO_TXPOWER_TXPOWER_0dBm << RADIO_TXPOWER_TXPOWER_Pos); NRF_RADIO->FREQUENCY = 9UL; // Frequency bin 9, 2409MHz NRF_RADIO->MODE = (RADIO_MODE_MODE_Nrf_1Mbit << RADIO_MODE_MODE_Pos); NRF_RADIO->PREFIX0= 0xe7UL; NRF_RADIO->BASE0 =0x7ee30000UL;
NRF_RADIO->TXADDRESS = 0x00UL; // Set device address 0 to use when transmitting NRF_RADIO->RXADDRESSES = 0x01UL;

NRF_RADIO->PCNF0 = (PACKET_S1_FIELD_SIZE << RADIO_PCNF0_S1LEN_Pos) | (PACKET_S0_FIELD_SIZE << RADIO_PCNF0_S0LEN_Pos) | (PACKET_LENGTH_FIELD_SIZE << RADIO_PCNF0_LFLEN_Pos); NRF_RADIO->PCNF1 = (RADIO_PCNF1_WHITEEN_Disabled << RADIO_PCNF1_WHITEEN_Pos) | (RADIO_PCNF1_ENDIAN_Big << RADIO_PCNF1_ENDIAN_Pos) | (PACKET_BASE_ADDRESS_LENGTH << RADIO_PCNF1_BALEN_Pos) | (PACKET_STATIC_LENGTH << RADIO_PCNF1_STATLEN_Pos) | (PACKET_PAYLOAD_MAXSIZE << RADIO_PCNF1_MAXLEN_Pos); // CRC Config NRF_RADIO->CRCCNF = (RADIO_CRCCNF_LEN_Two << RADIO_CRCCNF_LEN_Pos); if ((NRF_RADIO->CRCCNF & RADIO_CRCCNF_LEN_Msk) == (RADIO_CRCCNF_LEN_Two << RADIO_CRCCNF_LEN_Pos)) { NRF_RADIO->CRCINIT = 0xFFFFUL; // Initial value
NRF_RADIO->CRCPOLY = 0x11021UL; // CRC poly: x^16+x^12^x^5+1 } but I have tried many times,but they cann't communicate,please tell me why. thank you .

  • Hi, Thank you for your reply. I configrue the address as your advice,the 51822 can receive data and the data can get through the PC by the UART. However,I have another confusion. In the 51822 radio- RX ,I configure as follows: if (NRF_RADIO->CRCSTATUS == 1U) { nrf_gpio_pin_set(10); for(i=0;i<8;i++) { rbuf[i]=packet[i]; } simple_uart_putstring(rbuf); } In this case,the CRCSTATUS==0 all the time,I receive the data by this: while(NRF_RADIO->EVENTS_DISABLED == 0U) { } for(i=0;i<8;i++) { rbuf[i]=packet[i]; } simple_uart_putstring(rbuf); nrf_delay_ms(10); } please help me to find is there any mistakes in my code? In my understanding, if the two devices can communicate, the CRCSTATUS==1 is right. If the CRCSTATUS is 0, is there any mistakes? please give me an explanation,thank you! why there is data in the packet,however, the CRCSTATUS is 0 all the time?

Related