NRF24L01!

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

NRF24L01!

Post by jgu1 »

Hi !

I can see that in FC7 included component NRF23L01 :D . I really like to use it, but I have no experience with this and don´t know how to start.

Before I started to experiment with this and spend hours on it, I'll hear about the MM has tested the component. :wink:

And please a litlle starthelp,

What is Pipeadress? Openwriteadress, Openreadingadress and setPipeAdress and how to use. Has it something to do with identification, node?

I know MM guys is busy, but how long is the schedule for the help function for FC7? And will there be, as in FC6 get some good examples of the different components. A simple example of just sending and receiving a number would be fine.

Thank´s in advance

Best regard

Jorgen

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: NRF24L01!

Post by Benj »

Hi Jorgen,

I'll see if I can get some examples created for you.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: NRF24L01!

Post by jgu1 »

Hi Ben!

Thank you. I Will be really gratefull. Only a simple examble, maybe to Remote control an output, on/OFF. :D


Best regard

Jorgen

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: NRF24L01!

Post by Benj »

Hi Jorgen,

I really didn't like the current state of the component. The code came from an Arduino library and it just felt a bit too unwieldy and complicated.

So I've re-written the component to heavily simplify it based on the working example posted here by MJU.
http://www.matrixtsl.com/mmforums/viewt ... l01#p71942

The latest component file is here, simply copy the file to your "Flowcode 7/Components" directory and restart Flowcode.
nRF24L01.fcpx
(11.45 KiB) Downloaded 614 times
Here are some example programs to show you how to send and receive data.
NRF24L01_RX_Example1.fcfx
(8.32 KiB) Downloaded 660 times
NRF24L01_TX_Example1.fcfx
(8.69 KiB) Downloaded 652 times
A new updated wiki page has been created for the new component here.
http://www.matrixtsl.com/wikiv7/index.p ... (Wireless)

Let me know how you get on.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: NRF24L01!

Post by jgu1 »

Hi Ben!

Thank you thank you, very much for your big job. :D :D I am not home before the weekend, but as soon I am home I make a test with your component and program and you hear from me.

Great :lol:

Jorgen

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: NRF24L01!

Post by jgu1 »

Hi Ben!

Unfortunately it is not working. :(

Let me tell you what I have done.
RX:
First I overwrite the fcdx file in the component lib. Then I programmed the chip and I can see that is running, while in the display I see "Init OK". For the rx module I have exactly 3,3 Volt for supply, and I have added a 10uF capacitor on the supply for the module. ( can see in different forum they recommend this) Check and check the wiring again. The only thing I not have connected is IRQ.
TX:
The same have I done on the TX. I also suppose that the program is running there, because when I press a digit on the keypad A0 go high. I can see with my scoope a short puls is coming out on the different data pin when I press a digit on the keypad.
The NRF module is new and the distance between them is max 1 Meter.

Sorry!

Br. Jorgen

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: NRF24L01!

Post by Benj »

Hello,

Right I'll get my fine comb out and see if I can spot any problems in the code. I also have some of these modules at home so if I get time I will double check things at my end. I have one module sat in front of me on my desk, however one is not enough to do anything meaningful other than check the initialise comms are ok.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: NRF24L01!

Post by jgu1 »

Thanks Ben!

Br

Jorgen

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: NRF24L01!

Post by Benj »

Right I've made a test rig and been through the code carefully now.

I have found two problems with the current component code.

1) There was no SPI prescaler property so no way to control the SPI speed. This has now been added.

2) The CE pin was being driven high at the end of the RX init in MJU's example and I had missed this. This has now also been added.

Even with the two improvements listed above it's still not working for me? Hmmm.

Latest component file.
nRF24L01.fcpx
(11.61 KiB) Downloaded 465 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: NRF24L01!

Post by Benj »

Scratch that, it's working now.

Had missed another pin change in the initialise.
nRF24L01.fcpx
(11.6 KiB) Downloaded 498 times
Here are the working examples, note that the FIFO size is 32 bytes, I think this is important so I'm going to try and make this more flexible now.
NRF24L01_RX_Example1.fcfx
(8.51 KiB) Downloaded 517 times
NRF24L01_TX_Example1.fcfx
(8.69 KiB) Downloaded 497 times
Edit: Yes confirmed buffer sizes other than 32 bytes don't work. I'll see if I can find a way to edit this but for now it works well if you always send and receive 32 bytes at once.

electron67
Posts: 311
Joined: Sat Jan 12, 2008 2:08 am
Has thanked: 104 times
Been thanked: 47 times
Contact:

Re: NRF24L01!

Post by electron67 »

Hi Benj

this component is possible to apply to flowcode 6 ?

Enrique

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: NRF24L01!

Post by Benj »

Hello Enrique,

Sorry this is a new component for Flowcode v7 and so not available in Flowcode v6.

We still support Flowcode 6 but we won't be generating any new content for it.

The v7 component is based on the v6 example by MJU.
http://www.matrixtsl.com/mmforums/viewt ... 78&p=71942

electron67
Posts: 311
Joined: Sat Jan 12, 2008 2:08 am
Has thanked: 104 times
Been thanked: 47 times
Contact:

Re: NRF24L01!

Post by electron67 »

Ok thanks Benj

I hope soon to buy flowcode 7

