<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>switch between RX and TX mode in nRF24L01+</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20184/switch-between-rx-and-tx-mode-in-nrf24l01</link><description>Hej, 
 I&amp;#39;m working with the nRF24L01+ and the ATmega328p programmed in c. The goal is to have both TX and RX mode in the same device, mainly work as RX but in certain conditions work as TX. There seems to be a problem in the set registers, because it</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 27 Mar 2017 13:21:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20184/switch-between-rx-and-tx-mode-in-nrf24l01" /><item><title>RE: switch between RX and TX mode in nRF24L01+</title><link>https://devzone.nordicsemi.com/thread/78646?ContentTypeID=1</link><pubDate>Mon, 27 Mar 2017 13:21:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51aa3e3d-91f3-4af6-8e19-ce513dd85365</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Thanks for adding the working code :)&lt;/p&gt;
&lt;p&gt;It is true that on the PTX side the TX and RX needs to be set to the same value. Otherwise the ACK will not be received (since the ACK uses the same address as the TX packet).&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;
Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: switch between RX and TX mode in nRF24L01+</title><link>https://devzone.nordicsemi.com/thread/78645?ContentTypeID=1</link><pubDate>Mon, 20 Mar 2017 09:23:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:beda4685-dabe-428d-954b-36ffb1e9a0a5</guid><dc:creator>nito</dc:creator><description>&lt;p&gt;Here is the function how I made it work:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint8_t nrf24_startAs(uint8_t mode){
  tx_addr[0] = tx_addr[1] = tx_addr[2] = tx_addr[3] = tx_addr[4] = RX_ADDR_P0_B0_DEFAULT_VAL;

  if (prevMODE = TX_MODE &amp;amp;&amp;amp; mode == RX_MODE) {
    nRF24L01_reset();
    POWERDOWN;
    _delay_ms(10);
    // UART_Transmit(&amp;quot;TX-&amp;gt;RX\n&amp;quot;);
  }

  nrf24_writeRegister(RF_CH, 2);
  nrf24_writeRegister(RF_SETUP, RF_SETUP_RF_DR_250 | RF_SETUP_RF_PWR_0);
  nrf24_writeRegister(CONFIG, (1 &amp;lt;&amp;lt; EN_CRC)|(0&amp;lt;&amp;lt;CRCO)|(0 &amp;lt;&amp;lt; PRIM_RX));

  // Set length of incoming payload in 1-32 byte, p60
  nrf24_configRegister(RX_PW_P0, 0x00); // Auto-ACK pipe ...
  nrf24_configRegister(RX_PW_P1, PAYLOAD_LENGTH); // Data payload pipe
  nrf24_configRegister(RX_PW_P2, 0x00); // Pipe not used
  nrf24_configRegister(RX_PW_P3, 0x00); // Pipe not used
  nrf24_configRegister(RX_PW_P4, 0x00); // Pipe not used
  nrf24_configRegister(RX_PW_P5, 0x00); // Pipe not used


  if (mode == RX_MODE) {
    CLEAR_BIT(PORTD, PD7);
    // Auto Acknowledgment
    nrf24_configRegister(EN_AA,(1&amp;lt;&amp;lt;ENAA_P0)|(1&amp;lt;&amp;lt;ENAA_P1)|(0&amp;lt;&amp;lt;ENAA_P2)|(0&amp;lt;&amp;lt;ENAA_P3)|(0&amp;lt;&amp;lt;ENAA_P4)|(0&amp;lt;&amp;lt;ENAA_P5));
    // Enable RX addresses
    nrf24_configRegister(EN_RXADDR,(1&amp;lt;&amp;lt;ERX_P0)|(1&amp;lt;&amp;lt;ERX_P1)|(0&amp;lt;&amp;lt;ERX_P2)|(0&amp;lt;&amp;lt;ERX_P3)|(0&amp;lt;&amp;lt;ERX_P4)|(0&amp;lt;&amp;lt;ERX_P5));

    nrf24_rx_address(tx_addr);
    PTX = 0;
    RX_POWERUP;
    nrf24_ce_set(1);
    UART_Transmit(&amp;quot;booted in RX_MODE\n&amp;quot;);
    return 0;
  }
  else if (mode == TX_MODE) {
    SET_BIT(PORTD, PD7);
    nrf24_writeRegister(SETUP_RETR,(SETUP_RETR_ARD_750 | SETUP_RETR_ARC_15));
		nrf24_tx_address(tx_addr);
    UART_Transmit(&amp;quot;booted in TX_MODE\n&amp;quot;);
    return 0;
  }
  else {
    UART_Transmit(&amp;quot;something in startAs went wrong\n&amp;quot;);
    return -1;
  }
  prevMODE = mode;
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: switch between RX and TX mode in nRF24L01+</title><link>https://devzone.nordicsemi.com/thread/78644?ContentTypeID=1</link><pubDate>Mon, 20 Mar 2017 09:20:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d498f1c6-8d10-499c-89b5-bfb063296301</guid><dc:creator>nito</dc:creator><description>&lt;p&gt;Hej Torbjørn!
The issue was something else, I found out that i have to reset the RX-addr actively to a specific value and when I set the TX-addr I need to have the RX-addr equal to that. It works fine afterwards.
(sorry for taking so long to answer)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: switch between RX and TX mode in nRF24L01+</title><link>https://devzone.nordicsemi.com/thread/78643?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2017 12:51:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bada2502-1203-47c3-be67-1c9c5319ca9f</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Nito&lt;/p&gt;
&lt;p&gt;Quick follow up question: Do you have any changing bytes in the payload, or is the payload static?
A known issue when resetting the radio between each transmitted packet is the fact that the 2 bit sequence counter (PID) will be reset, and the second packet will be discarded as a retransmission in the RX. By including a rolling counter in the payload you will avoid the problem.&lt;/p&gt;
&lt;p&gt;Can you confirm whether or not this is the issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>