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

PTX

Hello Nordic,

I try to establish communication between an ATmega328 based board an an Arduino Nano, so far without success. The goal is to improve a RF433 "Wire". 3 weeks ago, I started the project, but for 1 week, I do not make any progress. Please have a look to the attached pdf. Obviously I tried different settings, but probably not the right one! I spent time on internet, but didn't find how to fix.

Hope you can help, thank you anyway for your time.

JacquesNrf24L01+.pdf

Parents
  • Hello Kenneth, thank you for your answer. I am stuck on the basic PTX config for a while now. It is why I decided the send this SOS.

    Here is my pretty simple assembler code :

    PTXs:
    		cbi		PORTD, CE			; CE pin Low
    		sts		TXBuff, Centmilli	; change Payload 4th byte (4 byte long payload stored in TXBuff)
    		rcall	PwrUPTX				; clr bit 0 in CONFIG reg + interrupt masks + crc 16 ; ends with 2msec delay
    		rcall	AdrPipPTX			; write "2Node" in TX-ADDR ($10 reg) and RX_ADDR_P0 ($0A Reg) for ack  MSbit of LSByte first
    
    		ldi		Temp0, $7			; STATUS
    		rcall	AffReg				; oled display for monitoring
    		ldi		Temp0, $17			; FIFO_STATUS
    		rcall	AffReg				; oled display for monitoring
    
    		lds		Temp1, PayLong		; 4 bytes to transmit hold in variable PayLong
    		clr		Temp
    		ldi		ZL, Low(TXBuff)		; Buffer where 4 bytes of payload are stored
    		ldi		ZH, High(TXBuff)		
    		add		ZL, Temp1
    		adc		ZH, Temp			; update buffer index
    		rcall	WR_TXPayload		; load FIFO
    
    		rcall	clrStatus
    
    		ldi		Temp0, $7			; STATUS
    		rcall	AffReg				; oled display for monitoring
    		ldi		Temp0, $17			; FIFO_STATUS
    		rcall	AffReg				; oled display for monitoring		
    
    		sbi		PORTD, CE			; CE pin High
    		ldi		Temp, 15
    		rcall	Wait2uS				; 30 µsec delay
    		cbi		PORTD, CE			; CE pin Low
    		ldi		Temp, 1				; wait 1 msec
    		rcall	Wait				; délai transmit >130µs
    		ldi		Temp0, $7			; FIFO_STATUS
    		rcall	AffReg				; oled display for monitoring
    		ldi		Temp0, $17			; FIFO_STATUS
    		rcall	AffReg				; oled display for monitoring
    loop1:

    I think it fits well the recommandation, but nothing arrives at PRX 2Node address. I have also scoped the CE pin signal, which is in range too.

  • Sorry, I sent the message too early!

    Can you explain Why Max RT is asserted as soon as CE pulse returns
    low ?
    Is it normal to clear a flag by writing it1 ?  Usually it is 0.

    Best regards

    Jacques

  • JacquesBrunet said:
    With the simplest program you advised me, no ack, no DPL, no ART

    Maybe a misunderstanding, but my suggested minimum configuration presume that you let all other registers be default values. That means there will be ack and retransmits.

    Kenneth

  • Sorry for my misunderstanding. That time, I left all default values on the PTX side and configured Arduino PRX accordingly, hoping I do not forget something somewhere :

    100RF24/examples/GettingStarted
    Which radio is this? Enter '0' or '1'. Defaults to '0'
    radioNumber = 0
    *** PRESS 'T' to begin transmitting to the other node
    SPI Speedz = 10 Mhz
    STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
    RX_ADDR_P0-1 = 0xc2c2c2c2c2 0xe7e7e7e7e7
    RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
    TX_ADDR = 0xc2c2c2c2c2
    RX_PW_P0-6 = 0x04 0x04 0x04 0x04 0x04 0x04
    EN_AA = 0x3f
    EN_RXADDR = 0x02
    RF_CH = 0x02
    RF_SETUP = 0x0b
    CONFIG = 0x0b
    DYNPD/FEATURE = 0x00 0x00
    Data Rate = 2 MBPS
    Model = nRF24L01+
    CRC Length = 8 bits
    PA Power = PA_LOW
    ARC = 0

    I expect to send to address 0xe7e7e7e7e7,  PRX should receive datas via Pipe1.

    Fifo status says first Datas in TX FIFO (0b00000001) and then TX FIFO empty (0b00100001). RX FIFO is always empty. Nothing arrives to PRX

    Status says RX FIFO empty TX FIFO full (0b00001111).

    Observe_TX says 0b00000000 nothing lost nothing retransmitted.

    I cannot understand what's append. Any idea ? By the way, can you tell me where to buy "official" modules, just in case mine are not compatibles ?

    Another question, I cannot find the field to change my password. Just reset via email. can you help please ?

    With best regards

    Jacques

  • And you CE is set high on the PRX after configuration?

    Kenneth

  • Yes Kenneth, arduino sketch says "radio.startListening(); // put radio in RX mode" ; "RF24 radio(7, 8); // using pin 7 for the CE pin, and pin 8 for the CSN pin" drives pin D7 high( 4.29 V). "5V pin" of Arduino is only 4.26 V and NRF24L01+ Vcc is 3.14 V coming out of an external 3.3 regulator  with 1000µF capacitor (not the 3.3 Arduino pin). I also tried that 3.3 Arduino pin which finally is better than 5V pin + external reg, but sill no data received.

    I found the way to change PW, forget my request.

    Best regards

    Jacques

  • Hi,

    I don't really have any good suggestions for further debugging, other than possible to read out all registers on both PTX and PRX to check for any inconsistency.

    You can on the PTX simply flush the TX between attempts and clear the status bits by writing 1 to them. Make sure that the payload length here is 4 when using W_TX_PAYLOAD, since RX_PW_P0 = 0x04. I don't understand why you have set EN_RXADDR = 0x02, since that means you only enable pipe1 on the PRX, while on the PTX it will use the tx_addr/pipe0 address when using W_TX_PAYLOAD. I suggest to set EN_RXADDR = 1 or 3 on the PRX.

    Please also see suggestions for debugging in Appendix A in the nRF24L01+ datasheet.

    Best regards,
    Kenneth

