Fixed - si5351 needs tweaking
This commit is contained in:
20
src/main.rs
20
src/main.rs
@@ -254,19 +254,19 @@ fn main() -> ! {
|
||||
let tune_str = str::from_utf8(&tune_str_buf[tune_str_buf.len() - len..]).unwrap();
|
||||
// info!("len {}", len);
|
||||
|
||||
gfx_buf.draw_string(64 + 6 * (5 - len as u8), 28, tune_str);
|
||||
// gfx_buf.draw_string(64 + 6 * (5 - len as u8), 28, tune_str);
|
||||
|
||||
gfx_buf.draw_string(20, 40, message);
|
||||
// gfx_buf.draw_string(20, 40, message);
|
||||
|
||||
match input_mode {
|
||||
InputMode::DisplayOnly => (),
|
||||
InputMode::TuneDigit(d) => {
|
||||
let x = 64 + 6 * (4 - d) as u8;
|
||||
gfx_buf.draw_bresenham_line(x, 36, x + 5, 36);
|
||||
}
|
||||
}
|
||||
// match input_mode {
|
||||
// InputMode::DisplayOnly => (),
|
||||
// InputMode::TuneDigit(d) => {
|
||||
// let x = 64 + 6 * (4 - d) as u8;
|
||||
// gfx_buf.draw_bresenham_line(x, 36, x + 5, 36);
|
||||
// }
|
||||
// }
|
||||
|
||||
gfx_buf.redraw();
|
||||
// gfx_buf.redraw();
|
||||
// sh1106_dev.blit_framebuffer(&mut i2c, &mut gfx_buf);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,14 +127,14 @@ impl Si5351Dev {
|
||||
safe_reg_write(
|
||||
i2c,
|
||||
Si5351Register::CrystalInternalLoadCapacitance as u8,
|
||||
CrystalLoadBits::CL_8 as u8,
|
||||
CrystalLoadBits::CL_10 as u8,
|
||||
);
|
||||
|
||||
// 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_100_000;
|
||||
let if_freq = 737_010_000;
|
||||
configure_pll_vco(i2c, PLL::A, if_freq);
|
||||
configure_pll_vco(i2c, PLL::B, 1_407_400_000 - if_freq); // get us up to 14.074MHz
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user