From f67cee02a27f96e179b317e58cd220d0974eb805 Mon Sep 17 00:00:00 2001 From: Tom <116762865+Nestpebble@users.noreply.github.com> Date: Thu, 30 Jan 2025 20:35:12 +0000 Subject: [PATCH] add readme and update rfswitch --- .../diy/nrf52_promicro_diy_tcxo/readme.md | 40 +++++++++++++++++++ .../diy/nrf52_promicro_diy_tcxo/rfswitch.h | 19 ++++++--- 2 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 variants/diy/nrf52_promicro_diy_tcxo/readme.md diff --git a/variants/diy/nrf52_promicro_diy_tcxo/readme.md b/variants/diy/nrf52_promicro_diy_tcxo/readme.md new file mode 100644 index 000000000..123e7a761 --- /dev/null +++ b/variants/diy/nrf52_promicro_diy_tcxo/readme.md @@ -0,0 +1,40 @@ +## Notes + +### General +The pinout is contained in the variant.h file, and a [generic schematic](./Schematic_Pro-Micro_Pinouts%202024-12-14.pdf) is located in this directory. Note that RXEN is not required if the selected module already has internal RF switching, or if external RF switching logic is already applied. + +### LR1121 modules +The CDEbyte implementation of the LR1121 is contained in their E80 module. Naturally, CDEbyte have chosen to ignore the generic Semtech impelementation of the RF switching logic and have their own table, which is located at the bottom of the page [here](https://www.cdebyte.com/products/E80-900M2213S/2#Pin), and reproduced below for posterity: + +| DIO5/RFSW0 | DIO6/RFSW1 | RF status | +| ---------- | ---------- | ----------------------------- | +| 0 | 0 | RX | +| 0 | 1 | TX (Sub-1GHz low power mode) | +| 1 | 0 | TX (Sub-1GHz high power mode) | +| 1 | 1 | TX(2.4GHz) | + +If you want to use the Semtech default, the values are (taken from [here](https://github.com/Lora-net/SWSD006/blob/73f59215b0103de7011056105011c5f5cc47f1e8/lib/app_subGHz_config_lr11xx.c#L145C1-L154C4)): + +
+ +``` + .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, + }, +``` +
+ + +| DIO5/RFSW0 | DIO6/RFSW1 | RF status | +| ---------- | ---------- | ----------------------------- | +| 1 | 0 | RX | +| 1 | 1 | TX (Sub-1GHz low power mode) | +| 0 | 1 | TX (Sub-1GHz high power mode) | +| 0 | 0 | TX(2.4GHz) | diff --git a/variants/diy/nrf52_promicro_diy_tcxo/rfswitch.h b/variants/diy/nrf52_promicro_diy_tcxo/rfswitch.h index 2258c3135..9859e6802 100644 --- a/variants/diy/nrf52_promicro_diy_tcxo/rfswitch.h +++ b/variants/diy/nrf52_promicro_diy_tcxo/rfswitch.h @@ -1,17 +1,24 @@ #include "RadioLib.h" +// This is rewritten to match the requirements of the E80-900M2213S +// The E80 does not conform to the reference Semtech switches(!) and therefore needs a custom matrix. +// See footnote #3 in "https://www.cdebyte.com/products/E80-900M2213S/2#Pin" // RF Switch Matrix SubG RFO_HP_LF / RFO_LP_LF / RFI_[NP]_LF0 // DIO5 -> RFSW0_V1 // DIO6 -> RFSW1_V2 -// DIO7 -> ANT_CTRL_ON + ESP_IO9/LR_GPS_ANT_DC_EN -> RFI_GPS (Bias-T GPS) (LR11x0 only) +// DIO7 -> not connected on E80 module - note that GNSS and Wifi scanning are not possible. static const uint32_t rfswitch_dio_pins[] = {RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6, RADIOLIB_LR11X0_DIO7, RADIOLIB_NC, RADIOLIB_NC}; static const Module::RfSwitchMode_t rfswitch_table[] = { // mode DIO5 DIO6 DIO7 - {LR11x0::MODE_STBY, {LOW, LOW, LOW}}, {LR11x0::MODE_RX, {HIGH, LOW, LOW}}, - {LR11x0::MODE_TX, {LOW, HIGH, LOW}}, {LR11x0::MODE_TX_HP, {LOW, HIGH, LOW}}, - {LR11x0::MODE_TX_HF, {LOW, LOW, LOW}}, {LR11x0::MODE_GNSS, {LOW, LOW, HIGH}}, - {LR11x0::MODE_WIFI, {LOW, LOW, LOW}}, END_OF_MODE_TABLE, -}; \ No newline at end of file + {LR11x0::MODE_STBY, {LOW, LOW, LOW}}, + {LR11x0::MODE_RX, {LOW, LOW, LOW}}, + {LR11x0::MODE_TX, {LOW, HIGH, LOW}}, + {LR11x0::MODE_TX_HP, {HIGH, LOW, LOW}}, + {LR11x0::MODE_TX_HF, {HIGH, HIGH, LOW}}, + {LR11x0::MODE_GNSS, {LOW, LOW, HIGH}}, + {LR11x0::MODE_WIFI, {LOW, LOW, LOW}}, + END_OF_MODE_TABLE, +};