Sunday, June 03, 2018

Teensy 3.6 + Si5351 connection and code

Just another example for the Teensy 3.6 board. This one with the Si5351 clock generator breakout from Adafruit.

Schematic:




There is no need to supply external power if the board (+5V on Vin) is being used with USB, that's enough for the Teensy and Si5351 boards.


Resulting wave:


Code:
//------------------------
/*
  Outputs 1.1 Mhz on CLK2 output of the Adafrui Si5351 board connected to Teensy 3.6
  Just for demo.
  CT2GQV 2018
 */

#include
#include

#define Si_5351_crystal 25000000 // Adafruit breakout board
#define Si_5351_clock  SI5351_CLK2

Si5351 si5351;
long calibration_constant = -8000;

// Pin 13 has an LED connected on most Arduino boards.
// Pin 11 has the LED on Teensy 2.0
// Pin 6  has the LED on Teensy++ 2.0
// Pin 13 has the LED on Teensy 3.0
// give it a name:
int led = 13;

void setup() {               
  // initialize the digital pin as an output for the LED blink
  pinMode(led, OUTPUT);    

si5351.init(SI5351_CRYSTAL_LOAD_10PF, Si_5351_crystal, calibration_constant);
si5351.set_freq(110000000,Si_5351_clock); // 1.1Mhz

 
}

void loop() {
  // just blinks the led while power lasts
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}

//------------------------


And that's it,

Have a great week!

No comments: