Searching \ for 'RESET Problems on PICs' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'RESET Problems on PICs'.

Truncated match.
PICList Thread
'RESET Problems on PICs'
1998\04\22@132658 by zhuxh

flavicon
face
Hi, pauls on the list,

I just entountered a problem in my  recent project. As I am a green hand
in PIC application, I'd like to share this with you, and hope I can get
some advice.

My problem is about the identification of RESET STATUS of PICs at work.
If the PIC(e.g. P16c54) has disabled the WDT and doesn't use SLEEP on
whole process, after RESET on MCLR, how could I reliably determine
whether this RESET is caused by POWER-ON or MCLR? In other words,
is there any FLAG BIT that can change its value in different RESETs?

Do you have any suggestion? Thanks in advance!

1998\04\24@021309 by Michael Ghormley

flavicon
face
Starfire Zhu wrote:

> My problem is about the identification of RESET STATUS of PICs at work.
> If the PIC(e.g. P16c54) has disabled the WDT and doesn't use SLEEP on
> whole process, after RESET on MCLR, how could I reliably determine
> whether this RESET is caused by POWER-ON or MCLR? In other words,
> is there any FLAG BIT that can change its value in different RESETs?

I get the PICLIST in digest form and I kind of waited to see if anyone
else might answer you but since I can't find a reply, here is my two
pence.

