etherkit / Si5351Arduino

Library for the Si5351 clock generator IC in the Arduino environment
GNU General Public License v3.0
233 stars 95 forks source link

set_correction() Doesn't appear to work #7

Closed pwarren closed 9 years ago

pwarren commented 9 years ago

From the 'jason' branch, I run the calibration example, with a correction of 22, and my board output's 10MHz, to the limit of my counter (1Hz).

Then if I run, a simple sketch that sets the clock as per the calibration example, with no set_correction() call. get_correction() returns -1, and the output is 22 Hz above 10MHz

Am I doing it wrong, or not understanding how the set_correction() works? Should I do set_correction(22); with each sketch I write?

NT7S commented 9 years ago

I believe that's probably a function of the EEPROM routines, which I have removed from the latest commit.

You should do a set_correction() for each sketch. I removed the EEPROM routines to make the code more portable, so that you can write your own calibration logic to read and set the cal constant into NV memory as appropriate for your device and use.