PBP3 what cause the resets ?


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    82

    Default PBP3 what cause the resets ?

    Ok, now that I have solved those strange sintax errors (thanks Darrel) I'm going on investigating why I have unexpected resets on my PIC18LF4680.
    This project runs fine since many years, but after some modifications, after upgraded to PBP3 and ICD3, I see this strange behaviour. I try to explain:

    Assume the program is simple:
    1) wait for a button in a cycle
    2) the button is pressed, the program do somethings and then go back to point 1, waiting again for the button.

    It happens sometimes, very rarely, that I fall in a strange situation:

    The button is pressed, the programs starts to do something but after a few seconds I see a reset.
    When I fall in this situation, I can continue pressing the button and the PIC will resets again after a few seconds. Only an hardware reset allow to exit from this situation, then the programs continue to run ok, but running and running, sooner or later I will fall again in this bug.

    I'm not asking you why this happen, I know it is almost impossible to understand without be here with me, but ... what can I do to investigate ?

    I was thinking to a stack overflow, (the STVREN is set to ON). I've put a "debug #STKPTR" at the beginning of the program but I see always 0.
    I was thinking to the watchdog, but PBP should manage it well.
    Anyway I have added a STKPTR=0 and a CLEARDWT in some points with no success.

    Whick kind of investigation can I do to discover the cause of the reset ? Observe some registers at the beginning ?
    I don't know if it is possible to ask help like this but I try ...
    Marco

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default Re: PBP3 what cause the resets ?

    Hi, Marcick

    What about the Brownout config settings ??? ( just a first idea ... seeing your device is a LF series device ... )

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    82


    Did you find this post helpful? Yes | No

    Default Re: PBP3 what cause the resets ?

    Thanks Alain. But I don't think.
    BOR is set to 2.1 V and. Vcc is stable 3.3V.
    Anyway I have fryer to disable BOR without success.
    Marco

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: PBP3 what cause the resets ?

    At the top of your program, before anything else ...
    Send the value of the RCON and STKPTR registers to an LCD or serial interface to the PC.

    Compare the values to table 4-3 in the datasheet.
    Then you will know what caused the reset.
    DT

  5. #5
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    82


    Did you find this post helpful? Yes | No

    Default Re: PBP3 what cause the resets ?

    Hi Darrel,
    I have put this code at the beginning of the program (really there is some register inizialization before):

    debug "RCON ",#RCON," - STKPTR ",#STKPTR,13,10
    RCON.0=1
    RCON.1=1

    When I power on the board I see "1 RCON 28 - STKPTR 0" so POR and BOR bit are cleared.

    Then I leave the board running and when the problem occours I have a reset and I see "RCON 31 - STKPTR 0".
    What does it means ? I have difficulties to guess.

  6. #6
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    82


    Did you find this post helpful? Yes | No

    Default Re: PBP3 what cause the resets ?

    My God .... sorry I have bored you. I found a variable not initialized in my code. There is nothinhg to explain. The program is doing what I wrote. They were not real resets, but jumps to the beginning of the program.
    Sorry again, but I was becoming crazy ...
    Thanks Darrel. It is watching to RCON that I realized they were not Resets.
    Marco

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts