I have been working for weeks trying to get past this problem. Any insights on this would be tremendously appreciated as I am at my wits end, I have to get past this problem or find a work around.
I have both an RC522 (RFID Tag reader) and an NRF24L01 both connected via SPI to an UNO R3.
I can get either device working well separately, but when combined then I get REALLY inconsistent behavior.
80% of the time nothing works (neither RF reader nor NRF24L01), 10% of the time one or other device works, 10% of the time both devices work (until I restart the arduino and repower the radio).
I have tried multiple different UNOs, Readers, and Radios and configurations but have not been able to get things working.
I understand the basics of how SPI is supposed to work, with the CS being put active Low for the device I am trying to activate and shared CLK, MISO and MOSI lines.
Note: The NRF section of the code can open up one of 6 separate pipes for reading / writing. (As my end project will have multiple remote stations and 1 central controller listening for inputs from the various remote stations)
The way that the loop works:
- Scan RFID
- Turn on Radio Writing
- Send Message
- Turn radio to listening for 2 seconds
- Process received messages
- Based on received message - Turn on LED's, display message etc. (FUTURE)
I have put the code to try to move between RFID and NRF into functions at the end of the code.
Attached is the circuit that I have been tinkering with.
Enclosed is relevant code.
With the RFID connected when I look at the Radio.PrintDetails() all that I get is 0's for the radio details.
I dont get any different behaviours regardless of whether the pullup resistors is in place or not.
Most of the time the program sits there saying "Scan RFID"
Again - thanks anyone for help / insights you can provide.
GamePadv7.ino (21.4 KB)