Hi, I'm despair. I am trying to receive data from the device with nRF2402G with a nRF24L01 + module. The old receiver is destroyed. I believe that I have put all the notes from the nRF24L01 + datasheet.
nRF2402G works with these settings:
- RF channel -> 0x38
- RF_PWR -> 0 dBm
- XO_F -> 16 MHz
- OD -> 1 Mbps data rate
- Burst -> Shock Burst
mode
- CRC_EN -> On-chip CRC generation enabled
- CRC_L -> 16 bit CRC
- PRE_EN -> Preamble generation enabled
nRF2402G sends the following data (recording on the nRF2402G lines):
- address: 0x54, 0x30, 0x30
- data: 5 bytes
The software that I have been writing looks like this:
TX_ADR_WIDTH 3
TX_PLOAD_WIDTH 5
TX_ADDRESS[TX_ADR_WIDTH] = {0x54,0x30,0x30}; // Define a static TX address
RX_Mode()
{
nRF24L01_CEL;
DelayUs(10);
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 + SETUP_AW, 0x01); // Setup of Address Widths: '01' - 3 bytes;'10' - 4 bytes;'11' – 5 bytes
SPI_RW_Reg(WRITE_REG + EN_AA,0x00); // Disable Auto.Ack:Pipe0
SPI_RW_Reg(WRITE_REG + EN_RXADDR, 0x01); // Enable Pipe0
SPI_RW_Reg(WRITE_REG + SETUP_RETR,0x00); // Re-Transmit disabled
SPI_RW_Reg(WRITE_REG + RF_CH, 0x38); // Select RF channel frequency
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, 0x06); // Datarate:1Mbps; TX_PWR:'000' – -18dBm;'010' – -12dBm;'100' – -6dBm;'110' – 0dBm
SPI_RW_Reg(WRITE_REG + CONFIG, 0x0F); // Set PWR_UP bit, enable CRC(2 bytes) & Prim:RX. RX_DR enabled
nRF24L01_CEH;
DelayUs(10);
} // end of RX_Mode
TX_Mode()
{
nRF24L01_CEL;
DelayUs(10);
SPI_Write_Buf(WRITE_REG + TX_ADDR, TX_ADDRESS, TX_ADR_WIDTH); // Writes TX_Address to nRF24L01+
SPI_Write_Buf(WRITE_REG + RX_ADDR_P0, TX_ADDRESS, TX_ADR_WIDTH); // RX_Addr0 same as TX_Adr for Auto.Ack
SPI_Write_Buf(WR_TX_PLOAD, cTxbuf, TX_PLOAD_WIDTH); // Writes data to TX payload
SPI_RW_Reg(WRITE_REG + SETUP_AW, 0x01); // Setup of Address Widths: '01' - 3 bytes;'10' - 4 bytes;'11' – 5 bytes
SPI_RW_Reg(WRITE_REG + EN_AA,0x00); // Disable Auto.Ack:Pipe0
SPI_RW_Reg(WRITE_REG + EN_RXADDR,0x01); // Enable Pipe0
SPI_RW_Reg(WRITE_REG + SETUP_RETR,0x00); // Re-Transmit disabled
SPI_RW_Reg(WRITE_REG + RF_CH, 0x38); // Select RF channel frequency
SPI_RW_Reg(WRITE_REG + RF_SETUP,0x06); // Datarate:1Mbps; TX_PWR:'000' – -18dBm;'010' – -12dBm;'100' – -6dBm;'110' – 0dBm
SPI_RW_Reg(WRITE_REG + CONFIG,0x0e); // Set PWR_UP bit, enable CRC(2 bytes) & Prim:TX. MAX_RT & TX_DS enabled
nRF24L01_CEH;
DelayUs(10);
} // end of void TX_Mode
I can send and receive data with the software in the said format between two nRF24L01 + modules, unfortunately, of nRF2402G not.
What did I miss? Where is my mistake?
Best Regards
elektroniker54