1

I have an STM6821TWY6F watchdog IC for my MCU. When the MCU gracefully goes to sleep it will disable the a watchdog to prevent unwanted wake ups. The watchdog was designed to look for an oscillating signal from the MCU that it can't and shouldn't provide while asleep.

The disabling/enabling is done using a set/reset approach. However, I am running out of GPIOs on my MCU and I'd like to know if I can still use this approach with just 1 gpio. Meaning the same gpio sets and resets my latch?

jonathanjo
  • 14,034
  • 3
  • 34
  • 66
Feynman137
  • 1,243
  • 1
  • 7
  • 33
  • Can I ask what watchdog IC you have? – jonathanjo Nov 01 '22 at 02:29
  • 1
    Using this IC: STM6821TWY6F – Feynman137 Nov 01 '22 at 03:31
  • @Feynman137 The datasheet says, "The watchdog function may be disabled by floating WDI or tristating the driver connected to WDI." Why not tristate your I/O pin before going to sleep? – jonk Nov 01 '22 at 04:22
  • "a set/reset approach" -- what do you currently have? I'm not clear about how it uses more than one pin? A diagram would be great! – jonathanjo Nov 01 '22 at 10:48
  • @jonk i do remember reading this. I think this is a good idea actually. I need to make sure i can float the pin though – Feynman137 Nov 02 '22 at 04:07
  • 1
    @Feynman137 MCUs may include the ability to tri-state their outputs while keeping them an output. Another option, which may be easier, is to consider switching it to an input, instead, before going to sleep. – jonk Nov 02 '22 at 04:14
  • @jonk excellent idea, will try this – Feynman137 Nov 02 '22 at 15:03

1 Answers1

1

You could do something like a T-FF. Tie "T input" to logic high so every time there is a rising edge on GPIO, the output toggles. Would have to ensure the output starts up in a known state, and can keep track of if Q is high or low in software.

Every time GPIO '0' -> '1', xor a bit that keeps track of output state.

enter image description here

Yet Another Michael
  • 2,351
  • 1
  • 11
  • 19