We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Is this possible if we use hard reset (Logic 1 Pulse with some delay) by using ISR and one Port Pin Connected to RESET Pin? so that Controller can RESET itself by Applying RESET signal by ISR. I mean Software *** Hardware RESET!
AT89S52 can be reset with logic high for 2 machine cycles to RESET PIN. I used Proteus VSM 7.1 and it shows RESET... Reset itself by ISR and Port Pin
delay(); RESET_Port_Pin=1; //Soft Reset to uC by Port Pin delay(); RESET_Port_Pin=0; delay();
But in Actual Circuit this Doesn't works. Without any chip it could be done or not? I think momentry latching of some type will help? Please help!
Did you find WDTRST defined in your processor-specific header file or did you add it yourself?
How is WDTRST defined?
i had to add... sfr WDTRST = 0xA6;
Andy,Dan,do you mean that write a near-to-overflow value to the watchdog and it will generate a RESET?
If so,I was really in faulty using.
"do you mean that write a near-to-overflow value to the watchdog and it will generate a RESET?"
Not necessarily.
If you enable the watchdog and then deliberately do not service it, it will generate a Reset!
As Dan showed:
IE = 0; WDTRST = 0x1E; // Enable the watchdog WDTRST = 0xE1; for (;;); // Infinite loop
That is its job, after all!
"sfr WDTRST = 0xA6;"
That's what it should be and the watchdog start sequence is the same provided by Atmel in their code samples. I didn't find any errata. The compiler should be emitting the following:
C2AF CLR EA 75A61E MOV WDTRST,#01EH 75A6E1 MOV WDTRST,#0E1H
What I learned was the controller would run into unknown states, for both hardware and software reasons.So the programmers enable the watchdog in the initial section and feed it every intervals.Hence once the controller flies away or stays long in unintended loop,the Watchdog would compliant for the ignoring. So the controller will be reset.
Is the usage above of faulty?
"Is the usage above of faulty?"
No, in fact, that usage model is the convention.
James hopes to use the watchdog in a less conventional way to programmatically cause a reset by enabling it and then not servicing it so that the watchdog timer expires and generates a reset.
"Hence once the controller flies away or stays long in unintended loop,the Watchdog would compliant for the ignoring. So the controller will be reset."
Exactly!
And so, if you deliberately don't service the watchdog, you know that it will cause a reset!
QEF.
I am, in fact, using the watchdog both ways in the same project.
Erik
Thanx to all Dan,Andy,Erik. WDT worked very well in ISR as provided by DAN HENRY (Special Thanks) >Ninja Z misguiding us.<
I had some problem in Circuit and now it's fully working. Actually i wanted a reset without Port High as RESET button pressed for long time does. This ISR causes RESET of uC without Ports High.
Again thanx to DAN HENRY for so much help.
This ISR causes RESET of uC without Ports High. There is no such thing, check the datasheet
what you have is "RESET of uC without Ports High for a long time
^^^ Really it is. With WDT, ISR Ports will be high for some micro seconds whether ISR button is pressed for long time or not ( ISR is written to clear Ports and then WDT Reset ( it will take 16 to 20 ms approx,during this period Ports are low)), and that is not a problem for us. But if RESET button is pressed for long time, Ports will be high as long as RESET is pressed, and that will cause problems to our machinery connected to uC (If someone like a kid will play around that RESET Button). Thanks to DAN HENRY! for this successful work.
^^^ Really it is. With WDT ISR, Ports will be high for some micro seconds whether ISR button is pressed for long time or not ( ISR is written to clear Ports and then WDT Reset ( it will take 16 to 20 ms approx for 11 or 12Mhz Clock, during this period Ports are low)), and that is not a problem for us. But if RESET button is pressed for long time, Ports will be high as long as RESET is pressed, and that will cause problems to our machinery connected to uC (If someone like a kid will play around that RESET Button). Thanks to DAN HENRY! for this successful work.