Hi,
Why how fast do you need the oscillator to start up?
I see a possible problem on that web site linked. It looks like he is using all integers to calculate the frequency control bytes. That could result in rounding which would then make the frequency setting look off. Integer divides result in integers even if it is mid calculation. Using floats might be better, then at the last step convert to integer.
So instead of 4/3 for example, 4.0/3.0 i think forces float math operations.
4/3 probably results in the integer 1. 4.0/3.0 probably results in 0.75 possibly approximated in type float (mid calculation). So 5*4/3 probably results in 5, and 5*4.0/3.0 results in 3.75 which is the more accurate calculation, and rounded in the usual way it would come out to the integer 4. That's unless the language forces floats when dividing.
Why how fast do you need the oscillator to start up?
I see a possible problem on that web site linked. It looks like he is using all integers to calculate the frequency control bytes. That could result in rounding which would then make the frequency setting look off. Integer divides result in integers even if it is mid calculation. Using floats might be better, then at the last step convert to integer.
So instead of 4/3 for example, 4.0/3.0 i think forces float math operations.
4/3 probably results in the integer 1. 4.0/3.0 probably results in 0.75 possibly approximated in type float (mid calculation). So 5*4/3 probably results in 5, and 5*4.0/3.0 results in 3.75 which is the more accurate calculation, and rounded in the usual way it would come out to the integer 4. That's unless the language forces floats when dividing.