Back to Firmware

Notes

variants/nrf52840/diy/nrf52_promicro_diy_tcxo/readme.md

2.7.22.96dd6476.6 KB
Original Source
<!-- trunk-ignore-all(markdownlint/MD059) -->

Notes

News 2025-12-04 - The GPS pin definitions have been changed!!! This has no material effect on current builds, but future builders may wish to review how they are using the wires.

General

The pinout is contained in the variant.h file, and a generic schematic is located in this directory.

This variant is suitable for both TCXO and XTAL types of modules. The old XTAL variant has been removed to reduce confusion.

Note on DIO2, RXEN, TXEN, and RF switching

Several modules require external switching between transmit (Tx) and receive (Rx). This can be achieved using several methods:

  1. Link the TXEN pin on the radio module to DIO2 on the same module, and then connect RXEN on the radio module to pin 0.17 on the Pro-Micro.
  2. Use DIO2 to drive a logic inverter, so that when DIO2 is high, RXEN is low, and vice versa.
  3. Use DIO2 to drive a pair of MOSFETs or transistors to supply the same function.

RXEN is not required to be connected if the selected module already has internal RF switching, or if external RF switching logic is already applied. Also worth noting that the Seeed WIO SX1262 in particular only has RXEN exposed (marked RF_SW) and has the DIO2-TXEN link internally.

Making a node based on this variant

Making your own node based on this design is straightforward. There are various open source and free to use PCB design files available, or you can solder wires directly from a module to the pro-micro.

<details> <summary> < Click to expand > The table of known modules is at the bottom of the variant.h, and reproduced here for convenience. </summary>
MfrModuleTCXORF SwitchNotes
EbyteE22-900M22SYesExt
EbyteE22-900MM22SNoExt
EbyteE22-900M30SYesExt
EbyteE22-900M33SYesExtMAX_POWER must be set to 8 for this
EbyteE220-900M22SNoExtLLCC68, looks like DIO3 not connected
AI-ThinkerRA-01SHNoIntSX1262
HeltecHT-RA62YesInt
NiceRFLora1262yesInt
WaveshareCore1262-HFyesExt
WaveshareLoRa Node ModuleyesInt
SeeedWio-SX1262yesExtCute! DIO2/TXEN are not exposed
SeeedWio-LR1121yesIntLR1121, needs alternate rfswitch.h
AI-ThinkerRA-02NoIntSX1278 433mhz band only
RF SolutionsRFM95NoIntUntested
EbyteE80-900M2213SYesIntLR1121 radio
</details>

LR1121 modules - E80 is the default

The E80 from CDEbyte is the most obtainable module at present, and has been selected as the default option.

Naturally, CDEbyte have chosen to ignore the generic Semtech implementation of the RF switching logic and have supplied confusing and contradictory documentation, which is explained below.

tl;dr: The E80 is chosen as the default. If you wish to use another module, the table in rfswitch.h must be adjusted accordingly.

E80 switching - the saga

The CDEbyte implementation of the LR1121 is contained in their E80 module. As stated above, CDEbyte have chosen to ignore the generic Semtech implementation of the RF switching logic and have their own table, which is located at the bottom of the page here, and reflected on page 6 of their user manual, and reproduced below:

DIO5/RFSW0DIO6/RFSW1RF status
00RX
01TX (Sub-1GHz low power mode)
10TX (Sub-1GHz high power mode)
11TX(2.4GHz)

However, looking at the sample code they provide on page 9, the values would be:

DIO5/RFSW0DIO6/RFSW1RF status
01RX
11TX (Sub-1GHz low power mode)
10TX (Sub-1GHz high power mode)
00TX(2.4GHz)

The Semtech default, the values are (taken from here):

<details> <summary> < Click to expand > </summary>
cpp
	.rfswitch = {
		.enable = LR11XX_SYSTEM_RFSW0_HIGH | LR11XX_SYSTEM_RFSW1_HIGH | LR11XX_SYSTEM_RFSW2_HIGH,
		.standby = 0,
		.rx = LR11XX_SYSTEM_RFSW0_HIGH,
		.tx = LR11XX_SYSTEM_RFSW0_HIGH | LR11XX_SYSTEM_RFSW1_HIGH,
		.tx_hp = LR11XX_SYSTEM_RFSW1_HIGH,
		.tx_hf = 0,
		.gnss = LR11XX_SYSTEM_RFSW2_HIGH,
		.wifi = 0,
	},
</details>
DIO5/RFSW0DIO6/RFSW1RF status
10RX
11TX (Sub-1GHz low power mode)
01TX (Sub-1GHz high power mode)
00TX(2.4GHz)

It is evident from the tables above that there is no real consistency to those provided by Ebyte.

An experiment

Tests were conducted in each of the three configurations between a known-good SX1262 and an E80, passing packets in both directions and recording the reported RSSI. The E80 was set at 22db and 14db to activate the high and low power settings respectively. The results are shown in the chart below.

Conclusion

The RF switching is based on the code example given. Logically, this shows the DIO5 and DIO6 are swapped compared to the reference design.

If future DIYers wish to use an alternative module, the table in rfswitch.h must be adjusted accordingly.