555 Timer as external Watchdog

My sketch seems to hang on BOOT for no apparent reason and can hang anywhere from <1Hour toweeks.
When I REBOOT, sketch runs ok - until it hangs.
To overcome this, I need to implement an external WDT.

I am using a ProMini at 3.3V.

I am using the circuit : Arduino Watchdog timer – Arduino, ESP8266, ESP32 & Raspberry Pi stuff
I have changed the 555 device to the LMC555 which is a lowpower version of the 555.
My timing is:
Period: 25.308 seconds
Time High: 20.277 seconds
Time Low: 5.031 seconds

My Code:

#include<avr/wdt.h>
int HeartbeatPin = 13;

void setup() {
  wdt_disable();  // Disable the watchdog timer
  delay(100);


  Serial.begin(115200);    // Enable Serial

  //    DEBUG
  Serial.println(F("-----------------------------"));// The F() syntax copies the string to Flash Memory
  delay(50);
  Serial.println(F("BOOT"));// The F() syntax copies the string to Flash Memory
  delay(50);

    Serial.println(F("Initial Heartbeat - SETUP"));// The F() syntax copies the string to Flash Memory
  delay(50);
  heartbeat();

}

void loop() {
    Serial.println(F("Heartbeat - LOOP"));// The F() syntax copies the string to Flash Memory

 heartbeat();
 delay(1.5 * 30000UL);
}

void heartbeat() {

// Sink current to drain C2

pinMode(HeartbeatPin, OUTPUT);

digitalWrite(HeartbeatPin, LOW);

delay(300);

// Set pin back to High Impedance
pinMode(HeartbeatPin, INPUT); 
}

When a heartbeat is received by the 555 within the period expected by the 555 (delay(1 * 30000UL):wink: all is OK and I receive the following on the Serial Monitor:

-----------------------------

BOOT
Initial Heartbeat - SETUP
Heartbeat - LOOP
Heartbeat - LOOP
Heartbeat - LOOP

The problem I have is that when I increase the sending of the heartbeat to greater than the 555 expects (delay(1.5 * 30000UL):wink: the Arduino should REBOOT.
I have checked the circuit and all is OK with the reset line going LOW from the 5 seconds.
When the 555 attempts a REBOOT, I receive the following on the Serial Monitor:

-----------------------------

BOOT
Initial Heartbeat - SETUP
Heartbeat - LOOP
⸮⸮⸮⸮ <<----------------SHOULD REBOOT HERE

If I manually pull the reset line LOW, the Arduino reboots OK.

Is there something I am not doing correctly, or is there a hardware issue?

why is the HeartbeatPin being reconfigured as an OUTPUT and back to an INPUT using pinMode?

shouldn't the pin be made LOW and then HIGH?
does the the pin really need to be held LOW for 300 msec?

gciurpita:
why is the HeartbeatPin being reconfigured as an OUTPUT and back to an INPUT using pinMode?

shouldn't the pin be made LOW and then HIGH?
does the the pin really need to be held LOW for 300 msec?

From the link above:
It is not sufficient to just make the Output pin LOW to restart the timer, but afterwards it needs to be set HIGH again. However, even if an output pin is HIGH, there still is an internal impedance that could drain C2. Therefore after setting it as OUTPUT and LOW, we set it back to INPUT mode again, because as input the I/O pins of the Arduino have a fairly high impedance

you want to control an output pin. i don't understand why you don't configure the pin as an OUTPUT and control it's level HIGH/LOW.

are you controlling a MOSFET?

i believe a mosfet gate will store a charge. you may need to drive it HIGH

gciurpita:
you want to control an output pin. i don't understand why you don't configure the pin as an OUTPUT and control it's level HIGH/LOW.

are you controlling a MOSFET?

No, I am connecting from the 555 output directly to the RESET of the Arduino.

what is the HeartbeatPin connected to?

gciurpita:
what is the HeartbeatPin connected to?

The HeartbeatPin is connected from Arduino D13 to the TRIGGER Pin of the 555. When HeartbeatPin is LOW, it resets (restarts) the 555

why do expect the voltage to be on the pin when it is configured as an INPUT?

gciurpita:
why do expect the voltage to be on the pin when it is configured as an INPUT?

It is not sufficient to just make the Output pin LOW to restart the timer, but afterwards it needs to be set HIGH again. However, even if an output pin is HIGH, there still is an internal impedance that could drain C2. Therefore after setting it as OUTPUT and LOW, we set it back to INPUT mode again, because as input the I/O pins of the Arduino have a fairly high impedance

owever, even if an output pin is HIGH, there still is an internal impedance that could drain C2

can you post a circuit diagram?

the discharge pin is normally connected thru a resistor to discharge the capacitor when the voltage of the cap exceeds 2/3 Vcc on the threshold pin. you must not be relying on this to discharge the cap because it would cause a reset.

it sounds like you connected the output pin to the capacitor, possibly thru a resistor to discharge it. that's why don't want the output pin to be high.

i think (pending seeing the circuit diagram) you really need an external transistor to discharge the cap (instead of using the discharge pin. i had assumed this is what you were doing.