i have made a library for frequency hopping on the nrf24l01's if anyones interested. It requires the rf24 library from maniac bug. Im no professional but i could never find anything useable online for frequency hopping.
It is 2 way so master and slaves both send and recieve.
Both master and slave run on a settable locked frame rate. Its using micros for timing so it works on Uno and Nano. Ive got another version for the teensy that uses the teensys clock cycle counter for tighter timing.
The timing syncing comes from the slaves nrf24l01 irq pin so the slave does use an interrupt. The slave does also adjust the drift in microsecond increments as the microcontrollers crystals are not that accurate.
It disables auto ack packets as they screwed with the timings. It simply sends and forgets. So any acknowledgements can be sent back through (eg master could send 8 switch positions in a byte. Slave could send back those 8 switch positions so the master knows what the slave is set at)
Ive added some auto packing and unpacking of send/recieve packets. The use case is more for something like a 2 way rc transmitter and reciever. The ability is there to send and receive up to 3 individual packets per frame. Its all shown in the ino examples.
Its currently set for 50 different channels and will hop every 2 frames (so at 50 fps will hop every 40 milliseconds)
Locking on to the current channel is quick and ive tested it pretty thoroughly. Its currently hard coded after 120 packet misses to go back into scanning mode. So turning the master off and on again it will pick up the channel again.
The master will always jump forward in the sequence of channels. One jump every 2 frames. When the slave is in scanning mode it will jump backwards through the channel sequence until it gets a lock. When scanning the slave will not send any packes.
One of the big benefits is no missed packets. Because the nrf is half duplex, when its in sending mode it cannot recieve any packets. The slave will run 1/8 of a frame behind the master. They both send there packets at the start of the frame so neither of them are missing any recieved packets while they are sending.
Ive kept it simple so currently the channel sequences as well as send and recieve addresses are hard coded. For a more serious rc project you would code in a bind method and get the master to generate random send/receive addresses and a random sequence list to be sent to the slave to be saved in eeprom.
In the examples the slave is sending 2 packets per frame (at 50hz 100 packets per second) while the master is sending 1 packet per frame (at 50hz 50 packets a second)
Its currently set for 1mb data rate. If you set it for 256kb data rate keep an eye on the timings. The nrf takes a long time to send large packets at 256kb.