hello,will you please tell me which code i have to use in the sdk 12.2.0 for rf communication with nrf51822 and nrf24l01 .and also tell me which settings i have to do for nrf24l01 side as a transmitter.so that i can receive data on nrf51822 side.
hello,will you please tell me which code i have to use in the sdk 12.2.0 for rf communication with nrf51822 and nrf24l01 .and also tell me which settings i have to do for nrf24l01 side as a transmitter.so that i can receive data on nrf51822 side.
Hi Pallavi
The ESB library in the nRF5 SDK v12.2.0 is designed to be backwards compatible with the nRF24L01/nRF24L01+, assuming you don't use the L01 device in legacy Shockburst mode (ACK's disabled).
On the nRF5 side you can use the esb_ptx and esb_prx examples as a starting point: \nRF5_SDK_12.2.0\examples\proprietary_rf\
For this to work you need the following settings on the nRF24L01 side:
Default address (0xE7E7E7E7E7), with 5 byte address length
16-bit CRC
2Mbps bitrate
Auto ACK and dynamic payload length enabled
For all other settings you can use the default values.
Edit: Added attachment.
Best regards
Torbjørn
Hi Pallavi
Could you send me a link to the type of module you are using?
In general I would strongly recommend using the nRF24L01+. The price should be the same, and it comes with some improvements over the nRF24L01 that are useful to have.
With the nRF24L01 you have to run a special command called ACTIVATE to enable the use of features such as dynamic payload length, dynamic ACK, and ACK payload. This command has to be run before you turn on these features (through the DYNPD and FEATURE registers).
Could you try to include the following function in the code I sent you, and call it before you configure the other registers?
void hal_nrf_activate()
{
uint8_t spi_tx_data[2];
uint8_t spi_rx_data[2];
CSN_LOW();
spi_tx_data[0] = 0x50;
spi_tx_data[1] = 0x73;
nrf_drv_spi_transfer(&m_current_l01_instance->spi_instance, spi_tx_data, 2, spi_rx_data, 2);
CSN_HIGH();
}
Best regards
Torbjørn
Hi Pallavi
Could you send me a link to the type of module you are using?
In general I would strongly recommend using the nRF24L01+. The price should be the same, and it comes with some improvements over the nRF24L01 that are useful to have.
With the nRF24L01 you have to run a special command called ACTIVATE to enable the use of features such as dynamic payload length, dynamic ACK, and ACK payload. This command has to be run before you turn on these features (through the DYNPD and FEATURE registers).
Could you try to include the following function in the code I sent you, and call it before you configure the other registers?
void hal_nrf_activate()
{
uint8_t spi_tx_data[2];
uint8_t spi_rx_data[2];
CSN_LOW();
spi_tx_data[0] = 0x50;
spi_tx_data[1] = 0x73;
nrf_drv_spi_transfer(&m_current_l01_instance->spi_instance, spi_tx_data, 2, spi_rx_data, 2);
CSN_HIGH();
}
Best regards
Torbjørn