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

Parents
  • Hi Osvaldo

    If you want to use the dynamic payload length feature you should not clear the bits in the EN_AA register (reg 1). 

    Instead you can use a feature called "dynamic ACK", that allows you to send packets that will not be acked while still being able to use dynamic payload length. 

    In order to use this feature you need to set bit 0 (EN_DYN_ACK) in the FEATURE register (reg 0x1D). 

    It also important that you enable the DPL bit in the DYNPD register for the pipe that you want to use (bit 0 for pipe 0 and so forth). 

    Then finally you have to use the W_TX_PAYLOAD_NO_ACK command (0xB0) to send the payload rather than the normal W_TX_PAYLOAD command (0xA0). 

    Another advantage of this method is that you can send some packets with ACK and other packets without, in case some packets are more critical than others. 

    Please note that when sending packets without ACK you will not know if the packets are successfully received or not, and you have to expect a certain amount of data loss. 

    Best regards
    Torbjørn

Reply
  • Hi Osvaldo

    If you want to use the dynamic payload length feature you should not clear the bits in the EN_AA register (reg 1). 

    Instead you can use a feature called "dynamic ACK", that allows you to send packets that will not be acked while still being able to use dynamic payload length. 

    In order to use this feature you need to set bit 0 (EN_DYN_ACK) in the FEATURE register (reg 0x1D). 

    It also important that you enable the DPL bit in the DYNPD register for the pipe that you want to use (bit 0 for pipe 0 and so forth). 

    Then finally you have to use the W_TX_PAYLOAD_NO_ACK command (0xB0) to send the payload rather than the normal W_TX_PAYLOAD command (0xA0). 

    Another advantage of this method is that you can send some packets with ACK and other packets without, in case some packets are more critical than others. 

    Please note that when sending packets without ACK you will not know if the packets are successfully received or not, and you have to expect a certain amount of data loss. 

    Best regards
    Torbjørn

Children
No Data
Related