Skip to content

Commit

Permalink
Improve custom settings comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
antirez committed Jan 14, 2023
1 parent 54eea1d commit 41a9259
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions custom_presets.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <cc1101.h>

/* This is how to configure registers MDMCFG3 and MDMCFG4.
/* ========================== DATA RATE SETTINGS ===============================
*
* Data rate kBaud setting:
* This is how to configure registers MDMCFG3 and MDMCFG4.
*
* MDMCFG3 is the data rate mantissa, the exponent is in MDMCFG4,
* last 4 bits of the register.
Expand All @@ -15,6 +15,8 @@
*
* ((256+34)*(2^12))/(2^28)*26000000 = 115051.2688000000, that is 115KBaud
*
* ============================ BANDWIDTH FILTER ===============================
*
* Bandwidth filter setting:
*
* BW filter as just 16 possibilities depending on how the first nibble
Expand All @@ -39,6 +41,8 @@
* e 68 khz
* f 58 khz
*
* ============================== FSK DEVIATION ================================
*
* FSK deviation is controlled by the DEVIATION register. In Ruby:
*
* dev = (26000000.0/2**17)*(8+(deviation&7))*(2**(deviation>>4&7))
Expand Down Expand Up @@ -194,7 +198,7 @@ static uint8_t protoview_subghz_tpms3_fsk_async_regs[][2] = {
{0, 0},
};

/* Parameters that should work well for the TPMS PVM C210 sensor. */
/* FSK 19k dev, 325 Khz filter, 20kBaud. Works well with Toyota. */
static uint8_t protoview_subghz_tpms4_fsk_async_regs[][2] = {
/* GPIO GD0 */
{CC1101_IOCFG0, 0x0D}, // GD0 as async serial data output/input
Expand All @@ -212,7 +216,7 @@ static uint8_t protoview_subghz_tpms4_fsk_async_regs[][2] = {
{CC1101_MDMCFG2, 0x10}, // GFSK without any other check
{CC1101_MDMCFG3, 0x93}, // Data rate is 20kBaud
{CC1101_MDMCFG4, 0x59}, // Rx bandwidth filter is 325 kHz
{CC1101_DEVIATN, 0x34}, // Deviation 19.04 Khz, works well with TPMS
{CC1101_DEVIATN, 0x34}, // Deviation 19.04 Khz.

/* Main Radio Control State Machine */
{CC1101_MCSM0, 0x18}, // Autocalibrate on idle-to-rx/tx, PO_TIMEOUT is 64 cycles(149-155us)
Expand Down

0 comments on commit 41a9259

Please sign in to comment.