So far, I've been through the tutorial, loaded the example sketch, and had success seeing the 112.5MHz signal from output 0 (the only output on which I have a SMA connector attached). I downloaded the ClockBuilder Desktop application, which gave me the following frequency plan for my 10MHz signal:
Code: Select all
PLL A
Input Frequency (MHz) = 25.000000000
VCO Frequency (MHz) = 800.000000000
Feedback Divider = 32
SSC disabled
Output Clocks
Channel 0
Output Frequency (MHz) = 10.000000000
Multisynth Output Frequency (MHz) = 10.000000000
Multisynth Divider = 80
R Divider = 1
PLL source = PLLA
Initial phase offset (ns) = 0.000
Powered down = No
Inverted = No
Drive Strength = b11
Disable State = Low
Clock Source = b11
I've initialized PLL A in integer mode, but for the multisynth divider I have to use fractional mode since my 800MHz won't divide cleanly by 4, 6, or 8 to get me what I need. Here's the sketch I wrote:
Code: Select all
/*SI5351_10MHz_Ref: Uses adafruit's clock generator board to produce
a stable 10MHz reference frequency.*/
#include <Wire.h>
#include <Adafruit_SI5351.h>
Adafruit_SI5351 clockgen = Adafruit_SI5351();
const int m=32; //Multiplier m is 32
const int divide=80; //Divider divide is 80
const int n=0; //Numerator n is 0
const int d=0; //Denominator d is 0
void setup(void){
Serial.begin(9600);
Serial.println("Si5351 Clockgen Test");
Serial.println("");
/* Initialize the sensor */
if (clockgen.begin() != ERROR_NONE)
{
/* There was a problem detecting the IC ... check your connections */
Serial.print("Ooops, no Si5351 detected ... Check your wiring or I2C ADDR!");
while(1);
}
Serial.println("OK! SI5351 found!");
Serial.println("");
/*Initialize clock in integer mode.
PLL freq = 25MHz * m
So, 25MHz * 32 = 800MHz*/
clockgen.setupPLLInt(SI5351_PLL_A, m);
/*Set clock divider to divide PLL freq by (divide +(n/d))
So...800MHz / (80 +(0/0)) = 10MHz!*/
Serial.println("Setting output 0 to 10.0 MHz");
clockgen.setupMultisynth(0, SI5351_PLL_A, divide, n, d);
//I don't think I need this R divider statement. Do I?
//clockgen.setupRdiv(0, SI5351_R_DIV_1);
//Enable the clock outputs
clockgen.enableOutputs(true);
}
void loop(void){
}
This is surely something simple that I've overlooked. Can anyone help me out?