I'm writing code for an rc plane and using an arduino uno as the transmitter and a pro micro as the receiver on the plane, I connected an nrf24l01+ to the uno using a schematic i found online
and connected the pro micro like this, but I am using a 5V version, so I stepped the voltage down to about 3V with a voltage divider.
I tried to write my own code, tried to take code from the internet but nothing seems to work, this is some test code I ran, maybe one of you can point out why it wouldn't work. I checked that i connected everything correctly and both of the boards run any other code just fine. I'm starting to think that one or both of the nrf24l01+ are damaged.
Can you post schematics of both your circuits, do not use Fritzy pictures?
A image(s) of hand drawn schematics will be fine, please use component names and pin lables as well as you power supplies.
If you are using a potential divider to drop 5V to 3V3 supply for the NRF, that will not work as you have no voltage regulation.
Are you really using the NRF24l01 + units, the ones with antenna and power amplifier on the same PCB?
Can you please post some pictures of your project?
The first observation is that your code shows that you have the CE pin of the NRF24l01 assigned to pin 9 of the Pro Micro. Yet your diagram shows that you have the CE pin of the NRF24l01 connected to pin 8 of the Pro Micro. This certainly prevents the NRF24l01 from working
The second observation the Vcc pin of the Pro Micro can be either 3.3V for an 8MHz version or 5v for a 16MHz version. Do you know which version you are using?
The NRF24l01 designed operating voltage range is between 1.9 - 3.6 volts. If you have a 16Mhz version of the Pro Micro this is outputting 5V on the Vcc pin you will destroy the NRF24l01.
I've also found using the following settings within the Setup improved reliability considerably -
radio.setDataRate(RF24_2MBPS); // Set the speed of the transmission to the quickest available
radio.setChannel(124); // Use a channel unlikely to be used by Wifi, Microwave ovens etc
radio.setPALevel(RF24_PA_MAX); // Set radio Tx power to MAX
Sorry, my bad I did have the CE connected to the 9th pin, but missed it when including the schematic. I do have the 5v version of the Pro Micro, but used one 2K and one 1K resistor in a voltage divider to step it down to about 3.01v which I confirmed with a mutimeter.
If this is for the 3V3 supply to the NRF are you measuring it while testing your project, what happens do you think when the NRF needs current to transmit, what will the potential divider currents and value be?
Although your potential divider using a 2K connected to Vcc & 1K connected to the GND pin will provide a 3.01voltage source, it will not provide a current of up to 15mA max that the NRF24l01 requires to operate in a Tx mode.
Using Ohms law, your potential divider will only provide up to a max of 2.5mA
You would do better to use a 5v to 3.3v voltage regulator such as a Microchip TC1262-3.3VDB for example.
I ran the test code on both of them the uno worked fine and displayed all the data while the Pro Micro doesn't print anything at all, the console just remains empty. Other code runs on the Pro Micro when I tested servos and motors. Why could this happen?
I just discovered that the Pro Micro doesn't execute any code in the void setup other than pin mode. If I put the same code in the void loop the Pro Micro runs it and it showed me the data from the nRF and it looked good. How do i make it run code in the setup?
@UKHeliBob, The test code @markd833 suggested to try. It will not print or execute any other code I tried in the void setup while if i put the exact same code in the void loop it works. The same code worked perfectly in the arduino uno. Is there any way to get around it so the code in the loop only runs once?
@UKHeliBob it works, could this also be the reason why the actual code doesn't work? If so, then what do I do now? I want to first run the simple reciever/transmitter code you sent in message #2.