Yet Another Nordic nRF24L01 thread
T Chap
Posts: 4,223
I am studying Mark T's Nordic driver found in Duanes thread
http://forums.parallax.com/showthread.php?130707-Looking-for-Faster-Objects-for-Nordic-Wireless-Modules-nRF24L01-and-nRF2401A/page3
I can get Duane's demo to work on the Sparkfun modules. Mark's driver does not include a demo, and is written in PASM. I am purely guessing at a lot of things here. If Mark checks in maybe he can clarify. Otherwise, there is a little confusion regarding the long construction of several parameters. I think have it correct but have tried it in reverse, no luck getting any response on the receiver. I did manage to get some error responses from the driver when putting in bad commands, but this does not insure that the module is communicating, only that the driver was responding with bad commands as it should.
The master code should output a single byte per second $FF. An LED shows that the repeat is working.
On the receiver, an LED should show if the IRQ was pulled low. In fact, if I use the reverse order of long construction, the LED stays on all the time, which cannot be correct. With the order = 0 which I think is correct, it never blinks indicating data received.
If someone could verify the order of my long construction of the various parameters as the PASM code is un packing it, that would at least insure that I have the module configured right.
nordicMasterPASM is my demo that is an attempt at getting the nRF24L01p driver of Marks to work. I have no idea if this is even close.
nordicSlavePASM is the receiver side.
nRF24L01p is Mark's driver as is from the original thread. In the PASM driver section RF_INIT you can see where the longs are unpacked into separate parameters. In my demo, I created options for var ORDER to easily switch between which directions the parameters are packed into the longs. In
Any suggestions appreciated!
http://forums.parallax.com/showthread.php?130707-Looking-for-Faster-Objects-for-Nordic-Wireless-Modules-nRF24L01-and-nRF2401A/page3
I can get Duane's demo to work on the Sparkfun modules. Mark's driver does not include a demo, and is written in PASM. I am purely guessing at a lot of things here. If Mark checks in maybe he can clarify. Otherwise, there is a little confusion regarding the long construction of several parameters. I think have it correct but have tried it in reverse, no luck getting any response on the receiver. I did manage to get some error responses from the driver when putting in bad commands, but this does not insure that the module is communicating, only that the driver was responding with bad commands as it should.
The master code should output a single byte per second $FF. An LED shows that the repeat is working.
On the receiver, an LED should show if the IRQ was pulled low. In fact, if I use the reverse order of long construction, the LED stays on all the time, which cannot be correct. With the order = 0 which I think is correct, it never blinks indicating data received.
If someone could verify the order of my long construction of the various parameters as the PASM code is un packing it, that would at least insure that I have the module configured right.
nordicMasterPASM is my demo that is an attempt at getting the nRF24L01p driver of Marks to work. I have no idea if this is even close.
nordicSlavePASM is the receiver side.
nRF24L01p is Mark's driver as is from the original thread. In the PASM driver section RF_INIT you can see where the longs are unpacked into separate parameters. In my demo, I created options for var ORDER to easily switch between which directions the parameters are packed into the longs. In
Any suggestions appreciated!
Comments
As far as the parameter order, setting order equal to zero is correct.
Dave
EDIT: I noticed your code uses waitcnt after sending a command. The driver clears the value of command after it is done, so you could wait for this by doing a "repeat while command". You should also check the value of error after the command is processed. error will be zero if the command was processed OK, and it will have a nonzero value if there was an error.
The buffer is indeed a pointer to a buffer large enough for the packet size specified at setup. A sequence to setup cleanly into receive mode and start getting packets would be like:
To pick apart the setup, first the paramater block is declared so: All of these MUST be long, and MUST be in this sequence - only the address of the first is passed to the nRF cog so it cannot find the others unless they are in the right sequence.
The setup parameters are encoded so: This starts up the cog and it will initialize and start waiting for commands. The args1 and args2 are split into bytes - there are 6 byte sized parameters encoded in them, 4 in args1 and 2 in args2.