View previous topic :: View next topic |
Author |
Message |
Eduardo__
Joined: 23 Nov 2011 Posts: 197 Location: Brazil
|
Why PIC18 has only watchdog time set in fuses? |
Posted: Thu Apr 19, 2012 12:10 pm |
|
|
Why PIC18 has only watchdog time set in fuses?
I was thinking: Why Microchip changed PIC18 WDT feature function for changing only using #fuses? _________________ Eduardo Guilherme Brandt |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19499
|
|
Posted: Thu Apr 19, 2012 2:55 pm |
|
|
To do the job it is really 'meant' to do, ideally it'd be basically impossible to change _anything_ about the watchdog, once the chip is running!....
Remember that every thing that allows you to stop, or increase the time delay associated with it, increases the risk of it being interfered with incorrectly by software. Sharing the use of the timer prescaler, increased the risk of something being incorrectly changed, and stopping it resetting the chip when it should. So the watchdog can on later chips be set to start when the chip starts, with no option to change anything, except reset the timer. You do still have the option of stopping it in software (if this is enabled), and if you want to have an extended timeout, then you can do this by implementing (say) a tick interrupt, and have this count down another register, resetting the watchdog, till this reached zero, to give programmable timeout's.
Problem is that since a lot of people use the watchdog for 'other tasks', the lack of flexibility can be annoying, but it really is better practice in terms of fulfilling the real aim of the watchdog.
Best Wishes |
|
|
Eduardo__
Joined: 23 Nov 2011 Posts: 197 Location: Brazil
|
|
Posted: Fri Apr 20, 2012 7:10 am |
|
|
Thank you Ttelmah.
What do you think of using WDT to wakeup from sleep? Is it a good practice? _________________ Eduardo Guilherme Brandt |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19499
|
|
Posted: Fri Apr 20, 2012 7:46 am |
|
|
If you want a reasonably accurate time, use a watch crystal, and timer1. Much more flexible and accurate, and typically draws less power than the WDT oscillator...
It is one of those "can't really get your head round why Microchip do it this way". I'd much prefer to have the watchdog as a completely separate system, only used for it's real job, and for them to have offered a separated timer to do the wake up. They do this with Timer1, but at a cost of two pins. They approach this, on some of the nanowatt chips. The actual number of gates used by these parts of the chip are so small that it seems a strange shortcoming.
C'est la vie.
Best Wishes |
|
|
Eduardo__
Joined: 23 Nov 2011 Posts: 197 Location: Brazil
|
|
Posted: Fri Apr 20, 2012 8:13 am |
|
|
Thank you Ttelmah.
Just a remark, in the case of PIC16F628A,
• Watchdog Timer Current:
- 1μA @ 2.0V, typical
• Timer1 Oscillator Current:
- 1.2μA @ 32 kHz, 2.0V, typical
really both WDT and TIMER1 oscillators have low operation currents.
Thanks for your opinion and clean information. _________________ Eduardo Guilherme Brandt |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19499
|
|
Posted: Fri Apr 20, 2012 9:00 am |
|
|
On several of the PIC18 nanowatt parts, the WDT draws significantly more (typically twice) the timer1 current.
Slightly puzzled by your figure, since the minimum operating voltage for the 16F628A, is 3V.....
I _hope_ you are actually using the 16LF628A?.
Note also though that if the voltage is anything higher, then timer1 'wins' at 3v, it still only draws 1.3uA, while the WDT has risen to 2uA. At 5v, the timer goes up to 1.8uA, while the WDT has risen to 9uA. Terrible!...
Best Wishes |
|
|
Eduardo__
Joined: 23 Nov 2011 Posts: 197 Location: Brazil
|
|
Posted: Fri Apr 20, 2012 2:47 pm |
|
|
Yes, I´m using PIC16F628A from 2 to 3V, zinc-air battery powered.
But, thank you for the remark about Supply voltage versus WDT supply current.
It seems that in the real world, most of the times, we have no best option.
We´ve always several options on the wall, to choose from.
Come vous avez dit:
C´est la vie! _________________ Eduardo Guilherme Brandt |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19499
|
|
Posted: Fri Apr 20, 2012 3:02 pm |
|
|
Eduardo__ wrote: | Yes, I´m using PIC16F628A from 2 to 3V, zinc-air battery powered.
But, thank you for the remark about Supply voltage versus WDT supply current.
It seems that in the real world, most of the times, we have no best option.
We´ve always several options on the wall, to choose from.
Come vous avez dit:
C´est la vie! |
Change your chip.....
The _F_ chip is only rated to reliably work down to 3V. You need the _LF_ part to operate down to 2v. As with most things in electronics, you may well 'get away' with running outside the specification, but it is not the way to generate things to be reliable.....
Best Wishes |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Fri Apr 20, 2012 4:45 pm |
|
|
Eduardo__ wrote: | What do you think of using WDT to wakeup from sleep? Is it a good practice? |
It is like using a parachute to get out of an airplane. It ought to work but it won't be accurate and leaves no backup if it fails. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
|