Go Down

Topic: Finally Working code for se8r01(similar nrf24l01) 2mps, 1mps and 500kps (Read 1 time) previous topic - next topic

swe-dude

Hello i finally got the se8r01 so work on all speeds, if you have looked you know information abut this chip are really scarce, a few days ago i found the last piece of the puzzle in this thread:
http://bbs.ai-thinker.com/forum.php?mod=viewthread&tid=407
 I cant read the language(but if you can say thx from me will ya) but the code i can almost understand and when i added the calibration and initiation from there to my code it just worked.

The chip are sold on ebay, aliexpress mm as nrf24l01 or as nrf24l01 similar it looks like this:


The connections on the small ship are the same as the small nrf chip like this:


The connection on the bigger one are also the same as on nrf24l01

The code uses dynamic payloads and the receiver are set for multi receiver mode and can receive data on all 6 pips.
I used software spi for this code so you can change the pins to whatever you like its a bit slower then  hardware spi but should be no problems for sending sensor data or similar.

You will see some information abut the received transmission in the serial monitor:
Code: [Select]
SS= -59  pip: 4 rx buff with= 5 data=  40 0 0 0 160   transmission counter: 40 rt packets: 0
 SS= -58  pip: 4 rx buff with= 5 data=  41 0 0 0 160   transmission counter: 41 rt packets: 0
 SS= -57  pip: 4 rx buff with= 5 data=  42 0 0 0 160   transmission counter: 42 rt packets: 0
 SS= -57  pip: 4 rx buff with= 5 data=  43 0 0 0 160   transmission counter: 43 rt packets: 0
 SS= -58  pip: 4 rx buff with= 5 data=  44 0 0 0 160   transmission counter: 44 rt packets: 0
 SS= -60  pip: 4 rx buff with= 5 data=  45 0 0 0 160   transmission counter: 45 rt packets: 0
 SS= -59  pip: 4 rx buff with= 5 data=  46 0 0 0 160   transmission counter: 46 rt packets: 0
 SS= -57  pip: 4 rx buff with= 5 data=  47 0 0 0 160   transmission counter: 47 rt packets: 0


SS is the received signal strength I'm not sure how accurate it is but its there.
pip is the pip the data was received on 4 in this case, buff with how many bytes data, and data prints the bytes received. the rest is specific depending on code added for each pip, like this:

Code: [Select]
else if(pip==4)
  {
 memcpy(&myData_pip4, rx_buf, sizeof(myData_pip4));
 Serial.print(" transmission counter: ");
 Serial.print(myData_pip4.counter);
 Serial.print(" rt packets: ");
 Serial.print(myData_pip4.rt&B00001111);

    }
   


I'm using data structs and memcpy to send different kinds of data so just add whatever you want to send in:

Code: [Select]
struct dataStruct{
  unsigned long counter;
  byte rt;
}myData;

(on both tx and rx side...)
And with any luck it should just work

Thats it ,i think just try it and good luck.

The code are attached below. Here is the original data i got when i bought the chip, the data sheet in there might be a bit useful if you want to change something:https://www.dropbox.com/s/o0n9ragvmhvod0n/1.5%E5%85%83%E6%A8%A1%E5%9D%97%E8%B5%84%E6%96%99.rar?dl=0



prediger

 :)

A redesigen of the the working code.

5 Byteaddressing works.

Three parameter you have to set fix in your hole projekt.

4 or 5 Byteaddressing
Carier alwas on
and RF-Speed

The Setup is on the top of the se8r01.h
Code: [Select]

/**************************************************/
//Global projekt settings of se8r01 chip
#define SE8R01_Use5ByteAdr  1 //0: 4Byte 1: 5Byte
#define SE8R01_CONT_WAVE    0 //if on use _BV(Se8Bit_CONT_WAVE)
//for selecting speed
#define SE8R01_DR_500K true
//#define SE8R01_DR_1M true
//#define SE8R01_DR_2M true
///////////////////////////////////////////////////////////////////////////////////////


cu Chrisof

Go Up