summaryrefslogtreecommitdiff
path: root/openpcd/pll.pl
diff options
context:
space:
mode:
author(no author) <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-07-23 13:01:34 +0000
committer(no author) <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-07-23 13:01:34 +0000
commit56fa0102a8be4ab63e23b88675fa38ef6d5d554c (patch)
tree54715f2f8c1971439301940805716f90f907c7e4 /openpcd/pll.pl
parent94d184f816cb19c414fe6bd95600e6be079ac2f9 (diff)
add pll calculation helper
git-svn-id: https://svn.openpcd.org:2342/trunk@17 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpcd/pll.pl')
-rwxr-xr-xopenpcd/pll.pl22
1 files changed, 22 insertions, 0 deletions
diff --git a/openpcd/pll.pl b/openpcd/pll.pl
new file mode 100755
index 0000000..2acb222
--- /dev/null
+++ b/openpcd/pll.pl
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+
+
+# MCLK = (18.432 / DIV) * MUL = 48.000
+
+my $MCLK = 18432;
+
+my $div;
+my $mul;
+
+for ($div = 1; $div < 256; $div++) {
+ my $tmp = $MCLK / $div;
+ for ($mul = 1; $mul < 2048; $mul++) {
+ my $res = $tmp * $mul;
+ if ($res == 96000) {
+ printf("res=%u, div=%u, tmp=%u, mul=%u\n",
+ $res, $div, $tmp, $mul);
+ }
+ }
+}
+
+
personal git repositories of Harald Welte. Your mileage may vary