2
\$\begingroup\$

Can someone help how to find formula and calculate this task?

How many times per second will be reset if the microcontroller is set to 1:128 preskaler microcontrollers and works on Frequency of 8 Mhz.

Could someone explain me how to solve this kind of task? Please.

\$\endgroup\$
2
  • \$\begingroup\$ On the '887 you have 2 prescalers on the watchdog - the dedicated 16-bit watchdog prescaler, and the secondary prescaler shared with Timer0. Are you using the secondary one at all, or just the watchdog one? \$\endgroup\$
    – Majenko
    Commented Nov 30, 2011 at 17:57
  • \$\begingroup\$ just watchdog one \$\endgroup\$
    – jiki
    Commented Nov 30, 2011 at 18:00

1 Answer 1

3
\$\begingroup\$

The watchdog always runs from the internal 31KHz internal oscillator.

The general formula for calculating the watchdog time is:

\$\frac{1}{31000}\times WDTPrescaler [\times Prescaler]\$

Where \$WDTPrescaler\$ is the dedicated 16-bit watchdog prescaler, and \$Prescaler\$ is the optional 8-bit prescaler shared with the Timer0 module.

So in your case it's

\$\frac{1}{31000}\times 128 = 0.004129032\$

Which is roughly 4ms.

If you were using the secondary shared prescaler you would multiply the answer by that value as well.

\$\endgroup\$
5
  • \$\begingroup\$ if I use secondary prescaler the formula is the same or diffrent? \$\endgroup\$
    – jiki
    Commented Nov 30, 2011 at 18:06
  • \$\begingroup\$ The formula would include the part in [ and ]. You can think of not using the Timer0 prescaler as using it but with it set to 1:1 - so multiply the answer by 1 - which does nothing ;) \$\endgroup\$
    – Majenko
    Commented Nov 30, 2011 at 18:07
  • \$\begingroup\$ the value in [ ] is 128 or 256? \$\endgroup\$
    – jiki
    Commented Nov 30, 2011 at 18:08
  • \$\begingroup\$ I have clarified my answer a little \$\endgroup\$
    – Majenko
    Commented Nov 30, 2011 at 18:09
  • 1
    \$\begingroup\$ @jiki: Please accept the answer if you find it correct and helpful. \$\endgroup\$ Commented Nov 30, 2011 at 18:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.