Hello,
I am doing a project where multiple NRF24L01 modules are connected to an equal number PICs. One PIC sends a packet and the second receives it and sends an acknowledgement to the first again to confirm receipt of the message.
As a first test my idea was that one PIC reads a digital input, and when that state changes it transmits the new state to the second PIC, which then lights an LED according to that state.
Now I do have a relatively good understanding of C, and I know the basics of PICs but I have no idea how to set up SPI. All information on the internet is with a PIC18F and using different compilers.
By reading datasheets I have some idea of what has to happen, but still am a long way away from writing working code.
If I would know how to set up SPI, set up NRF24L01 registers and transmit and receive data I could probably figure the rest out myself.
I am using MBLAB X, Microchip XC8 compiler in free mode and PicKit 3 programmer/debugger.
Preferred PIC is PIC12F1840 as it has hardware SPI, is quite powerful and are nice and small, and doesn't have a crapload of registers to learn.
If someone could explain how to use SPI and maybe share some example code it would help me a great deal.
Thank you