Adafruit Si5351 breakout board on the left, Arduino Uno on the right.
The connections are simple: +5V and GND from the 7805 regulator, pin A4 from the Arduino Uno connected to pin SDA on the breakout board and pin A5 connected to pin SCL.
I have hacked the example program below, it sets the Si5351 to a default frequency of 28.4 MHz, i.e. 7.1 MHz after the divide by 4, and by using the serial monitor window in the Arduino IDE you can change frequency in 1 kHz steps up (1) or down (2), or 100 Hz steps up (+) or down (-). This frequency is output on CLK0 - the next step is to connect CLK0 to the 74AC74 flip flop.
You will need to install the Si5351 library by following the instructions here.
/*A 7805 regulator circuit used to convert ~12V to 5V is here.
* si5351example.ino - Simple example of using Si5351Arduino library
*
* Copyright (C) 2015 Jason Milldrum <milldrum@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "si5351.h"
#include "Wire.h"
Si5351 si5351;
char incoming_char;
long serial_input_number, serial_input_number1;
void setup()
{
// Start serial and initialize the Si5351
Serial.begin(57600);
si5351.init(SI5351_CRYSTAL_LOAD_8PF, 0);
// Set CLK0 to output 7.1 MHz with a fixed PLL frequency
si5351.set_pll(SI5351_PLL_FIXED, SI5351_PLLA);
si5351.set_freq(2840000000ULL, SI5351_PLL_FIXED, SI5351_CLK0);
serial_input_number1 = 7100000;
}
void loop()
{
if(Serial.available()>0){
incoming_char = Serial.read();
switch(incoming_char){
case '1': //up by 1kHz
serial_input_number1 = serial_input_number1 + 1000;
serial_input_number = serial_input_number1 * 4;
si5351.set_freq((serial_input_number) * 100ULL, SI5351_PLL_FIXED, SI5351_CLK0);
Serial.println(serial_input_number1);
break;
case '2': //down by 1kHz
serial_input_number1 = serial_input_number1 - 1000;
serial_input_number = serial_input_number1 * 4;
si5351.set_freq((serial_input_number) * 100ULL, SI5351_PLL_FIXED, SI5351_CLK0);
Serial.println(serial_input_number1);
break;
case '+': //up by 100Hz
serial_input_number1 = serial_input_number1 + 100;
serial_input_number = serial_input_number1 * 4;
si5351.set_freq((serial_input_number) * 100ULL, SI5351_PLL_FIXED, SI5351_CLK0);
Serial.println(serial_input_number1);
break;
case '-': //down by 100Hz
serial_input_number1 = serial_input_number1 - 100;
serial_input_number = serial_input_number1 * 4;
si5351.set_freq((serial_input_number) * 100ULL, SI5351_PLL_FIXED, SI5351_CLK0);
Serial.println(serial_input_number1);
break;
}
Serial.flush();
}
}
When you run the Arduino sketch you should be able to hear the output from the Si5351 on an HF receiver at 28.4 MHz
Next post: Quadrature Divider
No comments:
Post a Comment