diff --git a/README.md b/README.md index b8331a7..e79887d 100644 --- a/README.md +++ b/README.md @@ -472,6 +472,7 @@ Here are the defines, structs, and enumerations you will find handy to use with Crystal load capacitance: + SI5351_CRYSTAL_LOAD_0PF SI5351_CRYSTAL_LOAD_6PF SI5351_CRYSTAL_LOAD_8PF SI5351_CRYSTAL_LOAD_10PF @@ -500,7 +501,7 @@ Clock disable states: Clock fanout: enum si5351_clock_fanout {SI5351_FANOUT_CLKIN, SI5351_FANOUT_XO, SI5351_FANOUT_MS}; - + PLL input sources: enum si5351_pll_input{SI5351_PLL_INPUT_XO, SI5351_PLL_INPUT_CLKIN}; @@ -541,10 +542,14 @@ Right now, this code is focused solely on the 3-output 10-MSOP variant (Si5351A3 Changelog --------- +* v1.1.2 + + Fix error where register 183 is not pre-loaded with correct value per AN619. Add define for SI5351_CRYSTAL_LOAD_0PF (undocumented in AN619 but present in the official ClockBuilder software). + * v1.1.1 Fix if statement eval error in set_clock_disable() - + * v1.1.0 Added set_pll_input() method to allow toggling the PLL reference source for the Si5351C variant and added support to init() for different PLL reference frequencies from 10 to 100 MHz. diff --git a/keywords.txt b/keywords.txt index 93df66f..95f98a6 100644 --- a/keywords.txt +++ b/keywords.txt @@ -34,6 +34,7 @@ clk1_int_mode KEYWORD2 clk2_int_mode KEYWORD2 SI5351_PLL_FIXED LITERAL1 +SI5351_CRYSTAL_LOAD_0PF LITERAL1 SI5351_CRYSTAL_LOAD_6PF LITERAL1 SI5351_CRYSTAL_LOAD_8PF LITERAL1 SI5351_CRYSTAL_LOAD_10PF LITERAL1 diff --git a/library.properties b/library.properties index 9f6d343..8980abb 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Etherkit Si5351 -version=1.1.1 +version=1.1.2 author=Jason Milldrum maintainer=Jason Milldrum sentence=A full-featured library for the Si5351 series of clock generator ICs from Silicon Labs diff --git a/src/si5351.cpp b/src/si5351.cpp index 7c70739..8b9b8bd 100644 --- a/src/si5351.cpp +++ b/src/si5351.cpp @@ -1,8 +1,8 @@ /* * si5351.cpp - Si5351 library for Arduino * - * Copyright (C) 2015 Jason Milldrum - * Dana H. Myers + * Copyright (C) 2015-2016 Jason Milldrum + * Dana H. Myers * * Some tuning algorithms derived from clk-si5351.c in the Linux kernel. * Sebastian Hesselbarth @@ -66,7 +66,9 @@ void Si5351::init(uint8_t xtal_load_c, uint32_t ref_osc_freq) Wire.begin(); // Set crystal load capacitance - si5351_write(SI5351_CRYSTAL_LOAD, xtal_load_c); + uint8_t reg_val = 0x12; // 0b010010 reserved value bits + reg_val |= xtal_load_c; + si5351_write(SI5351_CRYSTAL_LOAD, reg_val); // Change the ref osc freq if different from default // Divide down if greater than 30 MHz diff --git a/src/si5351.h b/src/si5351.h index 1128b2d..0c23bf7 100644 --- a/src/si5351.h +++ b/src/si5351.h @@ -1,8 +1,8 @@ /* * si5351.h - Si5351 library for Arduino * - * Copyright (C) 2015 Jason Milldrum - * Dana H. Myers + * Copyright (C) 2015-2016 Jason Milldrum + * Dana H. Myers * * Many defines derived from clk-si5351.h in the Linux kernel. * Sebastian Hesselbarth @@ -171,6 +171,7 @@ #define SI5351_CRYSTAL_LOAD 183 #define SI5351_CRYSTAL_LOAD_MASK (3<<6) +#define SI5351_CRYSTAL_LOAD_0PF (0<<6) #define SI5351_CRYSTAL_LOAD_6PF (1<<6) #define SI5351_CRYSTAL_LOAD_8PF (2<<6) #define SI5351_CRYSTAL_LOAD_10PF (3<<6)