Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Substitution of AT89S8252 Watchdog

Status
Not open for further replies.

GrandAlf

Advanced Member level 2
Advanced Member level 2
Joined
Mar 9, 2002
Messages
520
Helped
47
Reputation
92
Reaction score
6
Trophy points
1,298
Location
UK
Visit site
Activity points
4,730
AT89S8252 Ext Watchdog

I have never found that the internal wathdog on the AT89S8252 to be very reliable, and have always used an external device driven from a port pin. On my next project I will have difficulty finding a spare pin. The question is, I am thinking of using ALE instead, I know it will work, but will it be as reliable as software generated pulses. BTW there is no external memory used. Any comments appreciated.
 

Re: AT89S8252 Ext Watchdog

Hi GrandAlf,

Even if you don't use an external memory, the AT89S8252 keep sending ALE pulses at a constant rate of 1/6 the oscillator frequency.
ALE it's not an I/O pin, thus you have no control on it.
If you want to use the pulses which are coming out merely from the ALE pin, that's not as reliable as software generated pulses because even if the micro stops in a closed loop, the ALE pulses are still sent outside.
Thus, if you have an external device working as retriggerable monostable by the pulses coming from your spare pin, that will not work if you have in mind to use the ALE. Just because it will never reset the micro, like an watchdog would.

It's true that you can set bit 0 of SFR location 8EH in order to stop sending pulses on ALE when the external memory it's not accessed, but I would not count on that, though it could work.
 

Good point Silvio, I appreciate your advice. I can see that this would be no more reliable than using the inbuilt WD. This of course has the problem that if it does not get a clean reset, it will not restart properly. Will have to think of of another way.
 

Re: AT89S8252 Ext Watchdog

Hi GrandAlf,

You can use the AT89S8252's provided feature of disable ALE signal as follows:

Code:
ALE_ONOFF EQU 8Eh     ;SFR label declaration

ORL ALE_ONOFF,#01h    ;Stop sending ALE (start of external monostable 
;.                     cycle driven by ALE pin and first Watchdog cycle)
;.                    
;.
;.
;.replace this with your code
;.
;.
CLR EA
ANL ALE_ONOFF,#0FEh   ;Start sending ALE pulses and retrigger monostable
NOP                   ;leave one cycle to be sure
ORL ALE_ONOFF,#01h    ;Stop sending ALE pulses and allow monostable to run
SET EA
;.
;.
;.replace this with your code
;.
;.
;.
CLR EA
ANL ALE_ONOFF,#0FEh
NOP
ORL ALE_ONOFF,#01h
SET EA
;.
;.
;.
;.

The time spent between opcodes ORL and ANL (those reserved for your code) should
be less than the external monostable time constant (watchdog period).
You must insert the pair ANL NOP ORL at constant rate in your program in order to retrigger the external monostable.
If your program stuck somewhere and not being able to hit the point where ANL NOP ORL are inserted, the external monostable will reset the micro.

I had never tried, maybe the above code could work, I don't know.

But the most important thing depends upon what you are using the watchdog timer to guard against:
1. unexpected consequences of coding or
2. gamma ray particles passing through the chip die

If you choose first point then you should wonder how you can store the PC (program counter) address where you stuck and parsing your program for that address after recover.
If you are unable to find it, at least you should be happy that your microwave oven didn't burned the chicken due to program lock.

Regards,
Silvio
 

Re: AT89S8252 Ext Watchdog

GrandAlf why you find WD on 8252 not reliable?

I use WD on 8252 a few times and I think it's works fine.

Mr.Cube
 

Thanks again Silvio, these were the lines that I was already thinking of. I was more interested in guarding against lockups due to external effects, rather than software loops, so I suppose I could just use ALE as is.

Mrcube,
The problem seems to be that when a lockup occurs due to electrical noise, if the noise is still there when the MCU starts up again, it can corrupt the startup procedure, and not set up the WD registers properly, thus you lose the WD and the MCU is still locked. External WD chips with SW generated pulses get round this problem.

However well you think you have designed something with regard to EMC, it can still happen. Main problem seems to be local lightning strikes, or very bas power surges. There is a limit of what you can do, and still remain cost effective.
 

Re: AT89S8252 Ext Watchdog

Nice to know that lockup of 8252 exist.

But, if you put mcu in metal case (EM noise protection) connected to gnd of mcu design and put quality capacitor (some polypropilen or ceramic or something like it) on power supplies pins of mcu closer as posible (electrical noise trought power supply protection), I think that is good enough to keep from lockup effect.

Tell me if I'm wrong.

Mr.Cube
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top