diff options
author | Clifford Wolf <clifford@clifford.at> | 2017-07-03 17:32:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-03 17:32:08 +0200 |
commit | 832bcbe4a2a2733cd76d70805390cee55524b0bc (patch) | |
tree | 8509e1360f5aceed085da4f24c430071e789029e /icepll | |
parent | 8611d612d4c40035e377ae9d3417fbd233edb61d (diff) | |
parent | 7201da8cfd7cc9d75f76656381299db4adcc040e (diff) | |
download | icestorm-832bcbe4a2a2733cd76d70805390cee55524b0bc.tar.gz icestorm-832bcbe4a2a2733cd76d70805390cee55524b0bc.tar.bz2 icestorm-832bcbe4a2a2733cd76d70805390cee55524b0bc.zip |
Merge pull request #84 from C-Elegans/pll_divf
Update PLL DIVF range to be [0,127]
Diffstat (limited to 'icepll')
-rw-r--r-- | icepll/icepll.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/icepll/icepll.cc b/icepll/icepll.cc index c9b1a45..744b9b1 100644 --- a/icepll/icepll.cc +++ b/icepll/icepll.cc @@ -108,6 +108,15 @@ int main(int argc, char **argv) int best_divf = 0; int best_divq = 0; + //The documentation in the iCE40 PLL Usage Guide incorrectly lists the + //maximum value of DIVF as 63, when it is only limited to 63 when using + //feedback modes other that SIMPLE. + int divf_max = 63; + if(simple_feedback) + { + divf_max = 127; + } + if (f_pllin < 10 || f_pllin > 133) { fprintf(stderr, "Error: PLL input frequency %.3f MHz is outside range 10 MHz - 133 MHz!\n", f_pllin); exit(1); @@ -123,7 +132,7 @@ int main(int argc, char **argv) double f_pfd = f_pllin / (divr + 1); if (f_pfd < 10 || f_pfd > 133) continue; - for (int divf = 0; divf <= 63; divf++) + for (int divf = 0; divf <= divf_max; divf++) { if (simple_feedback) { |