Circuit shutting down

Hello all. I am building a project where I’d like a variable capacitor to tune a TEA 5767 FM radio module. I have the attached measuring schematic but have two issues I’d love to hear feedback on. First, the results are not 100%
stable. The value jumps around a bit when the capacitor is stable. Secondly, after about 5-10 minutes, the circuit shuts down and will not work.


capdebug2.ino (1.2 KB)

Since you are using only one of the inverters, connect the remaining ones in parallel and drive them from 2Y. R2 is also not needed.

This is a circuit I have used for several decades. It works, but it has limitations.

Paralleling the outputs reduces internal heating by a small amount, which has a noticeable effect on the frequency.

With this circuit, stability will be your main problem. I would expect a ±10–20% frequency error just from threshold drift. The 74HC14 has wide threshold tolerances that vary from chip to chip and also change with supply voltage and temperature.

Using one of the PWM outputs would give you a more stable clock, but frequency adjustment would then be software controlled.

Thank you very much for the info! Do you have a suggestion on a more stable approach to this with another component etc. ?

Don't you tune it via the I2C bus?

Without knowing the requirements that would be hard to say. Here are two links that may help. I will take a swag and say you want a square wave stable in frequency over time and easy to build.

https://www.phippselectronics.com/support/tea5767-fm-radio-receiver-module-users-guide/

A complete schematic would help.

Hi, @wrenchtwister
Your Code

/*
  74HC14 RC oscillator debug on D2 using period measurement.
  Much steadier than edge counting.

  Wire:
    74HC14 pin4 (2Y) -> 10k -> Arduino D2
*/

#include <Arduino.h>

const uint8_t PIN_IN = 2;

volatile uint32_t lastUs = 0;
volatile uint32_t periodUs = 0;
volatile uint32_t lastEdgeMs = 0;

void isrRise() {
  uint32_t nowUs = micros();
  uint32_t prev  = lastUs;
  lastUs = nowUs;
  lastEdgeMs = millis();
  if (prev != 0) {
    periodUs = nowUs - prev; // rising-to-rising
  }
}

void setup() {
  Serial.begin(115200);
  pinMode(PIN_IN, INPUT);
  attachInterrupt(digitalPinToInterrupt(PIN_IN), isrRise, RISING);

  Serial.println(F("Cap oscillator period debug (D2)"));
}

void loop() {
  static uint32_t lastPrint = 0;
  uint32_t now = millis();
  if (now - lastPrint < 200) return;
  lastPrint = now;

  uint32_t pUs, age;
  noInterrupts();
  pUs = periodUs;
  age = now - lastEdgeMs;
  interrupts();

  if (pUs == 0 || age > 500) {
    Serial.println(F("DBG no edges / no valid period"));
    return;
  }

  float f = 1000000.0f / (float)pUs;

  Serial.print(F("DBG period_us=")); Serial.print(pUs);
  Serial.print(F(" f_Hz=")); Serial.print(f, 2);
  Serial.print(F(" age_ms=")); Serial.println(age);
}

Tom.... :smiley: :+1: :coffee: :australia: