But these ideas have merit, though. I, too, use the PIC WDT always, and disable the interrupts infrequently. The only place that clears the WDT (CLRWDT) is in the timer interrupt, which occurs in less than 15mS intervals. But some HLLs require that the WDT not be used. How will you recover a locked PIC? An external WDT is the best idea. Of course, there are SOT23 chips that do this... --Bob On Wed, Aug 19, 2009 at 8:15 AM, Harold Hallikainen wrote: > >> =A0I'm posting this as this particular setup wouldn't have struck me in >> a million years (+/- probability not defined). >> >> As many may know I've been hacking an LCD module from a Xerox printer. >> >> The designers have implemented a watchdog function using the I2C clock >> from the uC =A0as the timebase. >> >> The circuit is thus: >> >> I2C clock pin from uC goes to one gate of an 7405 inverter. The output >> of the inverter is held high via a 2K7 resistor, the junction goes to >> the clock input of one half of a D-Type flipflop (7474). RD and SD of >> the flipflop =A0are held high, The data input is also held high via two >> spare inverter gates from the 7405 whose outputs and inputs have a 2K7 >> resistor to Vdd. The Q output goes to an input pin of the uC. As the >> uC is unknown, this could be an ordinary input pin and software >> checked or a reset/interrupt pin. >> >> In the past when I've used a discrete watchdog timer rather than a WDT >> chip, I've used NAND gates in an oscillator configuration. The method >> used by Xerox might save a few components if an I2C or SPI clock is >> being used as part of the circuit. >> >> It is possible I suppose that this circuit might also just be a way of >> checking if the I2C clock is functioning, as with the LCD module >> disconnected, the printer will not come out of standby. >> >> Colin >> -- >> cdb, =A0 19/08/2009 > > > I don't think I fully follow the circuit, but I did an external watchdog > for an MC6802 years ago that was based on a 74C14 hex Schmitt. One section > was set up as an astable multivibrator. A capacitor from the input went to > Vcc. A resistor went from output to input. This determined the time > between reset pulses. A series diode and resistor was across that > resistor. This determined the length of the reset pulse. > > The input to the above mentioned Schmitt had a diode to the output of > another Schmitt with the cathode connected to the output of the new > Schmitt. If this point is pulled low, the oscillator stops with the reset > line high. > > The input to this second Schmitt has a pull-down resistor to keep the > output idling high, allowing the reset oscillator to generate periodic > reset pulses. > > The input to this second Schmitt has a capacitor to a controller output > pin that toggles as the program properly executes. This keeps resetting > the oscillator (pulling the input to the first described Schmitt low and > making its output high). If the pulses from the controller stop, the > oscillator times out and you get a reset pulse. > > You may also want to add clamp diodes on the input of the second described > Schmitt so the input is not driven negative. > > This could be driven by a separate output pin, or, as you describe, an I2C > or SPI clock. Nowadays, I just use the WDT in the PIC... > > > Harold > > > -- > FCC Rules Updated Daily at http://www.hallikainen.com - Advertising > opportunities available! > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist