/* Avcomm_HF_Tranceiver 18_Jun_21 Version 1'0 Combination of HF_sequencer_wkg_1_0 and HF_Synth_ver_1 samall D3 is Ptt to Amp, A6 is Ptt input, D2 is drive inhibit relay D4 is Antenna-coax relay */ // libraries for the Synth #include #include Adafruit_SI5351 clockgen = Adafruit_SI5351(); //variables for the sequencer int inhibit=2; // on pin Digital 2 INHIBIT int ptt=A6; // PTT input on pin Analog A6 int bias=3; // Bias enable on amp int relay=4; // output Relay int tx = 1000; // put ptt into receive void setup() { //setup sequencer pinMode(inhibit, OUTPUT); // set inhibit pin as an output pinMode(ptt, INPUT); //set PTT input pin as an input pinMode(bias, OUTPUT); //bias pin set as an output pinMode(relay, OUTPUT); //relay pin set as an output // pinMode(ptt, INPUT_PULLUP); //ptt input high - not needed digitalWrite(inhibit, LOW); // set inhibit to off analogWrite(ptt, 255); // set ppt high digitalWrite(bias, LOW); // set amp to off digitalWrite(relay, LOW); // set output relay to Rx (off) delay(3000); // wait 3 seconds before starting Serial.begin(9600); Serial.println("Si5351 Clockgen Test"); Serial.println(""); /* Initialise 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!"); /* INTEGER ONLY MODE --> most accurate output */ /* Setup PLLA to integer only mode @ 900MHz (must be 600..900MHz) */ /* Set Multisynth 1 to 28MHz but integer only mode (div by 4/6/8) */ /* 25MHz * 28 = 700 MHz, then 700 MHz / 25 = 28 MHz */ Serial.println("Set PLLA to 700MHz"); Serial.print(" \r\n"); // Print a return and new line clockgen.setupPLLInt(SI5351_PLL_A, 28); Serial.println("Set Output #1 to 28.0 MHz"); Serial.print(" \r\n"); // Print a return and new line clockgen.setupMultisynth(1, SI5351_PLL_A, 25, 0, 1); /* Enable the clocks */ clockgen.enableOutputs(true); } /**************************************************************************/ /* Arduino loop function, called once 'setup' is complete (your own code should go below) - A sample sequencer code follows - check that it has the right sequence for your hardware */ /**************************************************************************/ void loop() { // code for sequencer int tx = analogRead(ptt); if (tx <= 10) { // go to transmit // ptt detected as earthed; - start Tx sequence otherwise jump digitalWrite(relay, HIGH); //RF output relay set to Tx delay(60); // 60 ms to let the antenna relay switch digitalWrite(bias, HIGH); //Amp bias energised ON delay(30); // 30 ms to let the bias relay switch digitalWrite(inhibit, HIGH); //apply the drive to PA delay(60); // 60 ms to let the inhibit relay switch //Serial.print Serial.print(tx); Serial.print(" \r\n"); // Print a return and new line Serial.print("Transmit"); } if (tx >= 10) { // go to receive // ptt detected as earthed to start Receive sequence digitalWrite(inhibit, LOW); //Drive immediately removed from PA delay(60); // 60 ms delay for inhibit relay to operate digitalWrite(bias, LOW); //Amplifier bias volts terned off delay(60); // 60 ms to let the bias volts goto zero digitalWrite(relay, LOW); //RF output relay set to Receive Serial.print(tx); Serial.print(" \r\n"); // Print a return and new line Serial.print("Receive"); } delay(10); // delay and go back and test for a change in tx/rx }