Correction in nRF24L01 component

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

Moderator: Benj

Post Reply
User avatar
sysprofessional
Posts: 54
Joined: Sat Oct 26, 2013 7:16 pm
Has thanked: 28 times
Been thanked: 4 times
Contact:

Correction in nRF24L01 component

Post by sysprofessional »

Dear BenJ,
The component nRF24L01 in FC8 working fine but there is a little bug in Initialise macro for RF_CH register.
you wrote value 76 in register 0x40 for universally safe frequency (2.476MHz).While the required register value is (0x05+0x20 = 0x25)

MX_UINT16 FCD_0e0f1_nRF24L01__Initialise()
{
//Local variable definitions
MX_UINT16 FCL_TEMP;
MX_UINT16 FCR_RETVAL;


// ce_pin = 0
SET_PORT_PIN(C, 0, 0);

FCI_DELAYBYTE_US(40);

FC_CAL_SPI_Master_Init_1();

FCI_DELAYBYTE_US(40);

FCD_0e0f1_nRF24L01__WriteRegister(0x24, 0x4F);

FCD_0e0f1_nRF24L01__WriteRegister(0x26, 0x07);

FCD_0e0f1_nRF24L01__WriteRegister(0x3C, 0x00);

FCD_0e0f1_nRF24L01__WriteRegister(0x27, 0x70);

FCD_0e0f1_nRF24L01__WriteRegister(0x40, 76);

FCD_0e0f1_nRF24L01__FlushRx();

FCD_0e0f1_nRF24L01__FlushTx();

return (FCR_RETVAL);

}

According datasheet the register range between (0x00 - 0x1D). nRF24L01 has no register with address of 0x40. So this command is useless. Module will always configure at default value 0x02 (2.402MHz). That's why working fine but not at safe frequency.
Untitled-1.png
(12.36 KiB) Downloaded 2003 times

mnf
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Correction in nRF24L01 component

Post by mnf »

See also viewtopic.php?f=63&t=18962&hilit=Nrf
Where I mention this in one of the examples.

There is also an example using Shockburst and variable length packets which may be useful to you?

User avatar
sysprofessional
Posts: 54
Joined: Sat Oct 26, 2013 7:16 pm
Has thanked: 28 times
Been thanked: 4 times
Contact:

Re: Correction in nRF24L01 component

Post by sysprofessional »

Thanks mnf,

btw i was already made it using FC6 before launching the FC7 and its working nicely for me in both modes.

Basically my goal is to indicate the register 0x40 .Matrix team used it for RF_CH register (plz correct me if i'm wrong)

mnf, here is the small peace of code from your example of initialise macro.


FCD_0e0f1_nRF24L01__WriteRegister(0x27, 0x70);

FCD_0e0f1_nRF24L01__WriteRegister(0x40, 64); // Anyone know what this does?

FCD_0e0f1_nRF24L01__FlushRx();

you did not explain about this register,

BR
Syspro

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: Correction in nRF24L01 component

Post by Benj »

Hello,
you wrote value 76 in register 0x40 for universally safe frequency (2.476MHz).While the required register value is (0x05+0x20 = 0x25)
Thanks for letting me know.

I have now made the changes you suggested and pushed them to the v8 update system.

mnf
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Correction in nRF24L01 component

Post by mnf »

I just added a comment querying the line! It was a long time ago!

The block read/write macros make for a neater interface though!

Martin

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

Re: Correction in nRF24L01 component

Post by electron67 »

Hi Benj

This update of the component NRF24L01, is also needed for Flowcode 7 for a good operation ?

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: Correction in nRF24L01 component

Post by Benj »

Hi Enrique,

I've added the fix to v7 and made the update available here.
viewtopic.php?f=63&t=19743

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

Re: Correction in nRF24L01 component

Post by electron67 »

Hi Benj

I am working with an irrigation system in which I use this transmitter; in fact if it works fine, but I notice that sometimes it takes a little longer to turn it off or on, I hope that with this update of the transmitter the reception will be refined.

Thanks Benj

DCW
Posts: 64
Joined: Mon Sep 28, 2015 8:19 pm
Has thanked: 14 times
Been thanked: 10 times
Contact:

Re: Correction in nRF24L01 component

Post by DCW »

Hello ALL... I read the datasheet given to me... off the internet... and I believe that MatrixTsl's rendition of this component... is GOOD.!!! To say the least... but very confusing... and POOR.... when one realizes that there is so much of the NRF24L01 not catered for in the component..!! OR AM WRONG..????

Is this on purpose..?????.. have I missed something...??? am I asking for too.... much..???

Is there anyone out there - in this great big MatrixTsl Forum system.... that could venture to help me... create a NRF24L01 component... that caters for the whole NRF24L01 device operation.???

It's fine having only one PIPE ADDRESS .. with 5 bytes ... filled in... and using it like that... but what about the other 5 PIPE ADDRESS functions... so that one may use the NRF24L01 to it's fullest... and have all the functionality....

Surely - there is someone out there that can write such a component... what about the "big guns" in embedded software C coding...??? There must be dozens of those people...????... WOW what a challenge....????

Please someone... can - anyone help...??? ..

The poor little NRF24L01 .... would be so smart to be able to work ... I will say properly... (I hate that word... it's a very bad adverb)... rather say correctly..!!!

Liam from MatrixTsl says his engineers - are far to busy to do a proper job...

Can I throw the challenge out to anyone that can create this component... please..???

I will contact as many technical magazine company publishers as possible... and also as many other internet based ... embedded software engineers .. in C code as possible.. and see what I can get going.... cause FLOWCODE is a damn fine program... I have taught children in grade 0 ... and showed them how, and what FLOWCODE can do... Boy OH Boy - is there time to sleep...hmmm... not with those guys...

Thanks for reading this.... people....

Have any other people got something to add.... please PM me if you like....!!!
My Kindest Regards
DCW ....(Damn Clean Water .... Distiled and molecularly neutral Clean Water).....

User avatar
celebriums
Posts: 125
Joined: Sun Sep 25, 2016 3:50 pm
Has thanked: 71 times
Been thanked: 33 times
Contact:

Re: Correction in nRF24L01 component

Post by celebriums »

Hi All
@electron67
Did the nRF24L01 component work correctly? I'm thinking of using it in a project.
Sincerely Regards
Sadık SUME

www.kaandesign.com.tr

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

Re: Correction in nRF24L01 component

Post by electron67 »

HI,

I have not updated the files yet, I am still working with the previous version, but if the component works perfectly.

Enrique

Post Reply