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.

  • \$\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 Nov 30 '11 at 17:57
  • \$\begingroup\$ just watchdog one \$\endgroup\$ – jiki Nov 30 '11 at 18:00

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.

| improve this answer | |
  • \$\begingroup\$ if I use secondary prescaler the formula is the same or diffrent? \$\endgroup\$ – jiki Nov 30 '11 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 Nov 30 '11 at 18:07
  • \$\begingroup\$ the value in [ ] is 128 or 256? \$\endgroup\$ – jiki Nov 30 '11 at 18:08
  • \$\begingroup\$ I have clarified my answer a little \$\endgroup\$ – Majenko Nov 30 '11 at 18:09
  • 1
    \$\begingroup\$ @jiki: Please accept the answer if you find it correct and helpful. \$\endgroup\$ – Andrejs Cainikovs Nov 30 '11 at 18:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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