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

nRF52 receiving data from 24L01 incorrectly

Hi,

I am using a 24L01+(as PTX) communicating with a nrf52832(as PRX).

I can have these two device communicating, where nrf52832 can receive data from 24L01+.

However, the data nrf52832 received is not the exactly same as the data 24L01+ has transmitted. For example, the 24L01+ is transmitting a 3-byte data(e.g. 0x123456) to nRF52832, while the data nRF52832 received is 0x2468AC. As you can see, 0x2468AC = 0x123456 <- 1. However, in another test, the 24L01+ transmitted 0x676767, while the nRF52832 received 0xCECECF.

Any suggestion would be appreciated. 

Best regards!

  • ESB packet format is byte sized. Except data control, just before the payload : It uses 9 bits. One bit more than a byte. Coincidentally you are one bit shifted.

    Problem : It is Softdevice who build the ESB packet. Not the SDK lib. The SDK lib just send 2 complete bytes (payload size as one byte, and packet id + noAck as separed byte, then not 9 bits compliant suggesting a conversion by Softdevice) and payload to Softdevice. With no source code, you can not check or modify Softdevice behavior. The only interact is registers modifications.

    Not a solution, but may helps you.

  • nRF52 using SoftDevice to transmit ESB packet? In the test, I didn't download the SoftDevice to the module. 

    If I should modify the registers, what registers should I need to do with? I look for it at the production specification of nRF52832, but it seems that it has no related registers about ESB, but it does have some about radio.

    Maybe I should modify these radio register, right? I am a little confused.

    Thanks.

  • void TX_Mode(void)
    {														 
        
    
      	SPI1_Write_Buf(SPI_WRITE_REG+TX_ADDR,(uint8_t*)TX_ADDRESS,TX_ADR_WIDTH);    
    	  
      	SPI1_Write_REG(SPI_WRITE_REG+EN_AA,0x00);    
    
      	SPI1_Write_REG(SPI_WRITE_REG+EN_RXADDR,0x00); //0x01  //close--0x00
    
      	SPI1_Write_REG(SPI_WRITE_REG+SETUP_RETR,0x00);//0x1a  //close--0x00
    
      	SPI1_Write_REG(SPI_WRITE_REG+RF_CH,0x49);     //频率,0x00~0x4e    
    
      	SPI1_Write_REG(SPI_WRITE_REG+RF_SETUP,0x08);  //0x26  ---- 250k    //0x0f ----2M   //0x06 ----1M   //B1000-0x08  -18db    //B1110-0x0f  0db 
    
      	SPI1_Write_REG(SPI_WRITE_REG+CONFIG,0x0a);    //0x0e--16crc    //0x0a--8crc
            
    	CE_H;                                  
    }	
    

    24L01+ using Shorkburst but not ESB? How do I know what protocol it is using? As far as I know, it uses ESB as default?

    Thanks

  • Your are true. I am false. ESB does not need Softdevice. It is not Softdevice registers, but CPU registers.

    Nordic proprietary protocols
     Example applications that show how to use Gazell and Enhanced ShockBurst (ESB) proprietary protocols.
     These examples do not require a SoftDevice.
    And it is a good new for me. Because i am in pain with ESB too. And I try to solve an other problem. It means that my problem comes from me, or SDK. Not Softdevice. So i can solve by myself !

    But my remark about packet sizing was correct. With ESB regular packet, you have one bit more than byte sized. While ShockBurst is byte sized. I think the only setting for selecting ESB on nRF24L01 is EN_AA. You disable it on your example. And nrf_esb SDK manage only ESB protocol. Not Shockburst.

    Registers used by ESB SDK are : 

    NRF_RADIO->MODECNF0
    NRF_RADIO->PCNF0
    NRF_RADIO->PCNF1
    NRF_RADIO->BASE0
    NRF_RADIO->BASE1
    NRF_RADIO->PREFIX0
    NRF_RADIO->PREFIX1
    NRF_RADIO->TXPOWER
    NRF_RADIO->MODE
    NRF_RADIO->CRCINIT
    NRF_RADIO->CRCPOLY
    NRF_RADIO->CRCCNF
    NRF_ESB_SYS_TIMER->PRESCALER
    NRF_ESB_SYS_TIMER->BITMODE
    NRF_ESB_SYS_TIMER->SHORTS
    NRF_ESB_SYS_TIMER->TASKS_CLEAR
    NRF_ESB_SYS_TIMER->CC[]
    NRF_ESB_SYS_TIMER->EVENTS_COMPARE[]
    NRF_ESB_SYS_TIMER->TASKS_STOP
    NRF_PPI->CH[].EEP
    NRF_PPI->CH[].TEP
    NRF_PPI->CHENSET
    NRF_RADIO->SHORTS
    NRF_RADIO->INTENSET
    NRF_RADIO->TXADDRESS
    NRF_RADIO->RXADDRESSES
    NRF_RADIO->FREQUENCY
    NRF_RADIO->PACKETPTR
    NRF_RADIO->EVENTS_ADDRESS
    NRF_RADIO->EVENTS_PAYLOAD
    NRF_RADIO->EVENTS_DISABLED
    NRF_RADIO->TASKS_TXEN
    NRF_RADIO->TASKS_RXEN
    NRF_RADIO->PACKETPTR
    .. etc ...

    ... a lot ... Take a look at nRF5_SDK_15.0.0\components\proprietary_rf\esb\nrf_esb.c file. It may helps you.

    I suspect your config, as API config, generate a misconfig (or incompatible with you nRF24L01 setup) config by registers (SDK job). But what register ? I don't know. And i don't know if you can setup a ShockBurst mode by registers (without SDK).

    I will try your setup. Please tell me your TX_ADDRESS, TX_ADR_WIDTH. And I notice you did not setup payload size on nRF24L01 side (PW_P0).

  • I test same config as you. Only address and channel is my own.

    Good news ... I send 0x123456 from nRF24 ... and i receive 0x2468AC to nRF52 !!! Like you. So it is just a SDK register settings problem (or nRF24 incompatible config). Time to lunch. I will make some modifications afternoon.

Related