From d80421b53702f6ad611685edc1ad57ec6474940b Mon Sep 17 00:00:00 2001 From: rtlsdrblog Date: Thu, 24 Aug 2023 01:02:16 +1200 Subject: [PATCH] l-band lock optimizations --- src/tuner_r82xx.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/tuner_r82xx.c b/src/tuner_r82xx.c index 1510fc3..dbdf4e9 100644 --- a/src/tuner_r82xx.c +++ b/src/tuner_r82xx.c @@ -458,7 +458,10 @@ static int r82xx_set_pll(struct r82xx_priv *priv, uint32_t freq) return rc; /* set VCO current = 100 */ - rc = r82xx_write_reg_mask(priv, 0x12, 0x80, 0xe0); + /* rc = r82xx_write_reg_mask(priv, 0x12, 0x80, 0xe0); */ + + /* RTL-SDR Blog Modification: Set VCO current to MAX */ + rc = r82xx_write_reg_mask(priv, 0x12, 0x06, 0xff); if (rc < 0) return rc; @@ -550,7 +553,9 @@ static int r82xx_set_pll(struct r82xx_priv *priv, uint32_t freq) if (!i) { /* Didn't lock. Increase VCO current */ - rc = r82xx_write_reg_mask(priv, 0x12, 0x60, 0xe0); + /* rc = r82xx_write_reg_mask(priv, 0x12, 0x60, 0xe0); */ + /* RTL-SDR Blog Hack: Set max current */ + rc = r82xx_write_reg_mask(priv, 0x12, 0x06, 0xff); if (rc < 0) return rc; } @@ -673,6 +678,10 @@ static int r82xx_sysfreq_sel(struct r82xx_priv *priv, uint32_t freq, rc = r82xx_write_reg_mask(priv, 0x11, cp_cur, 0x38); if (rc < 0) return rc; + + /* RTL-SDR Blog Hack. Improve L-band performance by setting PLL drop out to 2.0v */ + div_buf_cur = 0xa0; + rc = r82xx_write_reg_mask(priv, 0x17, div_buf_cur, 0x30); if (rc < 0) return rc;