Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/30/04 10:58
Read: times


 
Msg Score: +3
 +2 Good Answer/Helpful
 +1 Informative
#84098 - Re.: Alternative ICs wanted
Responding to: ???'s previous message
Hi Suhail,

Implementation of Watchdog Timer.
Software wise:
If you have a free internal timer/counter, then start this timer, and in the ISR of this timer routine give the instruction "ljmp 0000h". And at various places in your program you have to reset the value of this timer to 0000.
So if your program gets hang, then chances ARE that, this Timer value may never be resetted to 0000; hence the timer will overflow and execute the "ljmp 0000", so it is equivalent to processor Power-On-Reset.

Hardware wise:
Use the DS1232 or the MAX1232, they also give you the CPU Reset signal. They have an in-built watchdog timer. Read the datasheet for more details. You have to give a pulse to this chip before the timer overflows, so in various locations in your program send a pulse to this chip. Again if your processor hangs, then chances ARE that, it will not execute your program which gives a pulse to this chip, so a timeout will occur in this chip and will eventually give a hardware reset to your chip.

The reason I am saying that "chances ARE that..." is because when a CPU hangs it may hang totally by not doing anything, or it may be executing some irratic code (not written by you).
If the CPU hangs totally, then it is OK, then most of the Watchdog timers will work. But if it is the second type then it may be executing a code which may be giving the pulse to DS1232, or resetting the timer value. In this case the watchdog functionality fails, But chances of second case is very negligible, but remember it CAN occur any time.

Please Note: In either case, Do not ever, trigger the watchdog timer in the interrupt service routines. Because I had seen a Taiwan make PID controller (using 7seg LED displays), that used to hang whenever it wrote into the EEPROM. The main Program loop used to get hanged, but the ISR for display was working properly, and this routine was giving pulses to watchdog timer.
Please do not pulse the Watchdog timer in any of the ISRs.

And by the way the Chips that you mentioned are available in Mumbai. But if you want to a replacement then you can try other chips such as TL084,etc. But for 4-20mA circuit I don't think you need a TL084, or TL034,etc. just by using any low cost opamp you can build a 4-20mA circuit.

AT89C51 is not available in Mumbai, but you can use the AT89S52, cost is somewhere around Rs.60~80.

praise me to lord



May the Lord Shower the blessings on you so that You complete the Successful PID Controller and a Sucessful product "Humdity + Temperature Controller"



Bye,
from Mr. Kiran V. Sutar.


List of 8 messages in thread
TopicAuthorDate
Alternative ICs wanted            01/01/70 00:00      
   Re.: Alternative ICs wanted            01/01/70 00:00      
      Watchdog + Reset generator            01/01/70 00:00      
         NVSRAM+WD            01/01/70 00:00      
      Good Reply.            01/01/70 00:00      
      Often a FET-OPamp is needed            01/01/70 00:00      
   WatchDogTimer made using 14538 ic            01/01/70 00:00      
   alternatives            01/01/70 00:00      

Back to Subject List