Data Sheet

VMA322
V. 01 12/03/2018 11 ©Velleman nv
SPI_RW(*pBuf++);
}
SPI_PORT|=CSN; // Set CSN high again
return(status); // return nRF24L01 status unsigned char
}
/**************************************************/
/**************************************************
* Function: RX_Mode();
*
* Description:
* This function initializes one nRF24L01 device to
* RX Mode, set RX address, writes RX payload width,
* select RF channel, datarate & LNA HCURR.
* After init, CE is toggled high, which means that
* this device is now ready to receive a datapacket.
/**************************************************/
void RX_Mode(void)
{
SPI_PORT&=~CE;
SPI_Write_Buf(WRITE_REG + RX_ADDR_P0, TX_ADDRESS, TX_ADR_WIDTH); // Use the same address on
the RX device as the TX device
SPI_RW_Reg(WRITE_REG + EN_AA, 0x01); // Enable Auto.Ack:Pipe0
SPI_RW_Reg(WRITE_REG + EN_RXADDR, 0x01); // Enable Pipe0
SPI_RW_Reg(WRITE_REG + RF_CH, 40); // Select RF channel 40
SPI_RW_Reg(WRITE_REG + RX_PW_P0, TX_PLOAD_WIDTH); // Select same RX payload width as TX
Payload width
SPI_RW_Reg(WRITE_REG + RF_SETUP, 0x07); // TX_PWR:0dBm, Datarate:2Mbps, LNA:HCURR
SPI_RW_Reg(WRITE_REG + CONFIG, 0x0f); // Set PWR_UP bit, enable CRC(2 unsigned chars) &
Prim:RX. RX_DR enabled..
SPI_PORT|=CE; // Set CE pin high to enable RX device
// This device is now ready to receive one packet of 16 unsigned chars payload from a TX device sending
to address
// '3443101001', with auto acknowledgment, retransmit count of 10, RF channel 40 and datarate = 2Mbps.
}
/**************************************************/
// Code End
Now, power on both Arduino
®
and connect the RX to the PC via USB. Open the IDE serial port monitor, change
the baud rate to 9600 bps, and you can see the received data.
If you want to change the Arduino
®
pin connection to the module, just modify the definition on the nFR24L01.