<?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>dynamic switching ptx and prx base on ESB</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/32485/dynamic-switching-ptx-and-prx-base-on-esb</link><description>I have two nrf51 development board. A is PRX, B is PTX. now B can send payload to A , and A can receive and response it by ACK. But some times A want to send payload to B initiatively, so I want to switch PRX to PTX ,and switch PTX to PRX. How can I switch</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 21 Mar 2018 06:16:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/32485/dynamic-switching-ptx-and-prx-base-on-esb" /><item><title>RE: dynamic switching ptx and prx base on ESB</title><link>https://devzone.nordicsemi.com/thread/125260?ContentTypeID=1</link><pubDate>Wed, 21 Mar 2018 06:16:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ddede56-6da1-41ae-b974-b8b4e4021ed5</guid><dc:creator>fangrui166</dc:creator><description>&lt;p&gt;thanks for your reply , I have implement a founction ,and it is works fine .but i&amp;#39;m not sure what side effect will be.&lt;/p&gt;
&lt;p&gt;uint32_t nrf_esb_switch_to_ptx(void)&lt;br /&gt;{&lt;br /&gt; if(m_config_local.mode == NRF_ESB_MODE_PTX) return NRF_SUCCESS;&lt;br /&gt; m_config_local.mode = NRF_ESB_MODE_PTX;&lt;br /&gt; printf(&amp;quot;%s\n&amp;quot;,__func__);&lt;br /&gt; nrf_esb_stop_rx();&lt;/p&gt;
&lt;p&gt;// Clear PPI&lt;br /&gt; NRF_PPI-&amp;gt;CHENCLR = (1 &amp;lt;&amp;lt; NRF_ESB_PPI_TIMER_START) |&lt;br /&gt; (1 &amp;lt;&amp;lt; NRF_ESB_PPI_TIMER_STOP) |&lt;br /&gt; (1 &amp;lt;&amp;lt; NRF_ESB_PPI_RX_TIMEOUT) |&lt;br /&gt; (1 &amp;lt;&amp;lt; NRF_ESB_PPI_TX_START);&lt;/p&gt;
&lt;p&gt;m_nrf_esb_mainstate = NRF_ESB_STATE_IDLE;&lt;/p&gt;
&lt;p&gt;reset_fifos();&lt;/p&gt;
&lt;p&gt;memset(m_rx_pipe_info, 0, sizeof(m_rx_pipe_info));&lt;br /&gt; memset(m_pids, 0, sizeof(m_pids));&lt;br /&gt; NRF_RADIO-&amp;gt;SHORTS = RADIO_SHORTS_READY_START_Enabled &amp;lt;&amp;lt; RADIO_SHORTS_READY_START_Pos |&lt;br /&gt; RADIO_SHORTS_END_DISABLE_Enabled &amp;lt;&amp;lt; RADIO_SHORTS_END_DISABLE_Pos;&lt;br /&gt; NRF_RADIO-&amp;gt;TXADDRESS = 0;&lt;br /&gt; NRF_RADIO-&amp;gt;RXADDRESSES = 0;&lt;br /&gt; NRF_RADIO-&amp;gt;TASKS_RXEN = 0;&lt;/p&gt;
&lt;p&gt;return NRF_SUCCESS;&lt;br /&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: dynamic switching ptx and prx base on ESB</title><link>https://devzone.nordicsemi.com/thread/125055?ContentTypeID=1</link><pubDate>Mon, 19 Mar 2018 18:15:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13fa4ef6-8bc4-4fdb-8475-47ecabf84861</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi, my suggestion is that the PTX periodically send a packet, and that the PRX then can send an ACK or an ACK with payload. Then you avoid switching between PTX and PRX.&lt;/p&gt;
&lt;p&gt;The problem with switching is that you don&amp;#39;t know if the PTX may still be transmitting waiting for an ACK, if the PRX change to PTX at the same time.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>