SparkFun Forums 

Where electronics enthusiasts find answers.

All things pertaining to wireless and RF links
By fgcity
#35037
Hi guys.

I have a question about the configuration of the nRF 2401A.

On the Demo Code that Sparkfun gives the configuration is:

23: 0 Payloads have an 8 bit address
22: 0
21: 1
20: 0
19: 0
18: 0
17: 1 16-Bit CRC
16: 1 CRC Enabled

15: 0 One channel receive
14: 1 ShockBurst Mode
13: 0 250K Transmission Rate
12: 0
11: 1
10: 1
9: 1 RF Output Power
8: 0 RF Output Power

7: 0 Channel select (channel 2)
6: 0
5: 0
4: 0
3: 0
2: 1
1: 0
0: 0 Transmit mode

The part that i am interrested in is:

23: 0 Payloads have an 8 bit address
22: 0
21: 1
20: 0
19: 0
18: 0
17: 1 16-Bit CRC
16: 1 CRC Enabled

Now here the payload is set to 8 bits (1 byte)

But thurther down the code the Transmission and Reception output 4 bytes:

//Erase the current data array so that we know we are looking at actual received data
data_array[0] = 0x00;
data_array[1] = 0x00;
data_array[2] = 0x00;
data_array[3] = 0x00;

//Clock in data, we are setup for 32-bit payloads
for(i = 0 ; i < 4 ; i++) //4 bytes
{
for(j = 0 ; j < 8 ; j++) //8 bits each
{
temp <<= 1;
temp.0 = DATA1;

CLK1 = 1;
CLK1 = 0;
}

data_array = temp; //Store this byte
}

But the configuration is set up for 8 bit payload and not 32.

am i correct here?

So basicly the Cycle of 4 bytes is unnessesary since only the first byte is sent.

Is this correct ?
By ttabbal
#35043
If I'm reading the code correctly, they are setting the destination address to 8-bits. That's not the same as the payload size. IIRC the datasheet for these things says that you send 32bit payloads with a configurable address size. So the data you see from the user side is the 32-bit (4 byte) payload they are sending in that nested for loop. The 8 address bits are sent to the module, but it only uses it to let the receiver it's trying to talk to know that the data is for them.

The addresses are a way to make the link reliable, you have to receive a packet of the right length, with the right address, with a proper CRC before the module will tell your program that there is data to read. That way, the channel can be noisy and you won't notice. And at 2.4Ghz, the channel is probably noisy. You can also have 2 receivers listening to only the packets addresses to them from a single transmitter.
By fgcity
#35080
Tnx. I get it now.

Your help is really appreciated.