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

nRF240L01 with STM8L051F3

Hi, I am looking for procedure to make it work nRF240L01? I am getting documents for Arduino but as you know that is not understandable, with Arduino it worked but i don't understood. Now i want to make it work with STM8L051F3. STM8L051F3 is 8 bit ultra low power controller. I am looking for procedure like what steps i have to follow so i can send data to another nRF240L01. Which commands i have to send. I want to transmit data after every 1 sec and then it will go in power down. Receiver will be always in receiver mode.

  • Hi

    There are many guides online showing how to use the nRF24L01/nRF24L01+ with different microcontrollers. Usually the only thing different between different MCU's is how to handle GPIO's, and how to use the SPI interface, but I am sure there are examples showing you how to use the GPIO and SPI of the STM controller.

    One such guide which seems pretty thorough is this one.

    Earlier I also wrote some brief instructions, showing the easiest way to use the nRF24L01+ module with the dynamic payload length feature (allowing you to send packets between 1 and 32 bytes in length, without having to hard code the payload length in the receiver):

    -- PTX --
    
    1) Set the PWR_UP bit in the CONFIG register
    
    2) Set DYNPD to 0x3F
    
    3) Set the EN_DPL bit in the FEATURE register
    
    4) Upload a payload
    
    5) Pulse CE for 10 us
    
    6) Add a delay (1ms+) and repeat from 4)
    
    --PRX--
    
    1) Set the PWR_UP and PRIM_RX bits in the CONFIG register
    
    2) Set DYNPD = 0x3F
    
    3) Set the EN_DPL bit in the FEATURE register
    
    4) Set CE high
    
    5) Wait for the IRQ line to go low
    
    6) Read out the RX payload
    
    7) Repeat from 5) 
    

    For these instructions to make sense you should refer to the nRF24L01+ datasheet as well, in particular chapters 8 and 9.

    Best regards
    Torbjørn

  • Hi, Thanks for procedure. In my case i am looking for FIFO_STATUS for receiver, checking if i am receiving anything. But that 1st bit of FIFO_STATUS is not going low. i.e RX_FIFO hs some data. I am sure that another mode is transmitting.

  • Hi Omi

    Are you saying the state of the FIFO_STATUS register is always 0x11?

    What about the CONFIG and STATUS registers?

    Best regards

  • Thank yo very much for your reply

    I will do exactly as the example you sent an inform results in about 2 days

    I have well tested the SPI comunications , working OK

    ---------------------------------------------------------------

    Level compatibility with 5VuP VCC.

     I have measured  CE  CSN  MOSI  and they are OK about input levels for uP   Vcc = 5V)

    MISO output with 4K7  resistor to +5V  also has complete 0 an 5V range.

    For  IRQ  similar resistor to +5V has no effect. I didn't find this information in data sheet

    If uP has some problem with 3.3V as high level, I can reduce the Vcc supply to about 4V or add a small mosfet transistor as inverter (modifying as needed IRQ polarity definition)

    Regards, Osvaldo

  • Hi Osvaldo

    Sorry for the slow response, I was out in Easter vacation until today. 

    Are you still having issues with this? 

    The nRF24L01+ will only work in the 1.9-3.6V range, and it is important that you keep the supply and the interface signals within this range. 

    If you are unable to use an MCU that supports this level you will need some kind of level shifters on the signals, and a separate regulator for the nRF device to provide the supply voltage. 

    Best regards
    Torbjørn

Related