Frequency hopping experiments on the NRF24

Any old or new electronic projects on the go
Martin
Posts: 745
Joined: 16 Feb 2018, 14:11
Location: Warwickshire

Re: Frequency hopping experiments on the NRF24

Post by Martin »

Attached are very slightly modified versions of Phil's transmitter and receiver sketches. The only difference is that these automatically calculate the correct timer reload values for different Arduino clock frequencies at compile time, based on the F_CPU constant provided by the Arduino IDE. Phil's code already worked for 8MHz and 16MHz receivers, and 16MHz only for transmitters. This code works for any reasonable clock frequency including 8 MHz, 12 MHz, 16 MHz, 20 MHz, and 32 MHz. Main reason for doing it was to provide compatibility with the LGT8F RF-NANOs which (can) operate at 32 MHz.

I've tested it with all combinations of regular Keywish (Atmel MCU) RF-NANOs and LGT8F RF-NANOs: transmitter and receiver. All seem to work fine.

If you're using normal (non-LGT8F) MCUs, there's no point in downloading this code - it will compile to produce identical code to Phil's standard sketches.

The versions I've attached here have the standard CE and CSN allocation (to suit the Keywish RF-NANOs)

RF23 radio(10, 9);

You'll have to swap the 9 and 10 over to suit the LGT8F RF-NANO.

Also change the pipeIn[], pipeOut[], and mychannels[] constants, of course. I've put some very non-random values in the version attached here!
Attachments
Enc_v5_nrf24_250k_5ms_fhss_timer2_tx.zip
(6.25 KiB) Downloaded 98 times
Enc_v5_nrf24_250k_5ms_fhss_led_wdt_timer2_rx.zip
(3.44 KiB) Downloaded 110 times
User avatar
_AL_
Posts: 161
Joined: 17 Feb 2018, 01:09
Location: Sydney Australia

Re: Frequency hopping experiments on the NRF24

Post by _AL_ »

Some really interesting & impressive projects underway on this forum at the moment.
Sadly as I get older I find this stuff harder & harder to understand & I was pretty much at my limit previously.

I'm watching from afar with keen interest.
User avatar
tiptipflyer
Posts: 393
Joined: 16 Feb 2018, 22:49
Location: Germany

Re: Frequency hopping experiments on the NRF24

Post by tiptipflyer »

Hi guys,

Since the prices for nanos, pro minis, digisparks etc. went up a lot, I was searching for something cheaper. What I found by surprise was the Attiny88 board, which is available for less than €2,00 each and it was looking interested.
I wired up a S/C transmitter as I use in several of my projects and it was working without any problems.
Then I wired up a simple proportional transmitter, but no joy. Something with the eeprom part and the analog part is not working, but that is still above my hat and needs further investigation.
Then I wired up a S/C NRF24 transmitter as I use in two of my other projects ( O.S. and Futaba S/C replicas), and again it is working without any trouble. I could stear my Pageboy around without any difficulties.
SAM_4594.JPG
SAM_4595.JPG
SAM_4596.JPG
I hope not to bore you with my thoughts and my experiments.

Cheers
Frank
Tobe
Posts: 667
Joined: 16 Feb 2018, 06:19
Location: Varberg or Stockholm, Sweden

Re: Frequency hopping experiments on the NRF24

Post by Tobe »

Well done Frank :D, good to hear from you and I sure hope to find you well.
I have been using all different ATMEGA like 328-168-88-48 on my boards so often I order them from Jlcpcb.com w/o the processor and I just solder on the board the most suitable as the main difference is just the amount of memory.
Most of the time the 88 is more than enough.

Cheers Frank and all the best

Tobe
Cheers,

Tobe
User avatar
Wayne_H
Posts: 811
Joined: 17 Feb 2018, 05:26
Location: Temora, NSW. Australia
Contact:

Re: Frequency hopping experiments on the NRF24

Post by Wayne_H »

Well done Frank ;)

I've been wondering about the 88 "alternative" boards, but been too distracted by life (house building, work commitments, etc....) to actually get off my butt & do something :oops: Great to hear of your success with the S/C application.

