/* Avcomm_HF_Sequencer 04 Sept_21 Version 1_0 HF_sequencer_1-0 (removed from HF_Travceiver_ver_1 small) D3 is Ptt-Bias to Amp, A6 is Ptt input, D2 is drive inhibit relay D4 is Antenna-coax relay */ //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 /* The next line may not work or be needed, depending on ext ptt cct voltage and impedence and manufacturer of Arduino nano To be safe use a 47K external pullup resistor to +5v. do not exceed 5V from the external ptt rail if connected to other equipment */ // pinMode(ptt, INPUT_PULLUP); 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("Sequencer start"); Serial.println(""); } /**************************************************************************/ /* 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 and delay times 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 }