Enrique

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times
Contact:

Re: NRF24L01!

Post by JohnCrow »

Hi Ben

On your FC component properties you have Port D.1 connected to SCK and on the bottom line its called CLK Remap. Why the 2 different names?
1 in 10 people understand binary, the other one doesn't !

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: NRF24L01!

Post by jgu1 »

Hi Ben!

I have first seen your corrections now. I Will run a test tomorrow evening. I dont know if Johns observations have Any influence on the program.

Thank's in advance to both of you.

Yes Enrique, buy FC7. Many good benefits, and among this, fast compiling. :D

Br. Jorgen

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: NRF24L01!

Post by Benj »

Hi John,
On your FC component properties you have Port D.1 connected to SCK and on the bottom line its called CLK Remap. Why the 2 different names?
The three hardware SPI pins MOSI, MISO and SCK are greyed out and set by the internal wiring of the microcontroller.

On the microcontroller I am using the SPI is "Remappable" meaning you can shift the pins around which then creates the second set of properties.


The First greyed out SCK pin is our usual this is where the SCK is connected to indicator.

The second none greyed out SCK pin assigns where we are mapping the SCK pin and should be reflected by the first greyed out property.


Ideally there shouldn't be two properties but I didn't just want to hide the standard SCK property in case that confused anyone.

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times
Contact:

Re: NRF24L01!

Post by JohnCrow »

The boards should be here tomorrow.

I've ordered a pair of Sparkfun BOB's with a SMA connector and built in voltage regulator so they can be run from the 5v supply and a pair of 2.4GHz rubber duck aerials to match.

At least I will know they are going to work. (unlike a Chinese special that may have problems :roll: )

Hopefully I will get a decent signal between them too with these aerials. (2.2dBi Gain)

Will post my results once tested.
1 in 10 people understand binary, the other one doesn't !

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: NRF24L01!

Post by jgu1 »

Hi Ben and john!

In contrast to the first exemplary Tx and Rx was all set. Both in chip and component macro.

Now I can´t find in component macro TXmode and RX, where I have to place the
adress :
0x11
0x11
0x11
0x11

I thing I wait until I can test with John´s examble, if ok. I have not experience with these device. Thank´s John.

Best regard

Jorgen

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times
Contact:

Re: NRF24L01!

Post by JohnCrow »

Hi Jorgen
I've not used these yet myself will be starting with Bens sample flowcharts and go from there.
Should be interesting project.
1 in 10 people understand binary, the other one doesn't !

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: NRF24L01!

Post by Benj »

Hello,
In contrast to the first exemplary Tx and Rx was all set. Both in chip and component macro.

Now I can´t find in component macro TXmode and RX, where I have to place the adress :
0x11
0x11
0x11
0x11
The address is set in the examples as part of the SetTxMode or SetRxMode macros.

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times
Contact:

Re: NRF24L01!

Post by JohnCrow »

My new NRF2401 boards & aerials have arrived.

Tested using Bens component and FC programs, Though tweaked to use a pair of EB006V9s and PIC16F1937's as I don't have a EB091.

Pleased to report it works fine sat on the bench. Now to see what sort of distance it will connect over.

Before Soldering Headers
Before Soldering Headers
Board.JPG (85.77 KiB) Viewed 20354 times
Rubber Duck.JPG
Rubber Duck.JPG (56.8 KiB) Viewed 20354 times
1 in 10 people understand binary, the other one doesn't !

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: NRF24L01!

Post by jgu1 »

Hi John!

Glad it work´s for you. Do you want to share your (Ben´s) testprogram. Then I know for sure that these file you have testet work´s and all config is ok?

Yes mine is from Ebay, maybe I should buy some like yours.

Thank´s in advance

Jorgen

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times
Contact:

Re: NRF24L01!

Post by JohnCrow »

Hi Jorgen

You are welcome to the test programs.
They are basically the same as Bens, except they are for a 16F1937

Ben's programs are further up the page.

Pin Outs

EB006 - RF Board
C2 - CE
C3 - SCK
C4 - MISO
C5 - MOSI
C7 - CSN
NRF24L01_RX_Example1_PIC.fcfx
(8.57 KiB) Downloaded 414 times
NRF24L01_TX_Example1_PIC.fcfx
(8.75 KiB) Downloaded 386 times
The boards were about £15.00 each and the rubber duck aerials about £4.00
Plus having a 5V regulator on board they can run directly of the EB 006 without any extra components.
1 in 10 people understand binary, the other one doesn't !

electron67
Posts: 311
Joined: Sat Jan 12, 2008 2:08 am
Has thanked: 104 times
Been thanked: 47 times
Contact:

Re: NRF24L01!

Post by electron67 »

HI Jorgen, John and Benj

You know the maximum distance range of NRF24L01 using it on the street :?:
I'm using ZigBee mentioned a range of 1 km but in the city is 80 meters and the cost is 40 dlls each; and the nrf24l01 have to cost of 3 to 5 dlls each. . .

Thanks
Enrique

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: NRF24L01!

Post by jgu1 »

Hi all!

Thank's John for sharing. I'll test it later today.

And Enrique, yes I know all these small devises, but no have no experience with these, but like to learn about it, i Think they are a little tricky. :wink:

Br

Jorgen

Post Reply