AVR or PIC with external crystal controlled watch dog timer.

Is there such a Micro.
Most seem to have a free running WDT oscillator.
Have an oddball application where the Micro sleeps for 99% of the time, but needs crystal accuracy whilst asleep, and for the other 1% of the time when it wakes up has to run at 20 Mhz clock rate to do some fast calculations.
So I cant simply use a normal 32.5 Khz crystal for the normal operation.

Timer 2 on the 328 processor can be independently driven by a watch crystal. That gives you exactly what you want.

Or, you could just add an RTC to the mix.

Timer 2 on the 328 processor can be independently driven by a watch crystal.

The ability to run one of the timers from a separate low-speed crystal is quite common in many microcontroller product families... (watch out for the startup time of the main oscillator, though. That can be quite slow even when you have the low-speed crystal running all the time. One of the TI MSP430 claims to fame is especially fast startup of the main oscillator, which (I think, more or less) they do by letting it start in a relatively un-precise way, and sync to the crystal "pretty soon thereafter." (details may be different on different chips!))

There are WDT IC's made that reset the controller if not themselves being reset from the processor. I''ve used them with some early Microchip products.


Thanks everyone for the info re timer2.
Id forgotten completely there is a separate oscillator for that timer.
Not a feature I have ever used before.
Learn something new all the time.

Hi mauried
I am trying to use a rtc via a watch crystal on a ATmega1284p so i can keep the timer running while the CPU goes to sleep.
I have found some code from ATmel (attached and PDF) but I do not know how to change the code to work on the “Arduino” sketch.
Do you have any sample code I could use?

Best regards

Avr134.zip (1.58 KB)

doc1259.pdf (66.9 KB)