some extra tweaks and comments

This commit is contained in:
2026-08-25 21:59:31 -04:00
parent caf3285384
commit 1f043dc267

View File

@@ -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);