An idea that occurs to me (someone please correct me if I'm wrong) is to
write value(s) from the EPROM into RAM variable(s).  On a MCLR reset, the
values should be unchanged.  On a power-up, the RAM locations come up
with random contents.

Your initialization code can check for the correct values.  If they are
not present then you know that this is a power-up so you write the values
into the RAM locations.  Of course, if they are there, then you know you
are resetting from a /MCLR.

If you use one 8-bit variable, then the chances are 255 to 1 that
power-up would produce the same value; two variables = 65535 to 1, etc.

I have never tried it, but it makes sense.

Michael

REMOVE THE .NS (NO SPAM) FROM MY ADDRESS TO REPLY
*****************************************
The strong do what they have to do and
the weak accept what they have to accept.
                            --Thucydides

1998\04\24@082430 by Caisson

flavicon
face
> Van: Starfire Zhu <spam_OUTzhuxhTakeThisOuTspamcheerful.com>
> Aan: .....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU
> Onderwerp: RESET Problems on PICs
> Datum: woensdag 22 april 1998 19:24
>
> Hi, pauls on the list,
>
> I just entountered a problem in my  recent project. As I am a green hand
> in PIC application, I'd like to share this with you, and hope I can get
> some advice.
>
> My problem is about the identification of RESET STATUS of PICs at work.
> If the PIC(e.g. P16c54) has disabled the WDT and doesn't use SLEEP on
> whole process, after RESET on MCLR, how could I reliably determine
> whether this RESET is caused by POWER-ON or MCLR? In other words,
> is there any FLAG BIT that can change its value in different RESETs?
>
> Do you have any suggestion? Thanks in advance!

Yes, I have.
In the documents about the PIC16C5? it say's :

Document : DS30015N
Page        : 4-31

Reset conditions for special registers:
Condition                 Status-register
------------------------------ ----------------------
Power-On reset          0001 1xxx
MCLR                        000u uuuu
MCLR from Sleep       0001 0uuu
WDT reset                 0000 1uuu
WDT from Sleep        0000 0uuu

x = Unknown
u = Unchanged

Hope this helps

Greetz,
 Rudy Wieser

P.s.
This document is available at the Microchip-site

1998\04\24@123559 by Mike Keitz

picon face
On Fri, 24 Apr 1998 11:31:18 +0200 Caisson <caissonspamKILLspamTELEBYTE.NL> writes:
{Quote hidden}

This is worth studying. However the original poster has also studied it
and realized that a MCLR reset leaves the bits unchanged.  Unless a WDT
timeout or SLEEP has occurred since power-on, the bits will read 11 after
a MCLR reset, exactly what they would read after the power-on reset.


_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

1998\04\24@123602 by Mike Keitz

picon face
On Thu, 23 Apr 1998 21:58:58 -0700 Michael Ghormley
<mikegspamspam_OUTBLACKSAND.NS.COM> writes:
>Starfire Zhu wrote:
>
>> My problem is about the identification of RESET STATUS of PICs at
>work.
>> If the PIC(e.g. P16c54) has disabled the WDT and doesn't use SLEEP
>on
>> whole process, after RESET on MCLR, how could I reliably determine
>> whether this RESET is caused by POWER-ON or MCLR? In other words,
>> is there any FLAG BIT that can change its value in different RESETs?

>An idea that occurs to me (someone please correct me if I'm wrong) is
>to
>write value(s) from the EPROM into RAM variable(s).  On a MCLR reset,
>the
>values should be unchanged.  On a power-up, the RAM locations come up
>with random contents.

This works, but in some cases the "random" RAM data may accidentally
match the EPROM data.  Using as many bytes as possible for this function
makes the possibility more remote.  On a particular chip, the RAM will
probably power-up with the same value almost every time.

Another idea: put a resistor to Vdd and a capacitor to ground on an input
pin.  If the power has just been turned on, the pin will read "low" until
the capacitor charges up.  If the pin reads "high" after a reset, it's
probably a MCLR reset and the power has been on all along.  A diode in
parallel with the resistor to quickly discharge the capacitor (and save
some stress on the PIC's protection diode) may be a good idea if the
power supply voltage can fall quickly.

I've never tried it, but the warning in the PIC data sheet about changing
the prescaler assignment suggests there is a "loophole" in the PIC logic
that allows forcing a WDT reset.  It appears that if the prescaler is
changed to WDT while it has a 1 in the bit that is driving the WDT logic,
the PIC resets.  This happens *even if the WDT is disabled in the
configuration bits*.  I think the process would be to set the prescaler
to TMR0, timer mode, clear it, wait until a bit is 1, then set it to WDT.

Forcing a WDT reset would clear the TO bit in the STATUS register.
Further MCLR resets would not change it, but another power-up will set it
back to 1.  Microchip may change the silicon so the force WDT reset trick
doesn't work (if it even works now) and then your program wouldn't work
either.

_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

1998\04\24@130557 by White Horse Design

flavicon
face
At 12:16 24/04/98 -0400, you wrote:

>Another idea: put a resistor to Vdd and a capacitor to ground on an input
>pin.  If the power has just been turned on, the pin will read "low" until
>the capacitor charges up.  If the pin reads "high" after a reset, it's
>probably a MCLR reset and the power has been on all along.

To change "probably" into definitely use a RESET\ line to discharge the
capacitor.

Alternatively, (or partly anyway) I use a MAX691A which has a pin to
indicate if the external watchdog bit - if it didn't it would have to be a
power on reset (unless other resets could be generated - maybe Brown-out
resets?).

Regards

Adrian

WWW    WWW   Adrian Gothard
WWW WW WWW   White Horse Design
WWWWWWWWWW   +44-385-970009 (Mobile/SMS), +44-118-962-8913/4 (voice/fax)
WWWW  WWWW   @spam@whdKILLspamspamzetnet.co.uk, http://www.users.zetnet.co.uk/whd
---
Developers of GPS satellite-based tracking systems

1998\04\27@071058 by Caisson

flavicon
face
> Van: Mike Keitz <KILLspammkeitzKILLspamspamJUNO.COM>
> Aan: RemoveMEPICLISTTakeThisOuTspamMITVMA.MIT.EDU
> Onderwerp: Re: RESET Problems on PICs
> Datum: vrijdag 24 april 1998 18:28
>
> On Fri, 24 Apr 1998 11:31:18 +0200 Caisson <spamBeGonecaissonspamBeGonespamTELEBYTE.NL> writes:
[Cut]

{Quote hidden}

_Now_ he tell's me ... ;-)

You are right ofcourse.  It didn't register when I copied it, but now it
does.

2 bits that tell you what kind of reset you did have (4 possibilities !)
and 5
types of reset ....  I'll have to remember that.

Greetz,
 Rudy Wieser

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...