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 Osvaldo

    I am glad I could help. The best of luck with your project Slight smile

    Best regards
    Torbjørn

  • Hi  Torbjørn

    I am still working in the proyect

    As I had explained before , I will have 1 PRX several PTX

    At the PRX with 485 comunication with a central unit, I do some decoding for the Usart incoming packet.

    The 9 bites signals from central to the PTX will be reduced to 8 bites to be handled by the NRF

    I have indentified for which PTX  will be the packet sent a there in a separated buffer for each one

    My actual question is that some types of packets will be send to every PTX.

    I need to copy the same packet information to the 6 buffers

    --> Are some property of PIPE 6 the can be used for simplify this matter ?

    I can limit the number of PTX to 5 if it helps.

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

    I have an idea for sincronizing the PTX trasmitions in order to avoid colitions.

    I will do it later, but this may be usefull:

    PRX will have a internal "clock"  by example a register counting free 0 to 255.

    Each PTX  keeps a similar counter that will be sincronized al any comunication with PRX

    Each PTX will have al time gate for allowed a  TX/RX  to RX  Probabely 10 to 20ms

    May be some some time gates intercalated for URGENT information

    Except for an initial short time, will be not two TX at the same time

    Best Regards, Osvaldo

  • Hi Osvaldo

    o.hojvat said:

    My actual question is that some types of packets will be send to every PTX.

    I need to copy the same packet information to the 6 buffers

    --> Are some property of PIPE 6 the can be used for simplify this matter ?

    There is no simpler way to do this, no. You need to upload a unique payload for each PTX, since you don't know when each PTX will transmit, and there is no mechanism in the ESB protocol for sharing one payload with multiple pipes. 

    o.hojvat said:
    I have an idea for sincronizing the PTX trasmitions in order to avoid colitions.

    There are many ways to synchronize devices, which way to do choose depends on the application requirements. 

    One trick is to use a dedicated frequency for each PTX, and have the PRX cycle through each frequency in turn. The advantage of this method is that the PRX's won't be able to interfere with each other since they are not on the same frequency, but it does make things a bit more complicated on the PRX side. 

    If you manage to synchronize all the PTX's in time this is also possible, then there is no need to change frequency, but it makes things a bit more complex on the PTX side. 

    Best regards
    Torbjørn

  • Thank you for your reply

    I had similar ideas and If my timed sync works I will use only 1 frec. channel

    There are a max. of 3 ack payload that may be for same of diferen PIPES

    I will load the information for PIPES 1 - 1 - 2 at first

    Where is the information of TX FIFO full and empty available in the PRX?

    Is the same as the TX FIFO in PRT?  I did not found it clearly stated in the data sheet.

    By the moment I will try useing 3 PTX, later I will do the PTX sinr. and add more channels

    I guess the PRX program is complete (partially tested) butI I will need to have also one PRT working for testing all.

    Best Regards, Osvaldo

  • amistake, sorry:  I wanted to said:

    I will load the information for PIPES 0- 1 - 2 at first

Related