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

Can not retrieve pipe number

Dear..,

Despite study the nRF24L01+ ProductSpecification I, the ACK related discussions in this forum your support are very welcome. The aim is to communicate with two nrf24L01+ with six pipes, each pipe with acknowledgement . Unfortunately the communication is restricted and stops after receiving one Pipe0. No other pipes! No pipe number to retrieve.

In the transmitting PTX code there must be a continuation of sending packets with W_TX_PAYLOAD for pipes 0 to 5. See code below. Also tried this to replace with W_ACK_PAYLOAD + pipenumber . In the code : After PRX starting receiving on interrupt RX_DR there will be collecting data on R_RX_PAYLOAD only for the first pipe0. In this pipe coming from the PTX I expects a packet containing such as ACK and next pipe info. But it seems that it does not happen. What can it be?; Q A) a wrong PTX or PRX code?, I appreciate your comment very much. QB) What does the protocol currently need for automatic pipe collecting process sending PTX data and PRX reply with acknowledge including pipe number? QC) What do I have to do in the PTX and PRX to retrieve the data with Pipe number. QD) If I must use W_ACK_PAYLOAD (used in PRX mode, page 51 ) how can I implement it giving a positive 10 us pulse while CE is high in PRX mode. In this case would you give me in simple(for me) English text the protocol flow commands what to send currently in PTX en PRX site QF) Timing or Others,

I would appreciated your help , comment, suggestions for this ambitious project. On beforehand thanks, Teun

The relevant configuration I do :

EN_AA		=0x3F 
 EN_RXADDR 	= 0x3f 	all pipes enable
SETUP_RETR	=0x2F 	750usec 15 retries
RX_ADDR_P0 	=  TX_ADDR  =	4 bytes +  Byte  0xE0
RX_ADDR_P1 	=  5 x E1
RX_ADDR_P2  -  RX_ADDR_P5   a single Byte 0xE2, 0xE3, 0xE4 , 0xE5
RX_PW_P0  and   RX_PW_P1 	2 Bytes
RX_PW_P2 ,  RX_PW_P3, RX_PW_P4 ,  RX_PW_P5   Bytes
DYNPD 		=  0x3F		Enable  dynamic payload length for all pipes
FEATURE	= 6		BIT1 for ACK , BIT2 DPL needing for ACK

Clear PTX sending pipe process

if ( (status & TX_DS ) != 0 || (MAX_RT  & status) ) {  
CSN_L_DLY(); status = datawrite(COMMAND_WRITE + STATUS)  ;
     clearstatus = status | BIT5 ;   datawrite( clearstatus ) ;      // clear  TX_DS
 CSN_L_DLY(); status = datawrite(COMMAND_WRITE + STATUS) ; 
     clearstatus = status | BIT4 ; status = datawrite( clearstatus ) ;   // with 1E clear bit MAX_RT   
  CSN_L_DLY(); datawrite ( FLUSH_TX );  status=datawrite(0)   ;  ;} 

Continuous Sending with PTX 6 pipes :

a)	CE = low PTX  mode
b)	CSN_High ;   CSN_low;  datawrite( EN_AA + COMMAND_WRITE) ;  datawrite(0x3F) ; 
c)	 Clear PTX sending  pipe process ; clear bit MAX_RT, clear TX_DS and flush_TX
d)	sending  6 payload. This c)  6 times   (datasendPipe0[j] ,  …  , …  , … ,  … ,  datasendPipe5[j] ) 
 CSN_High ;   CSN_low; 
datawrite(EN_RXADDR  + COMMAND_WRITE )  ;  datawrite(XX) ;   //XX = enable for pipe0  Bit0=1, for pipe1  bit1 = 2,  for pipe2  bit2 = 4 , for pipe3 bit3 =8  ,for pipe 4 bit4= 16, for  pipe5  bit5 = 32.
 CSN_High ;   CSN_low; 
 datawrite( STATUS )  ;  status = datawrite(0);     //get status 
 if ( (status & TX_DS ) == 0  )   {  
CSN_High ;   CSN_low;  ;
 status = datawrite(W_TX_PAYLOAD) ;   
 for (j = 0;  j <2; j++)  { send= datasendPipe0[j] ;  datawrite( send )  ; __delay_cycles(10) ;   }
 CE = high  ; __delay_cycles(10);   CE =Low   ;   //transmit pulse 10us
 __delay_cycles(12000);            ;}
e)	 RXmode();    P1OUT |= P1CE ;          // CE High to idle RX mode  //back to PRX mode

Clear read PRX process
a)	 __delay_cycles(12000);
b)	status = datawrite(COMMAND_WRITE + STATUS) ;     
            clearstatus = status | BIT6 ;   datawrite(clearstatus ) ;     //write 1 to clear bit RX_DR dataread
c)	CSN_L_DLY();   datawrite ( FLUSH_RX );   status=datawrite(0)   ;  //flush RX


Continuous  collecting process:
a)   CSN_High ;   CSN_low;  status = datawrite( STATUS ) ; status = datawrite(0);   // get status to   retrieve pipenr. 
b)    CSN_High ;   CSN_low;  datawrite( FIFO_STATUS ) ;  fifo = datawrite(0);  __delay_cycles(10);  // Get Fifo status option for c)    
  c)   if ((status & RX_DR) !=0)          {       // Waiting for packets                     
            		// if (( fifo & RX_FULL) !=0) {       // or option this one?
     
 d)     RX_P_NO  = status >> 1 ;   pipenr  =  RX_P_NO  &  7  ;      
 e)    if ( pipenr == 0 ) 		 {    this  d repeating 0 t0 5 pipes
     CSN_High ;   CSN_low;   datawrite ( R_RX_PAYLOAD );  
     for (j = 0; j <2; j++)  {datareceivedPipe0[j] = datawrite(rdata) ; 
f )  __delay_cycles(12000);    	 }      // 2 byte Pyload for pipe0,1 .  4 for pipe2,3,4,5
        g )    Clear read PRX process
h)  CSN_High ;   CSN_low;  datawrite( FIFO_STATUS ) ;  fifo = datawrite(0);                                                      __delay_cycles(10); //FIFO Status to collect the next pipe number  repeating from b)
  	i)  repeating collecting pipe information for and empty other pipes to a)
  • Hi

    In the nRF24L01+ there is really no concept of pipes on the PTX side, you only operate with pipes in the PRX.

    The reason for this is that there is only one TX address, and you have to change this address every time the PTX wants to address another pipe or device. Not only that, but the PTX uses RX pipe 0 to receive the ACK packet, so you also have to set the RX pipe 0 address accordingly (to the same as the TX address).

    You don't need to pulse CE when uploading ACK payloads. Just upload a packet while CE is high, and the ACK payload will be sent on the next received packet from the PTX.

    Best regards Torbjørn

Related