Using NRF24L01+ with pure assembler programing

Dear people

I have connected NRF24!01+ with PIC16F1826 for use as PRX and have also another similar for PRX

For an initial test I tryed to trasmit a closed / open switch state to a LED and as ussually hapens it does not work

Also I have a Tx packets each 200ms with one Data byte incremented in each Tx
I get SPI write an read ok but at PRX have not getting any received packet

There is the same program for PTX an PRX with  #define    PRX  o rnot at compiling so most of defined values are the same

What I get reading with SPI : in PRX , Reg 0x17 FIFO_STATUS  bit4 TX_EMPTY:
 is 1 before loading data
0 after loading payload   (4 bytes)
1 after CE goes H

At PRX side  not IRQ arises , not changes in Reg 07 bit RX_DR

I only use assembler programming and I didn´t found in the web any complete and working assembler example.

--> I am asking please the simplest example with a detailed list of commands to send for configuring and useing TPX
and PRX, similar at Appendix B, pag 77 in NRF24L01+ data sheet.

*** But please include the waiting delays and other instructions that may be  needed ***

For some address, default values may be used in a first test ? ( only 1 Pipe )

Is it posible not  using CRC ?

I need to have something working before going to a complete use of full NRF24L01+ capabilities

Finally I will insert well tested software in bigger assembler programs

I like to  replace a RS485 conexion with this RF link

I will1452.Control_NRF.rar send the assembler that I am testing if somebody like to see it, but RF part is not working

Waiting some help, Best Regards, Osvaldo Hojvat

  • Hi 

    o.hojvat said:

    - I guess dynamic payload  also applies to the ack payload length,

    and the Tx FIFO need to be loaded before receiving the packet    Please confirm

    Yes and yes. The ACK payload can be any length between 1 and 32 bytes, and you need to upload the ACK payload before you receive the packet from the PTX, otherwise it will not be included until the next packet arrives. 

    o.hojvat said:

    - If there are Tx from two PTX devices at the same time, I guess no one will be received OK

    I think it may be needed to use diferent ARD in each PTX for avoiding the same problem in the retry

    In case of packet collisions you will most likely lose both packets, yes, but if one of the packets have a higher signal strength than the other there is a chance you will receive it correctly. 

    It is correct that configuring a different ARD in different PTX's can help reduce interference between them, since they will not retransmit lost packets at the same time. 

    o.hojvat said:
    -  I need in a big room a 15m secure link ,  Is it convenient to use 250 Kb rate or 1 Mb rate is OK ?

    You should be able to reach 15m in 1M mode, as long as you don't have a lot of things blocking the signal (such as people, walls or heavy furniture). 

    The actual transfer rate is considerably lower than the PHY rate, so using 1M mode would be beneficial in ensuring you can reach 57k of actual throughput even if you have some packet loss and need to retransmit some of the packets. 

    o.hojvat said:
    - At the RX unit, as it will have a power supply cable I can use a board with amplifier and external antena if it is necessary or the simplest available board may be OK ?

    You should be fine without this, but it depends on the environment. If there is a lot of interference in the area from WiFi, Bluetooth etc then you might benefit from having a FEM (front end module) on the receiver, but using a FEM device  only on one side of the link is obviously not as efficient as having a FEM device both in the PTX and PRX. 

    Whatever you end up doing it is important that you run testing in an environment as realistic as possible, to see how well your implementation works in practice. 

    Best regards
    Torbjørn

  • Hi

    I have a sample and the RFmodule with antena has a LNA and a RFX2401C power amplifier, so the simple modules used as PTX will receive a better signal.

    I will try to attach some regarding  information

    Anyway I need to have the complete sistem working for a realistic test.

    Normal user may have one or two handheld controllers with RF link and the PRx may be placed in the middle of the room.

    By the moment I will beguin  working  to include the RF part in the actual handheld  program and also the new program for the PRX interfase board.

    I can send to you the updated information of my work by private mensage or email if it is posible

    Best Regards

    2275.Modulo Rf Arduino Nrf24l01 + Transceptor Armodlnrf24l01+ - $ 45,00 en Mercado Libre.pdf

  • Hi Osvaldo

    I made this case private, so that you can share documents with Nordic support directly without everything being available publicly. 

    Please note that I am not able to validate your entire project. If you have issues with the Nordic chip, or have questions about the Nordic hardware/software, I will do my best to help, but the rest is up to you Wink

    Best regards
    Torbjørn

  • I undestand well tis matter.

     I will ask about some to specific questions that may be not usefull for other people , I guess it will better to no use the forum.

    Anyway yo can go back this  to public tickets if consider there may be usefull for other peoples.

    I will begin with one order from one PTX to the PRX inside the handheld unit program but I am thinking in advance for posible problems with other orders received at central unit 

    Basically a handheld must have updated information before sending an order.

    So at the moment I find 3 aproach: 

    1) Using the proposed star 1PRX to up to 6 PTX, as in data sheet

    In this case the PRX does not knows which PTX will send the next packet and can not upload the regarding information in ack payload. The PTX may repeat the Tx in a very short time to  get it.

    2)  each PTX can use a diferent  frequency channel and the PRX may be receiving about 20 ms at one freq. and if there is no received packet, PRX  moves to other diferent freq.   not adyacent channel).

    Please answer if there are posible interference for 2  PTX trasmiting at the same time but diferent frequency.

    3) One PTX and up to 6 PRX devices (one in each handheld).  Disadvantage may be Increased battery consumption.  Most probabely RFmay be OFF most of  the time

    As I am using with RS485 cable , PTX sends a short packet for each PRX  and wait a short time for a reply.   If not, It moves to other PRX address

    Best Regards

Related