Reply
  • Hi,

    I don't really have any good suggestions for further debugging, other than possible to read out all registers on both PTX and PRX to check for any inconsistency.

    You can on the PTX simply flush the TX between attempts and clear the status bits by writing 1 to them. Make sure that the payload length here is 4 when using W_TX_PAYLOAD, since RX_PW_P0 = 0x04. I don't understand why you have set EN_RXADDR = 0x02, since that means you only enable pipe1 on the PRX, while on the PTX it will use the tx_addr/pipe0 address when using W_TX_PAYLOAD. I suggest to set EN_RXADDR = 1 or 3 on the PRX.

    Please also see suggestions for debugging in Appendix A in the nRF24L01+ datasheet.

    Best regards,
    Kenneth

Children
  • Hello Kenneth,

    I am sure my payload is 4 bytes long.
    EN_RXADDR is set by Arduino sketch:
    radio.openReadingPipe(1, address[!radioNumber]); // using pipe 1
    I do not understand your remark about TX_ADDR. My code sets reg 0x10 to 0xE7E7E7E7E7 (default value) when on the PRX side (Arduino) this address is allocated to Pipe 1 when Pipe0 is 0xC2C2C2C2C2:
    RX_ADDR_P0-1 = 0xc2c2c2c2c2 0xe7e7e7e7e7 
    so EN_RXADDR = 2 should fit. Am I right ? Anyway I forced Arduino to allow pipes 0 to 3 to receive, but still no luck.

    I monitor all registers value on the PTX side :
    Reg 0 = 0b00001000 Reg 1 = 0b00111111 Reg 2 = 0b00000011 Reg 3 = 0b00000011 Reg4 = 0b00000011 Reg 5 = 0b00000010 Reg 6 = 0b00001111 Reg 7 = 0b00001110 / 0b00001111 Reg 8 = 0 Reg 9 = 0 Reg 0x0A = 0xE7..... Reg 0x0B = 0xC2.... Reg 0x0C = 0xC3 Reg 0x0D = 0xC4 Reg 0x0E = 0xC5 Reg 0x0F = 0xC6 Reg 0x10 = 0xE7... Reg 0x11 to Reg 0x16 = 0 Reg 0x17 = 0b00000001 / 0b00010001 Reg 0x1C = 0 Reg 0x1D = 0

    More difficult on Arduino side, unless the config ones, I try to modify the sketch...

    Best regards

    Jacques

  • Hi Kenneth,

    today I bring you some good news, finally it works! Since the early days, my code is OK, BUT I discovered by chance that my AVR board needs a cold restart (switch off wait 5sec switch on again) instead of the reset at the end of programming with AVRDUDESS. So far I don't understand why, but I will investigate deeper. May be the 1000µF capa keeps some registers in a wrong status ?
    I would like to thank you very much for your time and advises.

    With best regards

    Jacques

    RF24/examples/GettingStarted
    Which radio is this? Enter '0' or '1'. Defaults to '0'
    radioNumber = 0
    *** PRESS 'T' to begin transmitting to the other node
    SPI Speed = 10 Mhz
    STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
    RX_ADDR_P0-1 = 0xc2c2c2c2c2 0xe7e7e7e7e7
    RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
    TX_ADDR = 0xc2c2c2c2c2
    RX_PW_P0-6 = 0x04 0x04 0x04 0x04 0x04 0x04
    EN_AA = 0x3f
    EN_RXADDR = 0x03
    RF_CH = 0x02
    RF_SETUP = 0x0b
    CONFIG = 0x0b
    DYNPD/FEATURE = 0x00 0x00
    Data Rate = 2 MBPS
    Model = nRF24L01+
    CRC Length = 8 bits
    PA Power = PA_LOW
    ARC = 0
    [Reading 4 bytes 0 blanks]
    write_register(07,40)
    Received 4 bytes on pipe 1: 321!
    [Reading 4 bytes 0 blanks]
    write_register(07,40)
    Received 4 bytes on pipe 1: 321"
    [Reading 4 bytes 0 blanks]
    write_register(07,40)
    Received 4 bytes on pipe 1: 321#
    [Reading 4 bytes 0 blanks]
    write_register(07,40)
    Received 4 bytes on pipe 1: 321$
    [Reading 4 bytes 0 blanks]
    write_register(07,40)
    Received 4 bytes on pipe 1: 321%
    [Reading 4 bytes 0 blanks]
    write_register(07,40)
    Received 4 bytes on pipe 1: 321&
    [Reading 4 bytes 0 blanks]
    write_register(07,40)
    Received 4 bytes on pipe 1: 321'
    [Reading 4 bytes 0 blanks]
    write_register(07,40)
    Received 4 bytes on pipe 1: 321(
    [Reading 4 bytes 0 blanks]
    write_register(07,40)
    Received 4 bytes on pipe 1: 321)
    [Reading 4 bytes 0 blanks]
    write_register(07,40)
    Received 4 bytes on pipe 1: 321*
    [Reading 4 bytes 0 blanks]
    write_register(07,40)
    Received 4 bytes on pipe 1: 321+
    [Reading 4 bytes 0 blanks]
    write_register(07,40)
    Received 4 bytes on pipe 1: 321,
    [Reading 4 bytes 0 blanks]
    write_register(07,40)
    Received 4 bytes on pipe 1: 321-
    [Reading 4 bytes 0 blanks]
    write_register(07,40)
    Received 4 bytes on pipe 1: 321.
    [Reading 4 bytes 0 blanks]
    write_register(07,40)
    Received 4 bytes on pipe 1: 321/
    [Reading 4 bytes 0 blanks]
    write_register(07,40)
    Received 4 bytes on pipe 1: 3210
    [Reading 4 bytes 0 blanks]
    write_register(07,40)
    Received 4 bytes on pipe 1: 3211
    [Reading 4 bytes 0 blanks]
    write_register(07,40)
    Received 4 bytes on pipe 1: 3212
    [Reading 4 bytes 0 blanks]

  • Good that you have found the issue, &Thanks for updating the case! 

    Kenneth

Related