I may have to read that thread sometime. I've been avoiding it for a while, though I think Novak was paying some attention. In any case, yes I don't mind you using that code. I like commenting the heck out of stuff in case someone else picks it up, and I hope it's actually good enough. There may still be some cases that break it; I should probably write a testbench at some point that feeds it every value from 1 to about 400 and backsolves the output for correctness.
Or I was thinking earlier, an easy way to do it would be to iteratively generate a list of all valid hex codes and then check for the real frequency closest to the desired. But that's kinda cheating. But it'd guarantee the solution.
something like this? :-p
chip_freq timeout freq_value(s)
37.50 373 0583,0b87
39.06 358 0c07
40.62 344 0603,0c87
42.19 331 0d07
43.75 320 0683,0d87
45.31 308 0e07
46.88 298 0703,0e87
48.44 289 0f07
50.00 280 0783,0f87
51.56 271 1007
53.12 263 0803,1087
54.69 256 1107
56.25 248 0883,1187
57.81 242 1207
59.38 235 0903,1287
60.94 229 1307
62.50 224 0983,1387,4983,5387
64.06 218 1407,5407
65.62 213 0a03,1487,4a03,5487
67.19 208 1507,5507
68.75 203 0a83,1587,4a83,5587
70.31 199 1607,5607
71.88 194 0b03,1687,4b03,5687
73.44 190 1707,5707
75.00 186 0582,0b83,0b86,1787,4b83,5787
76.56 182 5807
78.12 179 0c06,4c03,5887
79.69 175 5907
81.25 172 0602,0c86,4c83,5987
82.81 169 5a07
84.38 165 0d06,4d03,5a87
85.94 162 5b07
87.50 160 0682,0d86,4d83,5b87
89.06 157 5c07
90.62 154 0e06,4e03,5c87
92.19 151 5d07
93.75 149 0702,0e86,4e83,5d87
95.31 146 5e07
96.88 144 0f06,4f03,5e87
98.44 142 5f07
100.00 140 0782,0f86,4f83,5f87
101.56 137 6007
103.12 135 1006,5003,6087
104.69 133 6107
106.25 131 0802,1086,5083,6187
107.81 129 6207
109.38 128 1106,5103,6287
110.94 126 6307
112.50 124 0882,1186,5183,6387
114.06 122 6407
115.62 121 1206,5203,6487
117.19 119 6507
118.75 117 0902,1286,5283,6587
120.31 116 6607
121.88 114 1306,5303,6687
123.44 113 6707
125.00 112 0982,1386,4982,5383,5386,6787
128.12 109 1406,5406
131.25 106 0a02,1486,4a02,5486
134.38 104 1506,5506
137.50 101 0a82,1586,4a82,5586
140.62 99 1606,5606
143.75 97 0b02,1686,4b02,5686
146.88 95 1706,5706
150.00 93 0581,0b82,0b85,1786,4b82,5786
153.12 91 5806
156.25 89 0c05,4c02,5886
159.38 87 5906
162.50 86 0601,0c85,4c82,5986
165.62 84 5a06
168.75 82 0d05,4d02,5a86
171.88 81 5b06
175.00 80 0681,0d85,4d82,5b86
178.12 78 5c06
181.25 77 0e05,4e02,5c86
184.38 75 5d06
187.50 74 0701,0e85,4e82,5d86
190.62 73 5e06
193.75 72 0f05,4f02,5e86
196.88 71 5f06
200.00 70 0781,0f85,4f82,5f86
203.12 68 6006
206.25 67 1005,5002,6086
209.38 66 6106
212.50 65 0801,1085,5082,6186
215.62 64 6206
218.75 64 1105,5102,6286
221.88 63 6306
225.00 62 0881,1185,5182,6386
228.12 61 6406
231.25 60 1205,5202,6486
234.38 59 6506
237.50 58 0901,1285,5282,6586
240.62 58 6606
243.75 57 1305,5302,6686
246.88 56 6706
250.00 56 0981,1385,4981,5382,5385,6786
256.25 54 1405,5405
262.50 53 0a01,1485,4a01,5485
268.75 52 1505,5505
275.00 50 0a81,1585,4a81,5585
281.25 49 1605,5605
287.50 48 0b01,1685,4b01,5685
293.75 47 1705,5705
300.00 46 0580,0b81,0b84,1785,4b81,5785
306.25 45 5805
312.50 44 0c04,4c01,5885
318.75 43 5905
325.00 43 0600,0c84,4c81,5985
331.25 42 5a05
337.50 41 0d04,4d01,5a85
343.75 40 5b05
350.00 40 0680,0d84,4d81,5b85
356.25 39 5c05
362.50 38 0e04,4e01,5c85
368.75 37 5d05
375.00 37 0700,0e84,4e81,5d85
381.25 36 5e05
387.50 36 0f04,4f01,5e85
393.75 35 5f05
400.00 35 0780,0f84,4f81,5f85
406.25 34 6005
412.50 33 1004,5001,6085
418.75 33 6105
425.00 32 0800,1084,5081,6185
431.25 32 6205
437.50 32 1104,5101,6285
443.75 31 6305
450.00 31 0880,1184,5181,6385
thanks to your efforts with testing different voltage settings on the s1, i now know exactly what to set my s1 boards at ( i have 20 ) should give me aprox 900 GHS for aprox same level as S3s :-p