- Did you need to make any changes to your code (pin numbers, etc)?
- Did you program the board with a USBAsp (after changing processor type - what library did you use?) or via the USB interface?
- if with a USBAsp, were there other changes needed, such a transfer speed?

Again, well done mate
Cheers,

Wayne
Once a Retrobate, always a Retrobate............ ;)
User avatar
tiptipflyer
Posts: 393
Joined: 16 Feb 2018, 22:49
Location: Germany

Re: Frequency hopping experiments on the NRF24

Post by tiptipflyer »

Thanks guys,

no changes to my codes needed. But the codes provided my Phil are to big for the Tiny88.
I am using much simplified codes on basis of Phil´s code, I removed everything, I do not need.
Programming is done via USBAsp.
In the Arduino IDE under File/Preferences/Additional Boards Manager URL´s, you have to enter the line:

Code: Select all

https://raw.githubusercontent.com/MHEtLive/arduino-boards-index/master/package_mhetlive_index.json
After that you have to go to Sketch/Include Library/Manage Libraries and search for „MH-ET LIVE Boards“ and activate it.
Then you find the MH-ET LIVE Tiny 88(16.0MHz) and can use it.
I had no troubles in loading the codes.

Frank
Last edited by tiptipflyer on 14 Jul 2022, 17:38, edited 3 times in total.
User avatar
Shaun
Posts: 1057
Joined: 15 Feb 2018, 21:49
Location: West Yorkshire

Re: Frequency hopping experiments on the NRF24

Post by Shaun »

👍😀
Last edited by Shaun on 15 Jul 2022, 11:24, edited 1 time in total.
User avatar
Phil_G
Posts: 601
Joined: 15 Feb 2018, 23:32
Contact:

Re: Frequency hopping experiments on the NRF24

Post by Phil_G »

_AL_ wrote: 03 Jul 2022, 09:09 Some really interesting & impressive projects underway on this forum at the moment.
Sadly as I get older I find this stuff harder & harder to understand & I was pretty much at my limit previously.
I'm watching from afar with keen interest.
Dont worry Al, the clever guys left me behind some time ago...

Today I was thinking about the Lemon 'channels choice' thing (which as Mike said, is no longer a thing...) and read appendix C of the Nordic datasheet to see how to get unmodulated carrier from an NRF. This is useful for testing various things like peak output power, aerial SWR, busy-channel avoidance, etc
On the other hand, its a potentially dodgy thing to do. There's very little to it, I know Martin has already done this but I dont think he posted any code, in fact I couldnt find anything online either hence I reinvented the wheel from the Nordic doc ;)





There is a one (harmless) line change to the RF24.h file, details in the sketch.
Cheers
Phil

Edit: ok I just had a quick scan of yours Martin and I see you also chose a sweep to demonstrate it... honestly, a coincidence!
Attachments
NRF_transmit_continuous_carrier.ino
(1.24 KiB) Downloaded 83 times
Martin
Posts: 745
Joined: 16 Feb 2018, 14:11
Location: Warwickshire

Re: Frequency hopping experiments on the NRF24

Post by Martin »

I posted my code I wrote back in 2016 just recently, with at little video about it, Phil, in this post: viewtopic.php?p=12913#p12913 in the thread about the LGT8F variant. That code will run on the 'normal' Atmel chips too, though you'll have to edit the CE and CS pin #defines up near the top of the code to suit your module.

It only runs at the very lowest transmit power with a range of just a few feet. But anyone who knows what they're doing can make some obvious changes to wind up the transmit power.
User avatar
Phil_G
Posts: 601
Joined: 15 Feb 2018, 23:32
Contact:

Re: Frequency hopping experiments on the NRF24

Post by Phil_G »

As the thread has grown longer & longer it gets more difficult for a potential builder to follow, so I've started an all-in-one "how-to" document.
It helps me too, I cant remember what I did or what choices were made back in 2020 lockdown :D
Its a long way from complete but I wondered what members think so far, what have I forgotten or got wrong?
As it grows I might have to split it into 3 separate tx, rx & software documents as it includes many photos so the file gets quite big!##

The doc is now in the opening post of this thread, I'll update it there when I've done the receiver options

Cheers
Phil
Attachments
homebrew-nrf.pdf
(6.43 MiB) Downloaded 131 times
Post Reply