3,5 Meterband RX / TX?

Hallo rob007,

Het schema zal ik wel hebben veel van die CATV apparatuur gerepareerd en ontworpen.
Ik heb nog een stuk of 30 Astro stereo encoders / modulatoren moet alleen een andere program controller in.....

Groet,
Henk.

Everything should be as simple as possible, but not simpler.

Mocht er nog interesse zijn over hoe de SBM aan te passen is, dan kan ik daar verder nog wel wat over vertellen.

Hopelijk neemt niemand het me kwalijk dat ik reageer op zo'n oude thread, maar ik ben geïnteresseerd in de Arduino-sketch en wat uitleg. Ik had al naar de PLL van pira.cz gekeken, maar een Arduino Nano is veel gemakkelijker, en daar heb ik er nog een paar van op voorraad.

Als iemand toevallig een foto heeft van hoe de RF-output op de print hoort te zitten, dan hoor ik dat graag.

Mijn SBM19 had ook een eindtrapje, maar dat is volgens de vorige eigenaar ooit overgezet in een SFM of een SFY, dus als ie op de 3.5 meter kan is een trapje het volgende projectje.

Ik hoor het graag, alvast bedankt.

EDIT:
Om de volgende geïnteresseerden een lange zoektocht te besparen, hier de oplossing.

Gebruik de bibliotheek van https://github.com/junon10/saa1057.

Hiermee lockt de SBM netjes vanaf de 78.5 Mhz op mijn exemplaar.

De onderstaande code kan worden gebruikt om via de seriële/usb poort van de Nano de frequentie in te stellen, deze wordt opgeslagen in de EEPROM van de Nano.


/*
  Lib: PLL SAA1057
  Version: 1.0.6
  Date: 2024/05/28
  Original Author: Junon M modified by Retroman
  Hardware: Arduino Uno or Nano controlled by serial port
  Modified on 2024/11/07 for FM transmitter usage, Frequency will be stored and read from EEPROM
*/

#include <EEPROM.h>
#include "SAA1057.h"

const char *VERSION = "1.0.6";
const int EEPROM_FREQ_ADDR = 0;
const float DEFAULT_FREQUENCY = 108.0f;
const float MIN_FREQUENCY = 80.f;
const float MAX_FREQUENCY = 110.f;

float Frequency = DEFAULT_FREQUENCY;
float IF_Frequency = 0;
float lastSavedFrequency = 0.0f;

const uint16_t FAST_TUNE = CP_023;
const uint16_t SLOW_TUNE = CP_007;

const int SAA_CLOCK_PIN = 10;
const int SAA_DATA_PIN  = 11;
const int SAA_DLEN_PIN  = 12;

SAA1057 pll;

void setup() {
  Serial.begin(115200);
  Serial.print("PLL SAA1057\nVersion: " + String(VERSION) + "\n\n");
  pll.begin(SAA_CLOCK_PIN, SAA_DATA_PIN, SAA_DLEN_PIN);

  loadFrequency();  // Load the frequency from EEPROM or set to default

  lastSavedFrequency = Frequency;

  pll.clear(0xFFFF, 0);
  pll.set(T_IN_LOCK_CNT, T_SHL);
  pll.set(BRM, BRM_SHL);
  pll.clear(PDM_CLEAR, PDM_SHL);
  pll.clear(SLA, SLA_SHL);
  pll.set(SB2, SB2_SHL);
  pll.set(CP_07, CP_SHL);
  pll.clear(REFH, REFH_SHL);
  pll.set(FM, FM_SHL);
  pll.set(WORDB, WORDB_SHL);

  commitConfig();
}

void loop() {
  commandInterpreter();
}

void commitConfig() {
  pll.setFreqShift(IF_Frequency);
  pll.setFrequency(Frequency, FAST_TUNE);
  delay(50);
  pll.setFrequency(Frequency, SLOW_TUNE);

  if (Frequency != lastSavedFrequency) {
    EEPROM.put(EEPROM_FREQ_ADDR, Frequency);
    lastSavedFrequency = Frequency;
    Serial.print("Saving frequency: ");
    Serial.println(Frequency, 2);
  }
}

String Separator(int len) {
  String s = "\n";
  for (int i = 0; i < len; i++) {
    s += "-";
  }
  s += "\n";
  return s;
}

String getCommands() {
  String msg = "\n";
  msg += Separator(60);
  msg += "Frequency is set to " + String(Frequency, 2) + "MHz";
  msg += Separator(60);
  msg += "\nChoose an option:\n";
  msg += "1. Set new Frequency \n";
  msg += Separator(60);
  return msg;
}

void changeParam(String &returned_text, const String menu_label, const String menu_index, String text, float &value, const float min_value, const float max_value, const String unit) {
  static int pos = 0;
  String S = "";

  if (pos == 0) {
    returned_text = menu_index;
    S += Separator(60);
    S += "Enter the desired " + menu_label + " between " + String(min_value, 2) + unit + " and " + String(max_value, 2) + unit;
    Serial.println(S);
    pos++;
  } else {
    float number = text.toFloat();
    if (number >= min_value && number <= max_value) {
      value = number;
      commitConfig();
      pos = 0;
      returned_text = "";
      S += "Response = " + String(number, 2) + unit + getCommands();
      Serial.println("Frequency updated to: " + String(number, 2) + unit);
    } else {
      S = "Error, the value is out of range, please try again!";
    }
    Serial.println(S);
  }
}

void commandInterpreter() {
  static String lastS = "";
  if (Serial.available()) {
    String text = Serial.readStringUntil('\n');
    String S = (lastS != "") ? lastS : text;

    if (S.equalsIgnoreCase("1")) {
      changeParam(lastS, "Frequency", "1", text, Frequency, MIN_FREQUENCY, MAX_FREQUENCY, "MHz");
    } else {
      Serial.println(getCommands());
    }
  }
}

// Function to load frequency from EEPROM or use the default
void loadFrequency() {
  EEPROM.get(EEPROM_FREQ_ADDR, Frequency);
  if (isnan(Frequency) || Frequency < MIN_FREQUENCY || Frequency > MAX_FREQUENCY) {
    Frequency = DEFAULT_FREQUENCY;
    Serial.print("Loading default frequency: ");
  } else {
    Serial.print("Loading saved frequency: ");
  }
  Serial.println(Frequency, 2);  // Show either the default or the saved frequency
}

[Bericht gewijzigd door Retroman_32 op donderdag 7 november 2024 23:28:10 (75%)