aboutsummaryrefslogtreecommitdiffstats
path: root/openpcd/pll.pl
blob: 2acb222449441a2a86ec4be1f907b489cd446744 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);
		}
	}
}