From 2cf4971c2dc0cec299f37199fc33ac0edb86b7bb Mon Sep 17 00:00:00 2001 From: jgromes Date: Sat, 14 Mar 2020 13:44:50 +0100 Subject: [PATCH] [SX127x] Set default FSK BT shaping to 0.5 for SX126x FSK (#123) --- examples/SX127x/SX127x_FSK_Modem/SX127x_FSK_Modem.ino | 2 +- src/modules/SX127x/SX1272.cpp | 4 ++++ src/modules/SX127x/SX1278.cpp | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/examples/SX127x/SX127x_FSK_Modem/SX127x_FSK_Modem.ino b/examples/SX127x/SX127x_FSK_Modem/SX127x_FSK_Modem.ino index f9c89154..f9e2821d 100644 --- a/examples/SX127x/SX127x_FSK_Modem/SX127x_FSK_Modem.ino +++ b/examples/SX127x/SX127x_FSK_Modem/SX127x_FSK_Modem.ino @@ -38,7 +38,7 @@ void setup() { // Rx bandwidth: 125.0 kHz // output power: 13 dBm // current limit: 100 mA - // data shaping: Gaussian, BT = 0.3 + // data shaping: Gaussian, BT = 0.5 // sync word: 0x2D 0x01 // OOK modulation: disabled int state = fsk.beginFSK(); diff --git a/src/modules/SX127x/SX1272.cpp b/src/modules/SX127x/SX1272.cpp index 7624da78..1251d90a 100644 --- a/src/modules/SX127x/SX1272.cpp +++ b/src/modules/SX127x/SX1272.cpp @@ -413,6 +413,10 @@ int16_t SX1272::configFSK() { // set fast PLL hop state = _mod->SPIsetRegValue(SX1272_REG_PLL_HOP, SX127X_FAST_HOP_ON, 7, 7); + RADIOLIB_ASSERT(state); + + // set Gauss filter BT product to 0.5 + state = _mod->SPIsetRegValue(SX127X_REG_OP_MODE, SX1272_FSK_GAUSSIAN_0_5, 4, 3); return(state); } diff --git a/src/modules/SX127x/SX1278.cpp b/src/modules/SX127x/SX1278.cpp index 8a5b68ea..24ea9e64 100644 --- a/src/modules/SX127x/SX1278.cpp +++ b/src/modules/SX127x/SX1278.cpp @@ -491,6 +491,10 @@ int16_t SX1278::configFSK() { // set fast PLL hop state = _mod->SPIsetRegValue(SX1278_REG_PLL_HOP, SX127X_FAST_HOP_ON, 7, 7); + RADIOLIB_ASSERT(state); + + // set Gauss filter BT product to 0.5 + state = _mod->SPIsetRegValue(SX127X_REG_PA_RAMP, SX1278_FSK_GAUSSIAN_0_5, 6, 5); return(state); }