Firmware arduino ino file added - copied from si5251 lib.
This commit is contained in:
parent
d74a0598d4
commit
b19f6f65d8
1 changed files with 43 additions and 0 deletions
43
firmware/firmware.ino
Normal file
43
firmware/firmware.ino
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
/*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "si5351.h"
|
||||||
|
#include "Wire.h"
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include "command_ctrl.h"
|
||||||
|
}
|
||||||
|
|
||||||
|
Si5351 si5351;
|
||||||
|
|
||||||
|
void setup()
|
||||||
|
{
|
||||||
|
// Start serial and initialize the Si5351
|
||||||
|
Serial.begin(57600);
|
||||||
|
si5351.init(SI5351_CRYSTAL_LOAD_8PF, 0);
|
||||||
|
|
||||||
|
// Set CLK0 to output 14 MHz with a fixed PLL frequency
|
||||||
|
si5351.set_pll(SI5351_PLL_FIXED, SI5351_PLLA);
|
||||||
|
si5351.set_freq(1400000000ULL, SI5351_PLL_FIXED, SI5351_CLK0);
|
||||||
|
|
||||||
|
// Set CLK1 to output 20 MHz
|
||||||
|
si5351.set_freq(2000000000ULL, 0ULL, SI5351_CLK1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void loop()
|
||||||
|
{
|
||||||
|
// Read the Status Register and print it every 10 seconds
|
||||||
|
si5351.update_status();
|
||||||
|
Serial.print("SYS_INIT: ");
|
||||||
|
Serial.print(si5351.dev_status.SYS_INIT);
|
||||||
|
Serial.print(" LOL_A: ");
|
||||||
|
Serial.print(si5351.dev_status.LOL_A);
|
||||||
|
Serial.print(" LOL_B: ");
|
||||||
|
Serial.print(si5351.dev_status.LOL_B);
|
||||||
|
Serial.print(" LOS: ");
|
||||||
|
Serial.print(si5351.dev_status.LOS);
|
||||||
|
Serial.print(" REVID: ");
|
||||||
|
Serial.println(si5351.dev_status.REVID);
|
||||||
|
|
||||||
|
delay(10000);
|
||||||
|
}
|
Loading…
Reference in a new issue