From 1f043dc267a0081a8fae8d985eff25656953c271 Mon Sep 17 00:00:00 2001 From: JP Stringham Date: Tue, 25 Aug 2026 21:59:31 -0400 Subject: [PATCH] some extra tweaks and comments --- src/si5351.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/si5351.rs b/src/si5351.rs index e8001e8..70b22e3 100644 --- a/src/si5351.rs +++ b/src/si5351.rs @@ -132,20 +132,24 @@ impl Si5351Dev { // P1, P2 and P3 are split in very weird ways and determine PLLA aka VCO freq // See AN619 for a terrible but thorough explanation. - let if_freq = 737_010_000; + let if_freq = 736_940_000; configure_pll_vco(i2c, PLL::A, if_freq); configure_pll_vco(i2c, PLL::B, 1_407_286_000 - if_freq); // get us up to 14.074MHz // apply 64x multisynth divider - set_p1_p2_p3_from_abc(i2c, 100, 0, 1, 50); + set_p1_p2_p3_from_abc(i2c, 100, 0, 1, 42); set_p1_p2_p3_from_abc(i2c, 100, 0, 1, 58); - // clk 1 is the one we actually use.. - safe_reg_write(i2c, Si5351Register::Clock1Ctrl as u8, 0b0000_1100); + // clk 0 and 2 are the ones we actually use + + // clk 0 use PLL A, 8mA drive + safe_reg_write(i2c, Si5351Register::Clock0Ctrl as u8, 0b0000_1111); + // clk 2 use PLL B, 2mA drive safe_reg_write(i2c, Si5351Register::Clock2Ctrl as u8, 0b0010_1100); send_command(i2c, &Si5351Register::PLLReset, 0xAC); - safe_reg_write(i2c, Si5351Register::OutputsEnable as u8, 0b1111_1001); + // enable only clocks 0 and 2 + safe_reg_write(i2c, Si5351Register::OutputsEnable as u8, 0b1111_1010); delay.delay_ms(500);