SparkFun Forums 

Where electronics enthusiasts find answers.

All things pertaining to wireless and RF links
By fgcity
#30408
Hi guys. I have the NRF 24G kit and i have a custom PCB with the same CHIP.

I wrote the code and the Reciever(From the kit) recieves the data fine when i send it from my PCB.

But with the same code My PCB doesn't recieve anything.

How do you determin when the data has arrived? Could someone explain it to me?

I have the Reciever Config and then i send the Data Recieve code and fill up the Data Array with 4 bytes from the DATA1 . But the array is empty.

am i doing something wrong?

PS: i can't post code since it's in BASIC.
By fgcity
#30410
nRF2401
By fgcity
#30411
here is the code. It's pretty simple so i don't think it's hard to understand.

'************************
'* RF Recieve Data *
'************************

RF_Recieve_Data:

'Power down RF Front end

Output RF_CE

Low RF_CE


'Erase the current data array so that we know we are looking at actual received data

'RF_Data_Array[0] = $00

'Clock in data, we are setup for 32-bit payloads

For j = 0 To 3

RF_Data_Temp.0 = RF_Data1
High RF_CLK1
Low RF_CLK1

RF_Data_Temp.1 = RF_Data1
High RF_CLK1
Low RF_CLK1

RF_Data_Temp.2 = RF_Data1
High RF_CLK1
Low RF_CLK1

RF_Data_Temp.3 = RF_Data1
High RF_CLK1
Low RF_CLK1

RF_Data_Temp.4 = RF_Data1
High RF_CLK1
Low RF_CLK1

RF_Data_Temp.5 = RF_Data1
High RF_CLK1
Low RF_CLK1

RF_Data_Temp.6 = RF_Data1
High RF_CLK1
Low RF_CLK1

RF_Data_Temp.7 = RF_Data1
High RF_CLK1
Low RF_CLK1


RF_Data_Array[j] = RF_Data_Temp Rev 8

Next

'Power up RF Front end

High RF_CE

Return


'************************
'* RF Config Recieve *
'************************

RF_Config_Recieve:

'Configure For "ShockRebust" Reciever

Output RF_CE
Output RF_CS
Output RF_CLK1
Output RF_Data1


Low RF_CE
Low RF_CS
Low RF_Data1
Low RF_CLK1
Low RF_DR1

Low RF_CE
High RF_CS

DelayMS 1

'Config Setup word 0010.0011.0100.1110.0000.0101

RF_Config_Setup[0] = %00000101
RF_Config_Setup[1] = %01001110
RF_Config_Setup[2] = %00100011

RF_Config_Setup_Temp = RF_Config_Setup[2] Rev 8

For i = 0 To 7

RF_Data1 = RF_Config_Setup_Temp >> i
High RF_CLK1
Low RF_CLK1

Next

RF_Config_Setup_Temp = RF_Config_Setup[1] Rev 8

For i = 0 To 7

RF_Data1 = RF_Config_Setup_Temp >> i
High RF_CLK1
Low RF_CLK1

Next

RF_Config_Setup_Temp = RF_Config_Setup[0] Rev 8

For i = 0 To 7

RF_Data1 = RF_Config_Setup_Temp >> i
High RF_CLK1
Low RF_CLK1

Next

'Configuration is actived on falling edge of CS (page 10)

Low RF_CE
Low RF_CS

'After configuration of the receiver, we need DATA1 as an input


Input RF_Data1
Input RF_DR1

Low RF_DR1

DelayMS 1

'Start monitoring the air

High RF_CE
Low RF_CS

Return





The Transmission from the Chip is fine

so i made a small loop so basicly i don't clear the Data Array and send out what i recieve.

but it doesn't send anything that way.

But if i just Send out Something loke "Y" then the PC Recieves it fine
By fgcity
#30413
Flase Alarm:

I forgot that to unload the data i have to wait for DR1 to come High :))

All is well now.

Tnx for the help Guys
By fgcity
#30414
PS also i forgot that after setting CE High the Tranciever needs to settle for 200ms :)
By fgcity
#30436
i have just one last question.

The program (V2) on the Kit is using Serial to send out ASCII characters.

I noticed that it is using only the first byte of the 32 bit array (8 bits)

So the other 3 bytes of the aray are empty.

But i could send out all 32 Bits. Is that correct ?
By fgcity
#30443
my Adress now is : %11100111 for what Size is this set up ?
By brennen
#30445
On page 21 of the datasheet, you can see that a value of %11100111 would mean that you have CRC enabled and it's set at 16 bit, and that your address width is %111001, or 57 in decimal, which is actually an invalid value for this register (the maximum is 40 decimal). Did you possibly make a typo?
By fgcity
#30449
no, that's how it is the the Demo Code

//Clock in address
rf_address = 0b.1110.0111; //Power-on Default for all units (on page 11)
By fgcity
#30454
the demo Code is setup to fill up 4 byte of the Data Array. (32 bits)

when i check on the reciever end then only the first Byte of the array is filled with a ASCII Character.

So that means that the demo board is filling only 1 Byte and sending it. But with the same setup i could fill up all 4 bytes and recieve them. am i correct ?
By brennen
#30457
All you would have to do is to make sure that at the receiver that you are set up to receive 32 bits per payload. Then, at the transmitter you would simply transmit the 32-bit array as your payload. I can't really tell you whether it's set up that way or not in the example code, but you should be able to figure it out by examining what value is going into your receiver's DATAx_W register. If that value is 32 bits, then you're golden and can make your own code send 32 bits. If not, you need to change it.