sparkfun / SparkFun_Clock_5P49V60_Arduino_Library

Arduino library for the SparkFun Clock Generator 5P49V60 (Qwiic) breakout board. The board offers a wide range of customizable frequencies in a wide range of different signal types using a single reference clock.
https://www.sparkfun.com/products/15734
Other
1 stars 2 forks source link

Errors in writing register #4

Open michaelcroquette opened 2 years ago

michaelcroquette commented 2 years ago

Hi,

I bought the Sparkfun Clock 5P49V60 card a month ago and after playing with it for a month I found a couple of issues in the library :

-When writing the integer part of the divider's register there is an error, you're only shifting the most significant bits by 3 and not 4. This causes the divider number to not be 100 but 196 for most of your examples. It's actually a lucky mistake because the VCO doesn't work at 1600 MHz apparently (btw it would be nice to have the working frequency band of the VCO, I couldn't find it anywhere on the Sparkfun website)

-In a lot of function you are using a 8 bits integer to code a 12 bits integer.

-When setting the fractional part of the frequency output divider you forgot to shift the 6 least significant bits by two.

-In example 2, you're modifying two times clock one.

Best, Michael

michaelcroquette commented 2 years ago

5

edspark commented 2 years ago

Excellent, I'm peeling through your pull request.