NRF24L01 component problem
Posted: Sat Jun 10, 2017 4:22 pm
Spent several hours trying to get the nrf24l01+ unit working - first with a Arduino nano and then thinking that a power supply issue may be occurring with an FTDI Nero (a clone with a higher spec)
So - with the nano initialise wasn't returning. With the Nero - 0 was always returned.
Taking a peek into the C code generated:
The return value FCR_RETVAL is declared but never actually set - so theoretically any value may be returned but seems to be 0 in practice!
So the 0 return for failure seems to be guaranteed and the success value (non zero) for a correct startup isn't happening....
Anyone else encountered this / has a workaround? (Ignore the 'return' value and assume the nrf24l01 is okay?)
Martin
So - with the nano initialise wasn't returning. With the Nero - 0 was always returned.
Taking a peek into the C code generated:
Code: Select all
MX_UINT16 FCD_0e0f1_nRF24L01__Initialise()
{
//Local variable definitions
MX_UINT16 FCL_TEMP;
MX_UINT16 FCR_RETVAL;
FCP_SET(B, B, 0x1, 0x0, 0);
FCP_SET(B, B, 0x4, 0x2, 1);
FCI_DELAYBYTE_US(40);
FC_CAL_SPI_Master_Init_1();
FCI_DELAYBYTE_US(40);
FCD_0e0f1_nRF24L01__WriteRegister(0x24, 0x4F);
FCD_0e0f1_nRF24L01__WriteRegister(0x26, 0x07);
FCD_0e0f1_nRF24L01__WriteRegister(0x3C, 0x00);
FCD_0e0f1_nRF24L01__WriteRegister(0x27, 0x70);
FCD_0e0f1_nRF24L01__WriteRegister(0x40, 64);
FCD_0e0f1_nRF24L01__FlushRx();
FCD_0e0f1_nRF24L01__FlushTx();
return (FCR_RETVAL);
}So the 0 return for failure seems to be guaranteed and the success value (non zero) for a correct startup isn't happening....
Anyone else encountered this / has a workaround? (Ignore the 'return' value and assume the nrf24l01 is okay?)
Martin