<?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>NRF24L01+ PIPE SETTINGS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/1561/nrf24l01-pipe-settings</link><description>Hello, 
 i just want setup 1Tx and 1 RX using NRF24L01+ chips. but i am confused what should be Transmitter side Tx &amp;amp; Rx and what should be in Rx Tx &amp;amp; RX ? in order to use auto-ack feature. 
 which addresses sould be kept in Transmitter and Receiver</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 11 Mar 2014 11:15:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/1561/nrf24l01-pipe-settings" /><item><title>RE: NRF24L01+ PIPE SETTINGS</title><link>https://devzone.nordicsemi.com/thread/6913?ContentTypeID=1</link><pubDate>Tue, 11 Mar 2014 11:15:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9595ae87-c4ed-41fa-bdcc-7e33105e95ee</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This is not an issue that we&amp;#39;ve heard before. Usually, since wifi transmits at around 20 dBm, people have issues with the nRF having reduced range (due to wifi noise). RX mode should not be an issue, as it&amp;#39;s not emitting any energy then (unless it&amp;#39;s ACKing packets).&lt;/p&gt;
&lt;p&gt;If your antenna is very directive, this may be an issue if you are transmitting continuously. Try moving the nRF away from your wifi, or changing the channel.&lt;/p&gt;
&lt;p&gt;Best regards
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF24L01+ PIPE SETTINGS</title><link>https://devzone.nordicsemi.com/thread/6912?ContentTypeID=1</link><pubDate>Tue, 11 Mar 2014 02:26:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cbc2f898-e11e-41c4-9035-43585398ee48</guid><dc:creator>KALPESH PATEL</dc:creator><description>&lt;p&gt;Hi Hakon,&lt;/p&gt;
&lt;p&gt;I had serious issue with WiFi + Nordic NRF24L01+ (Speed 2mbps, channel 89) when i turn on the Tx or Rx near to my laptop. All data through WiFi is jammed. As soon as i turn of NRF24L01+ data is normal with My laptop through my wifi router. Any suggestions ? what could be real culprit ?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF24L01+ PIPE SETTINGS</title><link>https://devzone.nordicsemi.com/thread/6911?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2014 08:55:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:289fb15b-3e70-4da8-a884-cc2b24137201</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;What you can try:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Use interrupt on IRQ pin instead of polling in your main-loop. (ie: wait untill IRQ is active before checking radio-registers)&lt;/li&gt;
&lt;li&gt;Use a slower SPI transfer rate (&amp;lt; 1 MHz for instance)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Best regards
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF24L01+ PIPE SETTINGS</title><link>https://devzone.nordicsemi.com/thread/6910?ContentTypeID=1</link><pubDate>Wed, 26 Feb 2014 16:52:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61a231e1-453d-4cde-b9f0-e7ba9bd54908</guid><dc:creator>KALPESH PATEL</dc:creator><description>&lt;p&gt;You means to say,&lt;/p&gt;
&lt;p&gt;When some interrupt occurs (IRQ Pin goes low) then i should stop polling registers, means i should stop spi communication ? Please elborate i am not able to understand you regarding 250kbps speed settings. I want long range so i need to use 250kbps. So please guide me because right now 250kbps is giving worst range.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF24L01+ PIPE SETTINGS</title><link>https://devzone.nordicsemi.com/thread/6909?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2014 09:42:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:516042f3-6a85-4c83-a586-87da6c2c3ef8</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;250kBit mode should give you better range.
We have seen that if you poll registers (ie: SPI communication always running), you may get reduced sensitivity due to noise.
What you should do is to check the &amp;quot;IRQ&amp;quot; pin (or set interrupt on this pin) before doing any communication.&lt;/p&gt;
&lt;p&gt;-H&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF24L01+ PIPE SETTINGS</title><link>https://devzone.nordicsemi.com/thread/6908?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2014 07:37:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef7012ec-4ff9-4bb8-8185-85c4bdc07183</guid><dc:creator>KALPESH PATEL</dc:creator><description>&lt;p&gt;Hi Hakon,&lt;/p&gt;
&lt;p&gt;Finally i am able to get the TX_DS and MAX_RT bits with my led. I have tried with HW SPI MCU and it worked. Soft SPI is not working with NRF24L01+ i don&amp;#39;t know why everything seems to be fine. Now i have issue of speed and range. I have tried to put both the module to 250kbps to get more range. by setting RF_DR_LOW = 1 &amp;amp; RF_DR_HIGH = 0. // speed set to 250kbps. Is there any thing else to set ? Because i got worst range with 250kbps. Even it did not cross single wall properly. People say when you transmit at lower rates you get better range. But in my case its completed vice-versa. With default 2mbps speed i am getting good range in my home with 3-4 walls crossed easily. So what you say ? what could be the issue with 250kbps ? and practically low speed high range ? right ?&lt;/p&gt;
&lt;p&gt;awaiting your reply.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF24L01+ PIPE SETTINGS</title><link>https://devzone.nordicsemi.com/thread/6907?ContentTypeID=1</link><pubDate>Mon, 17 Feb 2014 10:21:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34dbf449-b342-4d87-aefc-c20880525376</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Are you uploading packets to the FIFO each 100 us?
You should wait until the interrupt comes before uploading a new packet.&lt;/p&gt;
&lt;p&gt;Best regards
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF24L01+ PIPE SETTINGS</title><link>https://devzone.nordicsemi.com/thread/6906?ContentTypeID=1</link><pubDate>Fri, 14 Feb 2014 18:39:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b0ee875-1a49-48cb-8d8c-91b41c008c60</guid><dc:creator>KALPESH PATEL</dc:creator><description>&lt;p&gt;Hi Hakon,&lt;/p&gt;
&lt;p&gt;check this image&lt;/p&gt;
&lt;p&gt;&lt;img src="http://i62.tinypic.com/5ltoax.jpg" alt="http://i62.tinypic.com/5ltoax.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;i am seeing one rare..problem my TX_FULL register is having value 1. i don&amp;#39;t know why it is so. i have kept CE high for more than 100us then also its not empty. i am trying debugging by matching condition of register with led on. but don&amp;#39;t know why TX_FULL. even though if i do spi_transfer(FLUSH_TX). Any suggestions ?&lt;/p&gt;
&lt;p&gt;if (status &amp;amp; (1&amp;lt;&amp;lt;TX_FULL))
{
LED = ON;
}&lt;/p&gt;
&lt;p&gt;else
{
LED = OFF;
}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF24L01+ PIPE SETTINGS</title><link>https://devzone.nordicsemi.com/thread/6905?ContentTypeID=1</link><pubDate>Fri, 14 Feb 2014 09:27:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75092ad2-e2a7-4579-8a75-ff9419f36da4</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Small jitter is normal, however, this seems to be a bit more than just &amp;quot;some ripple&amp;quot;. What is suspect is that this is due to your test setup. You can see noise on the line if your test-points are connected with long wires, or that your probe loads too much.&lt;/p&gt;
&lt;p&gt;Can you attach a picture of your test setup?&lt;/p&gt;
&lt;p&gt;BR
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF24L01+ PIPE SETTINGS</title><link>https://devzone.nordicsemi.com/thread/6904?ContentTypeID=1</link><pubDate>Thu, 13 Feb 2014 18:51:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd3ce1db-bfad-4848-8202-e91ec99c1153</guid><dc:creator>KALPESH PATEL</dc:creator><description>&lt;p&gt;VDD_PA is something little weird... pulse is having some noise can you tell me why is that ? i am posting screenshot from my scope.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://i60.tinypic.com/1pz6mq.jpg" alt="http://i60.tinypic.com/1pz6mq.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://i57.tinypic.com/2emcyvs.jpg" alt="http://i57.tinypic.com/2emcyvs.jpg" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF24L01+ PIPE SETTINGS</title><link>https://devzone.nordicsemi.com/thread/6903?ContentTypeID=1</link><pubDate>Thu, 13 Feb 2014 11:59:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed96b47f-0e73-46cd-becc-99750e2f200e</guid><dc:creator>KALPESH PATEL</dc:creator><description>&lt;p&gt;Hi Hakon,&lt;/p&gt;
&lt;p&gt;I think i misinterpreted your statement &amp;quot;Now you can upload payloads (3 bytes length by default) to the FIFO.&amp;quot; i thought its already defined 3 bytes in default for sending data. So till now i have not set the payload width(size) how much i am going to transfer on both side. actually i am confused. Which register to write the size of payload on tx and rx side ? On rx side i think its RX_PW_P0 but how to define the payload size on tx side ?&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF24L01+ PIPE SETTINGS</title><link>https://devzone.nordicsemi.com/thread/6902?ContentTypeID=1</link><pubDate>Wed, 12 Feb 2014 09:46:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5a719f9-144d-4622-9ade-83c50b403ae3</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Normal procedure is to wait until the interrupt is finished before triggering a new transmission:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
hal_nrf_write_tx_payload(tx_payload, sizeof(tx_payload));
CE_PULSE();
radio_busy = true;
// Wait for radio operation to finish
while (radio_busy); // Set false when interrupt occurs
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The pulsing on VDD_PA indicates that your PTX is sending, however you should check the interrupt to see if this is &amp;quot;TX_DS&amp;quot; or &amp;quot;MAX_RT&amp;quot;.
You can also check VDD_PA pin on PRX as it will send an ACK over-the-air.&lt;/p&gt;
&lt;p&gt;Best regards
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF24L01+ PIPE SETTINGS</title><link>https://devzone.nordicsemi.com/thread/6901?ContentTypeID=1</link><pubDate>Tue, 11 Feb 2014 18:41:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48d7c037-b86b-476f-a9f5-f553bb9186b5</guid><dc:creator>KALPESH PATEL</dc:creator><description>&lt;p&gt;Hi Hakon,&lt;/p&gt;
&lt;p&gt;I just want to check the communication test so as per your Guidelines i have just configured required settings and i have left all other uncheck. Is it compulsory to clear the interrupts to get data reflected ? or transmitter properly ?&lt;/p&gt;
&lt;p&gt;I have successfully compile the code and i have check SPI using debugger it is sending payload 0x6F 0x70 0x71 (3 bytes).&lt;/p&gt;
&lt;p&gt;for TX side on pin 11 VDD_PA i am getting continuous high to low pulses @ 1.34 KHZ. i checked with oscilloscope.&lt;/p&gt;
&lt;p&gt;so what could be the issue now ?&lt;/p&gt;
&lt;p&gt;on receiver side what could be the interrupt that i can trace and put LED to light if data available ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF24L01+ PIPE SETTINGS</title><link>https://devzone.nordicsemi.com/thread/6900?ContentTypeID=1</link><pubDate>Tue, 11 Feb 2014 13:50:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebe49aa3-2981-4ba3-83ff-379ef9bea236</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Can you add a bit more information about what is going wrong? Don&amp;#39;t you get any data on the PRX?&lt;/p&gt;
&lt;p&gt;Can you verify that your PTX is actually sending?
It seems that you do not clear interrupts or handle them in any way. You are pushing packets to the radio every 20 us or so. You should rather check the FIFO_STATUS register to see if you can actually push packets to the FIFO.&lt;/p&gt;
&lt;p&gt;You can check if the PTX sends by probing pin &amp;quot;VDD_PA&amp;quot;. It will go high just before a transmission is triggered, and then go low again when it&amp;#39;s ended. Checking the current consumption of the radio will also give you an indication on what state it is in.&lt;/p&gt;
&lt;p&gt;Best regards
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF24L01+ PIPE SETTINGS</title><link>https://devzone.nordicsemi.com/thread/6899?ContentTypeID=1</link><pubDate>Mon, 10 Feb 2014 18:33:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28c91f0c-d978-4c08-82fc-66451c90a3c1</guid><dc:creator>KALPESH PATEL</dc:creator><description>&lt;p&gt;Hi Hakon,&lt;/p&gt;
&lt;p&gt;As per your instructions i did program my both the chips still led on the receiver is not getting ON. please check whats wrong with it ? any suggestions ?&lt;/p&gt;
&lt;p&gt;please help :(&lt;/p&gt;
&lt;p&gt;Transmitter Code&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
#include &amp;lt;xc.h&amp;gt;
#include &amp;lt;htc.h&amp;gt;

__CONFIG(FOSC_HS &amp;amp; WDTE_OFF &amp;amp; PWRTE_OFF &amp;amp; MCLRE_OFF &amp;amp; BOREN_OFF &amp;amp; LVP_OFF &amp;amp; CPD_OFF &amp;amp; CP_OFF);
#define	_XTAL_FREQ	20000000


#include &amp;quot;stdint.h&amp;quot;
/* Memory Map */
#define CONFIG      0x00
#define EN_AA       0x01
#define EN_RXADDR   0x02
#define SETUP_AW    0x03
#define SETUP_RETR  0x04
#define RF_CH       0x05
#define RF_SETUP    0x06
#define STATUS      0x07
#define OBSERVE_TX  0x08
#define CD          0x09
#define RX_ADDR_P0  0x0A
#define RX_ADDR_P1  0x0B
#define RX_ADDR_P2  0x0C
#define RX_ADDR_P3  0x0D
#define RX_ADDR_P4  0x0E
#define RX_ADDR_P5  0x0F
#define TX_ADDR     0x10
#define RX_PW_P0    0x11
#define RX_PW_P1    0x12
#define RX_PW_P2    0x13
#define RX_PW_P3    0x14
#define RX_PW_P4    0x15
#define RX_PW_P5    0x16
#define FIFO_STATUS 0x17
#define DYNPD       0x1C

/* Bit Mnemonics */

/* configuratio nregister */
#define MASK_RX_DR  6
#define MASK_TX_DS  5
#define MASK_MAX_RT 4
#define EN_CRC      3
#define CRCO        2
#define PWR_UP      1
#define PRIM_RX     0

/* enable auto acknowledgment */
#define ENAA_P5     5
#define ENAA_P4     4
#define ENAA_P3     3
#define ENAA_P2     2
#define ENAA_P1     1
#define ENAA_P0     0

/* enable rx addresses */
#define ERX_P5      5
#define ERX_P4      4
#define ERX_P3      3
#define ERX_P2      2
#define ERX_P1      1
#define ERX_P0      0

/* setup of address width */
#define AW          0 /* 2 bits */

/* setup of auto re-transmission */
#define ARD         4 /* 4 bits */
#define ARC         0 /* 4 bits */

/* RF setup register */
#define PLL_LOCK    4
#define RF_DR_HIGH  3
#define RF_PWR      1 /* 2 bits */

/* general status register */
#define RX_DR       6
#define TX_DS       5
#define MAX_RT      4
#define RX_P_NO     1 /* 3 bits */
#define TX_FULL     0

/* transmit observe register */
#define PLOS_CNT    4 /* 4 bits */
#define ARC_CNT     0 /* 4 bits */

/* fifo status */
#define TX_REUSE    6
#define FIFO_FULL   5
#define TX_EMPTY    4
#define RX_FULL     1
#define RX_EMPTY    0

/* dynamic length */
#define DPL_P0      0
#define DPL_P1      1
#define DPL_P2      2
#define DPL_P3      3
#define DPL_P4      4
#define DPL_P5      5

/* Instruction Mnemonics */
#define R_REGISTER    0x00 /* last 4 bits will indicate reg. address */
#define W_REGISTER    0x20 /* last 4 bits will indicate reg. address */
#define REGISTER_MASK 0x1F
#define R_RX_PAYLOAD  0x61
#define W_TX_PAYLOAD  0xA0
#define FLUSH_TX      0xE1
#define FLUSH_RX      0xE2
#define REUSE_TX_PL   0xE3
#define ACTIVATE      0x50
#define R_RX_PL_WID   0x60
#define NOP1          0xFF

#define nrf24_CONFIG ((1 &amp;lt;&amp;lt; MASK_RX_DR)|(1&amp;lt;&amp;lt;EN_CRC)|(0&amp;lt;&amp;lt;CRCO))

/// hardware spi pin defined
#define LED_PIN      PORTAbits.RA1 // led test
#define CS_Pin       PORTBbits.RB0//          //set port as output
#define CE_Pin       PORTBbits.RB4         //set port as output
#define SCK_Pin      PORTBbits.RB1        //set port as output
#define Mosi_Pin     PORTBbits.RB2         //set port as output
#define Miso_Pin     PORTBbits.RB3        //set port as input
#define HIGH         1
#define LOW          0



void nrf24_ce_digitalwrite(uint8_t state)
{
if (state)
{
CE_Pin = 1;
}
else
{
CE_Pin = 0;
}
}


void nrf24_csn_digitalwrite(uint8_t state)
{
if (state)
{
CS_Pin = 1;
}
else
{
CS_Pin = 0;
}
}


void nrf24_sck_digitalwrite(uint8_t state)
{
if (state)
{
SCK_Pin = 1;
}
else
{
SCK_Pin = 0;
}
}


void nrf24_mosi_digitalwrite( uint8_t state)
{
if (state)
{
Mosi_Pin = 1;
}
else
{
Mosi_Pin = 0;
}
}



/* software spi routine */
uint8_t spi_transfer(uint8_t tx)
{
     uint8_t i = 0;
     uint8_t rs = 0;

    nrf24_sck_digitalwrite(LOW);

    for(i=0;i&amp;lt;8;i++)
    {

        if(tx &amp;amp; 0x80) // msbit first spi standard
        {
            nrf24_mosi_digitalwrite(HIGH);
        }
        else
        {
            nrf24_mosi_digitalwrite(LOW);
        }

        nrf24_sck_digitalwrite(HIGH);

        tx = tx &amp;lt;&amp;lt; 1;
        if(Miso_Pin == 1)
        {
            rs |= 0x01;
        }
        nrf24_sck_digitalwrite(LOW);
    }
    return rs;
}


/* send and receive multiple bytes over SPI */ // checked with mirf
void nrf24_transferSync(uint8_t  *dataout,uint8_t *datain,uint8_t len)
{
    uint8_t i;

    for(i=0;i&amp;lt;len;i++){
       datain[i] = spi_transfer(dataout[i]);
    }
}


//send multiple bytes over SPI // checked with mirf
void nrf24_transmitSync(uint8_t *dataout,uint8_t len)
{
    uint8_t i;

    for(i=0;i&amp;lt;len;i++){
      spi_transfer(dataout[i]);
    }
}

void nrf24_configRegister(uint8_t reg, uint8_t value)
{
    nrf24_csn_digitalwrite(LOW);
    spi_transfer(W_REGISTER | (REGISTER_MASK &amp;amp; reg));
    spi_transfer(value);
    nrf24_csn_digitalwrite(HIGH);
}

void nrf24_powerUpTx() // checked with mirf
{
   // PTX = 1;
	
    nrf24_configRegister(CONFIG,nrf24_CONFIG|((1&amp;lt;&amp;lt;PWR_UP)|(0&amp;lt;&amp;lt;PRIM_RX)));

}

void nrf24_init()
{
	TRISB = 0b00001000;
	TRISA = 0b00000000;
    CMCON  |= 7;
    nrf24_ce_digitalwrite(LOW);
    nrf24_csn_digitalwrite(HIGH);
}


void nrf24_send(uint8_t* value)   // check with mirf
{
    /* Go to Standby-I first */
    nrf24_ce_digitalwrite(LOW);

    /* Set to transmitter mode , Power up if needed */
    nrf24_powerUpTx();
	nrf24_csn_digitalwrite(LOW);
	spi_transfer(FLUSH_TX);
	nrf24_csn_digitalwrite(HIGH);
   

    /* Pull down chip select */
    nrf24_csn_digitalwrite(LOW);

    /* Write cmd to write payload */
    spi_transfer(W_TX_PAYLOAD);

    /* Write payload */
    nrf24_transmitSync(value,3);

    /* Pull up chip select */
    nrf24_csn_digitalwrite(HIGH);

    /* Start the transmission */
    nrf24_ce_digitalwrite(HIGH);

}

uint8_t data_array[3];

void main()
{

nrf24_init();
nrf24_powerUpTx();

nrf24_csn_digitalwrite(LOW);
spi_transfer(FLUSH_TX);
nrf24_csn_digitalwrite(HIGH);





while(1)
{
data_array[0] = 0x6F;
data_array[1] = 0X12;
data_array[2] = 0x12;


nrf24_send(data_array);
__delay_us(15); // wait some time
}


}



&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Receiver Code&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
#include &amp;lt;xc.h&amp;gt;
#include &amp;lt;htc.h&amp;gt;

__CONFIG(FOSC_HS &amp;amp; WDTE_OFF &amp;amp; PWRTE_OFF &amp;amp; MCLRE_OFF &amp;amp; BOREN_OFF &amp;amp; LVP_OFF &amp;amp; CPD_OFF &amp;amp; CP_OFF);
#define	_XTAL_FREQ	20000000


#include &amp;quot;stdint.h&amp;quot;
/* Memory Map */
#define CONFIG      0x00
#define EN_AA       0x01
#define EN_RXADDR   0x02
#define SETUP_AW    0x03
#define SETUP_RETR  0x04
#define RF_CH       0x05
#define RF_SETUP    0x06
#define STATUS      0x07
#define OBSERVE_TX  0x08
#define CD          0x09
#define RX_ADDR_P0  0x0A
#define RX_ADDR_P1  0x0B
#define RX_ADDR_P2  0x0C
#define RX_ADDR_P3  0x0D
#define RX_ADDR_P4  0x0E
#define RX_ADDR_P5  0x0F
#define TX_ADDR     0x10
#define RX_PW_P0    0x11
#define RX_PW_P1    0x12
#define RX_PW_P2    0x13
#define RX_PW_P3    0x14
#define RX_PW_P4    0x15
#define RX_PW_P5    0x16
#define FIFO_STATUS 0x17
#define DYNPD       0x1C

/* Bit Mnemonics */

/* configuratio nregister */
#define MASK_RX_DR  6
#define MASK_TX_DS  5
#define MASK_MAX_RT 4
#define EN_CRC      3
#define CRCO        2
#define PWR_UP      1
#define PRIM_RX     0

/* enable auto acknowledgment */
#define ENAA_P5     5
#define ENAA_P4     4
#define ENAA_P3     3
#define ENAA_P2     2
#define ENAA_P1     1
#define ENAA_P0     0

/* enable rx addresses */
#define ERX_P5      5
#define ERX_P4      4
#define ERX_P3      3
#define ERX_P2      2
#define ERX_P1      1
#define ERX_P0      0

/* setup of address width */
#define AW          0 /* 2 bits */

/* setup of auto re-transmission */
#define ARD         4 /* 4 bits */
#define ARC         0 /* 4 bits */

/* RF setup register */
#define PLL_LOCK    4
#define RF_DR_HIGH  3
#define RF_PWR      1 /* 2 bits */

/* general status register */
#define RX_DR       6
#define TX_DS       5
#define MAX_RT      4
#define RX_P_NO     1 /* 3 bits */
#define TX_FULL     0

/* transmit observe register */
#define PLOS_CNT    4 /* 4 bits */
#define ARC_CNT     0 /* 4 bits */

/* fifo status */
#define TX_REUSE    6
#define FIFO_FULL   5
#define TX_EMPTY    4
#define RX_FULL     1
#define RX_EMPTY    0

/* dynamic length */
#define DPL_P0      0
#define DPL_P1      1
#define DPL_P2      2
#define DPL_P3      3
#define DPL_P4      4
#define DPL_P5      5

/* Instruction Mnemonics */
#define R_REGISTER    0x00 /* last 4 bits will indicate reg. address */
#define W_REGISTER    0x20 /* last 4 bits will indicate reg. address */
#define REGISTER_MASK 0x1F
#define R_RX_PAYLOAD  0x61
#define W_TX_PAYLOAD  0xA0
#define FLUSH_TX      0xE1
#define FLUSH_RX      0xE2
#define REUSE_TX_PL   0xE3
#define ACTIVATE      0x50
#define R_RX_PL_WID   0x60
#define NOP1          0xFF

#define nrf24_CONFIG ((1 &amp;lt;&amp;lt; MASK_RX_DR)|(1&amp;lt;&amp;lt;EN_CRC)|(0&amp;lt;&amp;lt;CRCO))

/// hardware spi pin defined
#define LED_PIN      PORTAbits.RA1 // led test
#define CS_Pin       PORTBbits.RB0//          //set port as output
#define CE_Pin       PORTBbits.RB4         //set port as output
#define SCK_Pin      PORTBbits.RB1        //set port as output
#define Mosi_Pin     PORTBbits.RB2         //set port as output
#define Miso_Pin     PORTBbits.RB3        //set port as input
#define HIGH         1
#define LOW          0



void nrf24_ce_digitalwrite(uint8_t state)
{
if (state)
{
CE_Pin = 1;
}
else
{
CE_Pin = 0;
}
}


void nrf24_csn_digitalwrite(uint8_t state)
{
if (state)
{
CS_Pin = 1;
}
else
{
CS_Pin = 0;
}
}


void nrf24_sck_digitalwrite(uint8_t state)
{
if (state)
{
SCK_Pin = 1;
}
else
{
SCK_Pin = 0;
}
}


void nrf24_mosi_digitalwrite( uint8_t state)
{
if (state)
{
Mosi_Pin = 1;
}
else
{
Mosi_Pin = 0;
}
}



/* software spi routine */
uint8_t spi_transfer(uint8_t tx)
{
     uint8_t i = 0;
     uint8_t rs = 0;

    nrf24_sck_digitalwrite(LOW);

    for(i=0;i&amp;lt;8;i++)
    {

        if(tx &amp;amp; 0x80) // msbit first spi standard
        {
            nrf24_mosi_digitalwrite(HIGH);
        }
        else
        {
            nrf24_mosi_digitalwrite(LOW);
        }

        nrf24_sck_digitalwrite(HIGH);

        tx = tx &amp;lt;&amp;lt; 1;
        if(Miso_Pin == 1)
        {
            rs |= 0x01;
        }
        nrf24_sck_digitalwrite(LOW);
    }
    return rs;
}




/* send and receive multiple bytes over SPI */ // checked with mirf
void nrf24_transferSync(uint8_t  *dataout,uint8_t *datain,uint8_t len)
{
    uint8_t i;

    for(i=0;i&amp;lt;len;i++){
       datain[i] = spi_transfer(dataout[i]);
    }
}


//send multiple bytes over SPI // checked with mirf
void nrf24_transmitSync(uint8_t *dataout,uint8_t len)
{
    uint8_t i;

    for(i=0;i&amp;lt;len;i++){
      spi_transfer(dataout[i]);
    }
}

void nrf24_configRegister(uint8_t reg, uint8_t value)
{
    nrf24_csn_digitalwrite(LOW);
    spi_transfer(W_REGISTER | (REGISTER_MASK &amp;amp; reg));
    spi_transfer(value);
    nrf24_csn_digitalwrite(HIGH);
}

void nrf24_powerUpTx() // checked with mirf
{
   // PTX = 1;

    nrf24_configRegister(CONFIG,nrf24_CONFIG|((1&amp;lt;&amp;lt;PWR_UP)|(0&amp;lt;&amp;lt;PRIM_RX)));
    
}


void nrf24_powerUpRx() // checked with mirf
{
   // PTX = 0;
	
    nrf24_configRegister(CONFIG,nrf24_CONFIG|((1&amp;lt;&amp;lt;PWR_UP)|(1&amp;lt;&amp;lt;PRIM_RX)));
	
}

void nrf24_init()
{
	TRISB = 0b00001000;
	TRISA = 0b00000000;
    CMCON  |= 7;
    nrf24_ce_digitalwrite(LOW);
    nrf24_csn_digitalwrite(HIGH);
}


void nrf24_send(uint8_t* value)   // check with mirf
{
    /* Go to Standby-I first */
    nrf24_ce_digitalwrite(LOW);

    /* Set to transmitter mode , Power up if needed */
    nrf24_powerUpTx();
	nrf24_csn_digitalwrite(LOW);
	spi_transfer(FLUSH_TX);
	nrf24_csn_digitalwrite(HIGH);
   

    /* Pull down chip select */
    nrf24_csn_digitalwrite(LOW);

    /* Write cmd to write payload */
    spi_transfer(W_TX_PAYLOAD);

    /* Write payload */
    nrf24_transmitSync(value,3);

    /* Pull up chip select */
    nrf24_csn_digitalwrite(HIGH);

    /* Start the transmission */
    nrf24_ce_digitalwrite(HIGH);

}

/* Read single register from nrf24 */
void nrf24_readRegister(uint8_t reg,uint8_t *value,uint8_t len) //checked with mirf
{
    nrf24_csn_digitalwrite(LOW);
    spi_transfer(R_REGISTER | (REGISTER_MASK &amp;amp; reg));
    nrf24_transferSync(value,value,len);
    nrf24_csn_digitalwrite(HIGH);
	}



uint8_t nrf24_getStatus()    // checked with mirf
{
    uint8_t rv;
    nrf24_readRegister(STATUS,&amp;amp;rv,1);
    return rv;
}


uint8_t nrf24_dataReady() // check with mirf
// checks if data is available for reading

{
    // See note in getData() function - just checking RX_DR isn&amp;#39;t good enough
    uint8_t status = nrf24_getStatus();

 // We can short circuit on RX_DR, but if it&amp;#39;s not set, we still need
    // to check the FIFO for any pending packets
   return status &amp;amp; (1 &amp;lt;&amp;lt; RX_DR);
}


/* Reads payload bytes uint8_to data array */
uint8_t nrf24_getData(uint8_t *data1)  // check with mirf
{
    /* Pull down chip select */
    nrf24_csn_digitalwrite(LOW);

    /* Send cmd to read rx payload */
    spi_transfer(R_RX_PAYLOAD);

    /* Read payload */
    nrf24_transferSync(data1,data1,3);

    /* Pull up chip select */
    nrf24_csn_digitalwrite(HIGH);

    /* Reset status register */
    nrf24_configRegister(STATUS,(1&amp;lt;&amp;lt;RX_DR));
}

/*
uint8_t wl_module_data_ready ( )  
/ / checks if data is available for reading 
{ 
    if  ( PTX )  return  0 ; 
    uint8_t status ; 
    / / Read wl_module status 
    wl_module_CSN_lo ;                                 / / Pull down chip select 
    status = spi_fast_shift ( NOP ) ;                / / Read status register 
    wl_module_CSN_hi ;                                 / / Pull up chip select 
    return status &amp;amp;  ( 1 &amp;lt;&amp;lt; RX_DR ) ; 
}

*/




void main()
{
uint8_t data_array[3];
uint8_t temp; // return status
uint8_t count = 0;
nrf24_init();
nrf24_powerUpRx();

nrf24_csn_digitalwrite(LOW);
spi_transfer(FLUSH_RX);
nrf24_csn_digitalwrite(HIGH);





while(1)
{
while(nrf24_dataReady());
nrf24_getData(data_array); 

if(data_array[0] == 0x6F)
{
LED_PIN = HIGH;
}
else
{
LED_PIN = LOW;
}
}
}


&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF24L01+ PIPE SETTINGS</title><link>https://devzone.nordicsemi.com/thread/6898?ContentTypeID=1</link><pubDate>Mon, 10 Feb 2014 11:49:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c100fdf4-a04f-43c2-aa96-0d43f2bf3211</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You set which role the nRF24L01+ has in the CONFIG register, bit 0 (field called &amp;quot;PRIM_RX&amp;quot;).
This controls if the device is a Primary Receiver (PRX) or a Primary Transmitter (PTX).&lt;/p&gt;
&lt;p&gt;All the other configurations can be left untouched for a simple functional test.
Now you can upload payloads (3 bytes length by default) to the FIFO.
When you then pulse pin &amp;quot;CE&amp;quot; for &amp;gt;10us, the radio will start to transmit the payload over-the-air.&lt;/p&gt;
&lt;p&gt;Check out the &amp;quot;nRFgo SDK&amp;quot; (enhanched_shockburst_examples) if you want to see the flow:
&lt;a href="https://www.nordicsemi.com/eng/Products/2.4GHz-RF/nRFgo-SDK"&gt;www.nordicsemi.com/.../nRFgo-SDK&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s written for our nRF24L-series SoC-parts, but the radio interface is basically the same.&lt;/p&gt;
&lt;p&gt;Best regards
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>