Browned off by Brown Out [BOD]


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257

    Unhappy Browned off by Brown Out [BOD]

    Hi all,

    I need some advice on BOD Brown Out Detect programming as I'm doing my head in....

    Pic 12F683 locks up when Vdd voltage drops below 0.6Vdc and then returns => 1.5Vdc.

    Obviously I need to use the built in BOD feature but I'm having issues getting it to work the way I want. Here are my issues:

    1. If I set config fuse BOD = ON -> the device is continually in reset even when Vdd = 5V - basically a complete lock up.

    2. If I set config fuse BOD = SBODEN and enable BOD within the program - the PIC will reset at the place the code executes the enable BOD command. However - the pic does indeed BOD reset when voltage BOD occures.

    3. If I never enable BOD - then the program continues to work happily until a voltage BOD occures.

    What I want is for the program to keep running until a BOD occurres (~2.0Vdc) - then reset.

    Can someone see where I have gone wrong and point me in the right direction?

    Code:
    ' SET FUSES
    ASM  ; PIC12F683 
       __CONFIG    _MCLRE_OFF & _WDT_ON & _INTRC_OSC_NOCLKOUT & _BOD_SBODEN & _CPD_OFF &_PWRTE_ON 
    ENDASM
        PAUSE 100                              ' STARTUP DELAY
        CMCON0 = 7                             ' TURN ANALOG COMPARATOR MODE OFF
        ANSEL = 0                              ' MAKE ALL GPIOS INPUT ACCEPT GP2
        TRISIO = $3B                           ' INT OSC 4MHZ
        OSCCON = $61                           
        
        SBOREN  VAR PCON.4
        POR     VAR PCON.1
        BOR     VAR PCON.0
             
        SBOREN = 0                              ; BOR DISABLED
        
        
        PAUSE 1000
        SEROUT2 GPIO.2,188,["XXXXXXXXXXXX",13,10]    ; CLEAR BUFFER
        SEROUT2 GPIO.2,188,["RESET",13,10]     ; ANNOUNCE PROGGY STARTED/RESET
      
    MAIN:
      if POR = 0 then                          ; POWER RESET OCCURRED
            SEROUT2 GPIO.2,188,["POWER RESET OCCURRED",13,10]
            POR = 1                            ; CLEAR POR FLAG
            ENDIF  
      if BOR = 0 then                          ; BROWN OUT OCCURRED
            SEROUT2 GPIO.2,188,["BOR OCCURRED",13,10]
            BOR = 1                            ; CLEAR BOR FLAG
            ENDIF
      
        SEROUT2 GPIO.2,188,["Hello World!",13,10]
        PAUSE 1000
                        
        SBOREN = 1 ' ENABLE BOR                ; ENABLE BRWN OUT DETECT
        
        GOTO MAIN
        END

  2. #2
    Join Date
    Jun 2006
    Location
    Bangalore, India
    Posts
    136


    Did you find this post helpful? Yes | No

    Default Re: Browned off by Brown Out [BOD]

    This may or may not be relavent, buy try disabling the watchdog timer.

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


    Did you find this post helpful? Yes | No

    Default Re: Browned off by Brown Out [BOD]

    Hi, Squibcakes

    Did you had a look to Datasheet $ 12.3.7 ??? I see some flags that have to be set or reset @ power up " by hand " ....

    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 " !!!
    *****************************************

  4. #4
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257


    Did you find this post helpful? Yes | No

    Default Re: Browned off by Brown Out [BOD]

    Quote Originally Posted by Acetronics View Post
    Hi, Squibcakes

    Did you had a look to Datasheet $ 12.3.7 ??? I see some flags that have to be set or reset @ power up " by hand " ....

    Alain
    Hi Ace,

    I did actually RTFM - but I can't make heads or tails of this... what comes first the chicken or the egg when resets are envovled....maybe someone will throw me a bone....

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