Accessing 328p watchdog counter?

Hi, in my project all of the 3 timers are used, so I decided to implement a "millis" function with the watchdog interrupt mode. It works great, but even with the minimum prescaler it's resolution is only ~16 ms. Since the prescaler takes input from the 128kHz oscillator and triggers the watchdog when some set value is reached, it must somehow keep track of how many cycles have occured and how many left still before the watchdog is triggered.
Is there any way of accessing this information? The datasheet doesn't seem to have anything about it, but you never know. Checking it in the interrupt would enable a much more accurate watchdog-millis.

Jopj:
Hi, in my project all of the 3 timers are used, so I decided to implement a "millis" function with the watchdog interrupt mode. It works great, but even with the minimum prescaler it's resolution is only ~16 ms. Since the prescaler takes input from the 128kHz oscillator and triggers the watchdog when some set value is reached, it must somehow keep track of how many cycles have occured and how many left still before the watchdog is triggered.
Is there any way of accessing this information? The datasheet doesn't seem to have anything about it, but you never know. Checking it in the interrupt would enable a much more accurate watchdog-millis.

Nope, the WatchDog counter is pure hardware, just a counter chain with no inter-stage readout connections. You have some control over the period of the WatchDog, the WDPn bits just select which stage is connected to the 'ouput', either a overflow results in an Interrupt or a Reset. Nothing Else.

If you are already controlling the other timers, why don't you just add a software stage for one of them?

the standard micros() has a 4 microsecond resolution, therefore the hardware can generate an interrupt on a 4microsecond interval (except, with a 16mhz clock, that is only 64 clocks, not much time for code to execute between interrupts?).

You can preset the timers, but you will have to manage multiplexing their output.

A table of current interrupt owner, next interrupt, delta to next interrupt, repeat cycle count...

I wrote a library that could run multiple complex concurrent sequences using the millisecond timer. It used this same idea: an array of sequences with current position in sequence, delta time to next operation, and the list of the sequence elements.

Now, my library was not designed for millisecond resolution, Just tenth of a second resolution(human reactions).

I do not know if the overhead of a software multiplexor would consume all of your CPU cycles, but it might not.

Chuck.

You can set the watchdog timer counter to zero any time you wish.