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
  • Thank you for your reply

    A wished to have at first some rf link working

    I make a litle more advance and added ACKand ACK + payload and it is also working

    At the end there is list of wht I had modifyed and added.

    Now I will begin with the complete system programms.

    Please comment about the following matters:

    - 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

    - 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

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

    The RS485 cable rate is 57600K and not too busy,  so with 250K and a processor (with buffers)  in the Rf to 485 conversion I estimated they will be no a rate problem.

    - 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 ?

    Best Regards, Osvaldo

    -------------------- added/ modified  for  test  with ack_payload ----------------------------------

    PTX

    CONFIG   01011010    (CRC enabled, 1 byte)

    FEATURE    00000111

    Data upload with command 0xA0

    wait 1ms and read Rx FIFO for payload received with ack

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

    PRX

    CONFIG   01011011

    FEATURE    00000111

    At the end but inside of  rx_wait  loop
    Data upload with  command   10101000 (pipe number 0) for ack payload
    data value selected by a switch
    data = 0  if   PORTA,1 tied to Vcc
    data =  1111111  if   PORTA,1 tied to GND

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

Reply
  • Thank you for your reply

    A wished to have at first some rf link working

    I make a litle more advance and added ACKand ACK + payload and it is also working

    At the end there is list of wht I had modifyed and added.

    Now I will begin with the complete system programms.

    Please comment about the following matters:

    - 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

    - 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

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

    The RS485 cable rate is 57600K and not too busy,  so with 250K and a processor (with buffers)  in the Rf to 485 conversion I estimated they will be no a rate problem.

    - 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 ?

    Best Regards, Osvaldo

    -------------------- added/ modified  for  test  with ack_payload ----------------------------------

    PTX

    CONFIG   01011010    (CRC enabled, 1 byte)

    FEATURE    00000111

    Data upload with command 0xA0

    wait 1ms and read Rx FIFO for payload received with ack

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

    PRX

    CONFIG   01011011

    FEATURE    00000111

    At the end but inside of  rx_wait  loop
    Data upload with  command   10101000 (pipe number 0) for ack payload
    data value selected by a switch
    data = 0  if   PORTA,1 tied to Vcc
    data =  1111111  if   PORTA,1 tied to GND

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

Children
No Data
Related