user29599: This pesky watchdog RC oscillator is at the limit of its 10% tolerance already at room temperature. i was looking to bringing it to more like 5% (it stems from an internak 128 kHz RC oscillator) and the whole -40 ... 125 deg Celsius operating range. Can this reliably be done by reading the temperature of the MCU and applying an algorithm ? Any such working algorithm ?
The calibration is actually the adjusting of the number of cycles (of say, 125ms) the watchdog will run for. i.e. for 12.5 seconds I would run the watchdog timer 100 times, nominally. How do I temperature-compensate the 100 figure ?

user23644: Your description is pretty detailed but you've missed to tell, which device you are talking about.
I assume you are talking about the ATmega 328P in an Arduino Uno.
AFAIK you can only calibrate the so called Calibrated internal RC oscillator, which is used for the main operations.
You cannot calibrate the Internal 128kHz RC oscillator from the watchdog.
I think you might have some overhead from your sleep/wake cycles.
Instead of sleeping 100 times to get from 125ms to 12.5s you could sleep for 8s + 4s + 0.5s. Thus sleeping only 3 times. Which might save you some battery life.

user16238: We've been using the WDT delta as a temperature sensing method:
https://thecavepearlproject.org/2019/02/25/no-parts-temperature-measurement-with-arduino-pro-mini-to-0-005c-or-better/
Point being that once you have those calibration constants, you could use them use them to correct for WDT variation. OR you might be able to get away with a much shorter  interval than the 1sec we use, with the micros reading as your WDT correction factor more directly.

29599: <p>This pesky watchdog RC oscillator is at the limit of its 10% tolerance already at room temperature. i was looking to bringing it to more like 5% (it stems from an internak 128 kHz RC oscillator) and the whole -40 ... 125 deg Celsius operating range. Can this reliably be done by reading the temperature of the MCU and applying an algorithm ? Any such working algorithm ?</p>

<p>The <em>calibration</em> is actually the adjusting of the number of cycles (of say, 125ms) the watchdog will run for. i.e. for 12.5 seconds I would run the watchdog timer 100 times, nominally. How do I temperature-compensate the 100 figure ?</p>
 23644: <p>Your description is pretty detailed but you've missed to tell, which device you are talking about.</p>

<p>I assume you are talking about the ATmega 328P in an Arduino Uno.<br>
AFAIK you can only calibrate the so called <code>Calibrated internal RC oscillator</code>, which is used for the main operations.<br>
You cannot calibrate the <code>Internal 128kHz RC oscillator</code> from the watchdog.</p>

<p>I think you might have some overhead from your sleep/wake cycles.<br>
Instead of sleeping 100 times to get from 125ms to 12.5s you could sleep for 8s + 4s + 0.5s. Thus sleeping only 3 times. Which might save you some battery life.</p>
 16238: <p>We've been using the WDT delta as a temperature sensing method:</p>

<p><a href="https://thecavepearlproject.org/2019/02/25/no-parts-temperature-measurement-with-arduino-pro-mini-to-0-005c-or-better/" rel="nofollow noreferrer">https://thecavepearlproject.org/2019/02/25/no-parts-temperature-measurement-with-arduino-pro-mini-to-0-005c-or-better/</a></p>

<p>Point being that once you have those calibration constants, you could use them use them to correct for WDT variation. OR you might be able to get away with a much shorter  interval than the 1sec we use, with the micros reading as your WDT correction factor more directly.</p>
