Hi, i have a problem with nRF51 an nRF24LU1+. I use S110 and micro-esb library. I can switch beatween poroperty RF and bluetooh ( never run both in the same time ). When I choose property RF for only sending data, everything works very well ( nRF24LU1+ recive all data), but when I want to recive some data form nRF24LU1+ I cant't recive any byte. When I work in property RF I don't use soft device and it's disable.
Here is my micro-esb callback:
void uesb_event_handler()
{
static uint32_t rf_interrupts;
static uint32_t tx_attempts;
// PIN_NEG(LED_GREEN);
uesb_get_clear_interrupts(&rf_interrupts);
if(rf_interrupts & UESB_INT_TX_SUCCESS_MSK)
{
}
if(rf_interrupts & UESB_INT_TX_FAILED_MSK)
{
uesb_flush_tx();
}
if(rf_interrupts & UESB_INT_RX_DR_MSK)
{
uesb_read_rx_payload(&rx_payload);
PIN_NEG(LED_BLUE);
}
uesb_get_tx_attempts(&tx_attempts);
}
and initliazation:
uesb_config_t uesb_config = UESB_DEFAULT_CONFIG;
uesb_config.rf_channel = 1;
uesb_config.crc = UESB_CRC_8BIT;
uesb_config.retransmit_count = 15;
uesb_config.retransmit_delay = 500;
uesb_config.dynamic_ack_enabled = 1;
uesb_config.protocol = UESB_PROTOCOL_ESB_DPL;
uesb_config.bitrate = UESB_BITRATE_2MBPS;
uesb_config.event_handler = uesb_event_handler;
uesb_config.mode = 1;
tx_payload.length = 32;
tx_payload.pipe = 0;
rx_payload.length = 32;
uesb_init(&uesb_config);
uesb_set_address(UESB_ADDRESS_PIPE0, ADDRESS_1);
uesb_set_address(UESB_ADDRESS_PIPE1, ADDRESS_2);
uesb_start_rx();
in nRF24LU1+: function for sending:
static void send_rf_buf()
{
CE_LOW();
hal_nrf_set_operation_mode(HAL_NRF_PTX);
hal_nrf_write_tx_payload_noack(rf_out_buf, 32);
radio_busy = true;
CE_PULSE();
while(radio_busy);
hal_nrf_set_operation_mode(HAL_NRF_PRX);
CE_HIGH();
}
and initizlization:
static void rf_init()
{
// Enable radio SPI and clock
RFCTL = 0x10;
RFCKEN = 1;
// Set payload width to 32 bytes
hal_nrf_set_rx_payload_width((int)HAL_NRF_PIPE0, 32);
hal_nrf_set_rx_payload_width((int)HAL_NRF_PIPE1, 32);
actualize_addr_chan();
hal_nrf_set_address(HAL_NRF_PIPE0, current_address);
hal_nrf_set_address(HAL_NRF_TX, current_address);
// Clear and flush radio state
hal_nrf_get_clear_irq_flags();
hal_nrf_flush_rx();
hal_nrf_flush_tx();
CE_LOW();
packet_received = false;
// Power up radio
// hal_nrf_set_rf_channel(1);
hal_nrf_set_operation_mode(HAL_NRF_PRX);
hal_nrf_set_output_power(HAL_NRF_0DBM);
hal_nrf_set_rf_channel(1);
hal_nrf_set_power_mode(HAL_NRF_PWR_UP);
// Enable RF interrupt
RF = 1;
CE_HIGH();
}