I am in the process of testing out a couple nRF24L01+ modules, but am having some difficulties. First I will explain what I am trying to accomplish with this test:
I have 2x propellers, each fitted with its own nRF24L01+ module. One of them is going to just be listening and the other one is just going to be transmitting. The one used for listening is connected to computer via usb cable and has parallax serial terminal running to view what has been received.
Here is a photo showing the setup (I am using the surface mount version of the nRF24L01+, so I just soldered it to an adapter board so I could plug it in):
I read through this tutorial:
And I used this as another reference:
I also found this driver & demo in the parallax object exchange:
This object only has the receive portion implemented, so I began modifying it to get a transmit working. I attached all of my code so far.
Using the provided nRF24L01 object, all I am receiving is "00000000", sometimes it takes a couple seconds to get a payload, sometimes I get multiple payloads per second, but they are always all zeros. This is without transmitting anything on the 2nd propeller by the way.
When I do run the 2nd propeller in an attempt to transmit, nothing changes in the receiving portion, still all zeros. Obviously I don't have something configured correctly.
I wanted to add in the functionality so that when the IRQ pin goes low (interrupt pin - indicating an event) I could pull in the status from one of the registers to see what it says. I couldn't figure out how to read the status register.
So I started going through the initializing code in the nRF24L01 object, and it does not seem like the configuration procedures are initializing the correct addresses? For instance look at the "Set PRX, CRC enabled". It sets CNS pin to low, it then sends "$20", followed by "$39". Looking at the sparkfun documentation (page 57 of 78) doesn't it mention that the address is "$00" and not "$20"? So I understand how the "$39" equals to "0011 1001" which corresponds to the settings in the table.
I figured the first step that I should do is to make sure that I can write these settings to the registers, and then read back the settings from the registers for a sanity check, then I can move on to the next step.... but I am having difficulty figuring out how to do that.
Also, do I need to insert some kind of a wait instruction after setting the CE or CSN pins high or low?
I attached my code so far, I would greatly appreciate any insight you might have, thanks!