This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Saturday, August 20, 2016

nRF24L01+

The nRF24L01+ is a single chip 2.4GHz transceiver with an embedded baseband protocol engine (Enhanced ShockBurst™), suitable for ultra low power wireless applications.
Looking in eBay I found the nRF24L01+ in three different modules. I bought the smd module, but for testing is better the module with pin header.  


Description of library.

Initializes the nRF24L01 module.
NRF24L01_Init(mode, rf_channel)
  • mode: Sets RX_MODE or TX_MODE.
  • rf_channel: Sets the channel to be used.
Example:
NRF24L01_Init(TX_MODE, 0x20);

Sends a data from Transmitter to Receiver. 
NRF24L01_SendData(buffer)
  • buffer: Data to be sent.
Example:
unsigned char data[32] = {'P', 'I', 'C', '1', '8', 'F', '4', '5', '5', '0'};
NRF24L01_SendData(data);

Reads the interrupt.
NRF24L01_DataReady(void)
This function reads the STATUS and returns a 0 logic if the receiver got a new data.
  • return 0: When is available  a data.
  • return 1: When  isn't available a data.
Example:
while(NRF24L01_DataReady()){}

Reads a data received from transmitter. 
NRF24L01_ReadData(buffer)
  • buffer: Saves the data received. 
Example:
unsigned char buffer1[32];
while(NRF24L01_DataReady()){}
NRF24L01_ReadData(buffer1);


Sets the nRF24L01 as RX or TX mode.
NRF24L01_SetMode(mode)

  • mode: Sets RX_MODE or TX_MODE.
Example:
NRF24L01_SetMode( RX_MODE);

 
Sets a channel.
NRF24L01_SetChannel(rf_channel)
  • rf_channel: Sets a new channel.
Example:
NRF24L01_SetChannel(0x45);

Gets the channel used
NRF24L01_GetChannel(void) 
  • return the channel used.
Example:
unsigned char channel;
channel = NRF24L01_GetChannel();

Example 1. Simplex communication.
This video shows a system simplex, where the transmitter sends a byte to receiver. The receiver gets the byte and set the value binary at the PORTB.