Surviving 1 second without battery power


Closed Thread
Results 1 to 28 of 28
  1. #1
    Join Date
    Feb 2005
    Posts
    130

    Default Surviving 1 second without battery power

    Im trying to understand how this LED flashlight driver works, so I can implement the same technique on my own design.

    The driver is powered by a single 3.6v Li-ion battery and by powering it off-on in less than a second it changes modes: Hi 100% > Mid 35% > Lo 20% > Strobe > SOS

    Here is the link to it:
    http://www.dealextreme.com/details.dx/sku.6190
    AMC7135 Datasheet

    And here is the Schematic I drawn from inspecting the PCB:


    It obviously detects when power goes off, but I don't have the slightest clue on how its done, if I have to think of some PIC function that does that it would be BOD, but to be honest, Im lost.

    The capacitor in the schematic may work as a battery backup, but its rather small, so upon battery power lost the PIC must be configured to keep consumption to a minimum.

    Any help will be appreciated!
    Last edited by peu; - 12th March 2008 at 14:50.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    It might not have to survive without power.
    If you power up, read a byte from eeprom, you can know what mode you were in last time around, increment that value, then power down.
    Next time you power up, you read the same byte, the mode has incremented, save the value, power down...wash lather rinse repeat.
    And there's probably some slick single-button power on/off trickery going on.
    Do a search and you'll find a slick single-button power on/off trickery circuit here too...

  3. #3
    Join Date
    Feb 2005
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    It might not have to survive without power.
    If you power up, read a byte from eeprom, you can know what mode you were in last time around, increment that value, then power down.
    Next time you power up, you read the same byte, the mode has incremented, save the value, power down...wash lather rinse repeat.
    And there's probably some slick single-button power on/off trickery going on.
    Do a search and you'll find a slick single-button power on/off trickery circuit here too...
    Thanks for your prompt reply Skimask (as always I must add )


    If you power up say after 10 seconds it remembers the last mode, but if you do an ON-OFF-ON cycle in less than a second it changes modes as described. Thats the only way to change modes, fast ON-OFFs

    No button trickeries, just fast ON-OFFs I have the driver at hand, and this technique is rather common in new multimode LED flashlights.

    I know how to do it by using an extra diode and a PIC pin to detect power lost, but this circuit uses a more efficient way for doing that.

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by peu View Post
    If you power up say after 10 seconds it remembers the last mode, but if you do an ON-OFF-ON cycle in less than a second it changes modes as described. Thats the only way to change modes, fast ON-OFFs
    So you've got a counter...that counts...and it sits there...counting...
    when the power button is pushed...
    If the count < x then it saves the next mode and powers down
    If the count > x then it doesn't switch modes in eeprom and just powers down

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


    Did you find this post helpful? Yes | No

    Talking The good question ...

    Is it a Power on Reset

    or

    Is it a Brown Out Reset ...

    Just test the PCON bits ... to know it. and do what's to do.

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

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    But if it's one of those single button power on/off type circuits, it'll always be a power on reset.

  7. #7
    Join Date
    Feb 2005
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    So you've got a counter...that counts...and it sits there...counting...
    when the power button is pushed...
    If the count < x then it saves the next mode and powers down
    If the count > x then it doesn't switch modes in eeprom and just powers down
    But you must count while the power is out... there is no backup power. The mode is changed if you do an ON-OFF-ON cycle in less than a second.

    I Just updated the schematic to clearly show the entire circuit is battery powered with no backup power, reload the image so the new one is shown.


    Maybe Im missing something from your answer <scratching head>

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


    Did you find this post helpful? Yes | No

    Wink

    Quote Originally Posted by peu View Post

    Maybe Im missing something from your answer <scratching head>
    YES !!!

    The capacitor holds enough power to the PIC not to reset all registers While you do the "quick on-off-on"

    remember V b.o.r. is more than the min running voltage of the Pic ... and driving your current sinks do not drain much current from the PIC ...

    so that gives enough time for the Pic to reset AND test the BOR Bit, change the mode, ... ... after that you re-apply the power ...

    Héhé ...
    ************************************************** ***********************
    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 " !!!
    *****************************************

  9. #9
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by peu View Post
    Maybe Im missing something from your answer <scratching head>
    Ok, I smell what your cooking...
    Put a meter on the cap and see what it reads and how fast it decays.
    Maybe it's a version of a super-cap in a really small package.
    PIC's (nano-watt PIC in particular) can draw some seriously LOW current in a sleep mode.

  10. #10
    Join Date
    Feb 2005
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    I think I understand what you guys mean, this would be the metacode

    set BODEN config bit to 1

    set BOD bit to 1
    set POR bit to 1
    read level from eeprom / set level

    mainloop
    check for BOD/POR bits at PCON register
    if BOD=0 then wait for POR=0 and change to next level and write it to eeprom.
    goto mainloop
    end

    Is this correct?

    I have some questions:

    What would happen if power is lost while writing to eeprom?
    Can this be handled with PBP without using interrupts?

    Regarding the cap, I don't have a oscilloscope to see the discharge curve, it seems to last around 1seg to fall below 2v but this measurement was done by the eyemeter.

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


    Did you find this post helpful? Yes | No

    Lightbulb

    Hi, Peu

    NO, you did not understand ...

    1) You enable BODEN, nothing else required ...

    2) AT program start, you first read the BOR bit

    3) If BOR Bit = 0 THEN (and only IF ) you increase the EEPROM content : That means power is back, and did not reach ZERO !!! ( no Pb to write , then ...)

    4) If BOR Bit = 1 power has gone to ZERO ( and BOR bit has been reset ) ... just read the EEPROM content .

    5) you SET BOR bit

    6) you run your "lighting" program ...

    Think simple !!!

    Alain
    Last edited by Acetronics2; - 12th March 2008 at 19:55. Reason: BOR Electrical levels inverted ...
    ************************************************** ***********************
    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 " !!!
    *****************************************

  12. #12
    Join Date
    Feb 2005
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    KISS principle... I know... Im getting older&rusty (just crossed the 40 mark).

    Will give your post explanation a try in real code and let you know. Thanks!

  13. #13
    Join Date
    Feb 2005
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi, Peu

    NO, you did not understand ...

    1) You enable BODEN, nothing else required ...

    2) AT program start, you first read the BOR bit

    3) If BOR Bit = 1 THEN (and only IF ) you increase the EEPROM content : That means power is back, and did not reach ZERO !!! ( no Pb to write , then ...)

    4) If BOR Bit = 0 power has gone to ZERO ( and BOR bit has been cleared ) ... just read the EEPROM content .

    5) you run your "lighting" program ...

    Think simple !!!

    Alain
    Im kinda lost again:

    From TABLE 9-6: INITIALIZATION CONDITION FOR SPECIAL REGISTERS
    PCON is initialized with %00000010 (POR=1 BOD=0)
    From 2.2.2.6 PCON Register
    REGISTER 2-6: PCON — POWER CONTROL REGISTER (ADDRESS: 8Eh)

    bit 0 BOD: Brown-out Detect STATUS bit
    1 = No Brown-out Detect occurred
    0 = A Brown-out Detect occurred (must be set in software after a Brown-out Detect occurs)
    From these datasheet entries I dont understand when BOD goes to 1

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


    Did you find this post helpful? Yes | No

    Talking

    Hi,

    Do not worry !!!

    1 = No Brown-out Detect occurred
    0 = A Brown-out Detect occurred (must be set in software after a Brown-out Detect occurs)

    sooo ... just use the Bit level corresponding to what happend ! ... invert BOR levels I indicated for 3) and 4) and you'll have it ...

    I've correct the thread , NOW ... I had not used that feature for a while ...

    << Im getting older&rusty (just crossed the 40 mark). >>

    ... and me the 51 Mark !!!

    Alain
    Last edited by Acetronics2; - 12th March 2008 at 19:56.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  15. #15
    Join Date
    Feb 2005
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi, Peu

    NO, you did not understand ...

    1) You enable BODEN, nothing else required ...

    2) AT program start, you first read the BOR bit

    3) If BOR Bit = 0 THEN (and only IF ) you increase the EEPROM content : That means power is back, and did not reach ZERO !!! ( no Pb to write , then ...)

    4) If BOR Bit = 1 power has gone to ZERO ( and BOR bit has been reset ) ... just read the EEPROM content .

    5) you SET BOR bit

    6) you run your "lighting" program ...

    Think simple !!!

    Alain
    I still have a doubt: when does the BOD bit goes from the initialization value ZERO (table 9-6) to ONE (No Brown-out Detect occurred) in a cold start scenario?

    At cold start the circuit should read the stored eeprom value not write a new one


  16. #16
    Join Date
    Feb 2005
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    Im reading different PIC datasheets so shed some light about the BOD sequence, but most of them share the same wording, Im really lost.

    I made a little proggie to test what I've learned in this thread, but it does not work, maybe Im missing something stupid, but after many hours of trying, maybe what I need is a good rest:

    Code:
    @ device pic12f683,INTRC_OSC_NOCLKOUT , wdt_on, mclr_off, protect_off, bod_on
    
    CMCON0 = %00000111     ' Disable comparator
    VRCON  = %00000000     ' disable
    
    
    '       I/Os
    TRISIO = %00000000      ' no inputs      
    
    ' definitions
               
    BODD var PCON.0
    
    gpio=%00000100            'I know program cold started
    pause 1000                'gpio.2 green led pin5 indicates coldstart
    gpio=%00000000   
    
    loop:
    
    if BODD=0 then           
        gpio=%00000010        'GPIO.1 red led PIN6 shows a BOD state
        pause 1000
        gpio=%00000000
        BODD=1
    endif
    goto loop
    then the schematic is pretty simple, a ceramic capacitor at the power lines for storing some battery, a couple of leds at the specified pins and a momentary switch that allows me to cut VDD for a moment.

    It does not vork

    [edit] Maybe I need to check for POR=1 and BOD=0 to know for sure that a BOD reset happened

    Help!
    Last edited by peu; - 13th March 2008 at 01:11.

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


    Did you find this post helpful? Yes | No

    Thumbs down

    gpio=%00000010 'GPIO.1 red led PIN6 shows a BOD state
    pause 1000


    Here is the best reason ( may be others ... I must check ) for your gadget not to work ...

    THE DEVICE MUST DRAW AS LITTLE CURRENT AS POSSIBLE !!!

    Your led leads VCC voltage to ZERO ... so ... POR and not BOR !!!

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

  18. #18
    Join Date
    Feb 2005
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    Rest helped clear my mind

    I will test this code as soon I arrive at my office:

    Code:
    @ device pic12f683,INTRC_OSC_NOCLKOUT , wdt_on, mclr_off, protect_off, bod_on
    
    CMCON0 = %00000111     ' Disable comparator
    VRCON  = %00000000     ' disable
    
    
    '       I/Os
    TRISIO = %00000000      ' no inputs      
    
    ' definitions
     
    ' init values
    
    if PCON.0=0 then
      gpio=%00000100            'Brown-out detected turn on LED on PIN5
    else
      gpio=%00000010            'Brown-out NOT detected turn on LED on PIN6
    endif
    
    'main loop
    
    loop:
    goto loop
    I can't imagine simpler code to test the BOD function. Do you see something wrong?

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


    Did you find this post helpful? Yes | No

    Lightbulb

    Hi,

    Was not so easy ... but finally got it !!!

    all the trick is in the bits setting and testing scheduling ... Always keep in mind the processor will re-start from the beginning.

    Have fun ... the ( let's be modest ! ... A ) working listing waits for your first try ...

    Other trick : May be you'll have to test greater values capacitors ...

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

  20. #20
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi,
    Was not so easy ... but finally got it !!!
    all the trick is in the bits setting and testing scheduling ... Always keep in mind the processor will re-start from the beginning.
    Have fun ... the ( let's be modest ! ... A ) working listing waits for your first try ...
    Other trick : May be you'll have to test greater values capacitors ...
    Alain
    You know...I was thinking...
    In this type of project, there's nothing that says the PIC has to turn itself completely off right away.
    Why can't it stay running for, say 10 seconds, after the LED is powered off.
    So, the process looks like this:

    Initial power on with an initial mode...
    LED lit, PIC waiting...
    button pressed, LED off, PIC still waiting...
    If one second passes without a button press, the PIC shuts itself off.
    If a button press happen inside of one second, the mode changes and the 1 second timer is reset.
    Requires a bit more thought with the single button power on/off circuit, but that's easy...

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


    Did you find this post helpful? Yes | No

    Talking

    Hi, Ski

    My tries show the processor runs in a Low Power mode ...

    Your solution is easy with the ADC (or a comparator ! ) instead of the BOR ... But the goal was NOT TO USE an adc.

    I know ... a '675 doesn't cost so much more than a '629.


    Just consider it was another forum " for the fun contest" !!!

    Alain
    Last edited by Acetronics2; - 13th March 2008 at 14:03.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  22. #22


    Did you find this post helpful? Yes | No

    Default

    One thing to remember. The diode D1 is isolating the PIC supply from the LED. So the PIC should be able to stay in a brown out mode for a small amount of time. But your test circuit may have a problem if the indicator LED is directly connected to a PIC I/O pin. The LED may then drain the PIC power too fast and the PIC will go into POR quicker. The AMC7135 parts in the original design isolate the PIC pin enough so that it can still run off the cap charge. You need a higher impedance connection, on your test board, to the PIC to keep this from happening. Maybe you can put a buffer (like a HC04) between the indicator LED and the PIC pin and power the buffer straight off the supply.

    Also in your code, when you check the BOD, you also need to check the POR. This is because you will have one of two situations:

    BOD cleared but POR still set - Switch click
    BOD cleared and POR cleared - powered down

    Your code also needs to set both bits after they are checked, otherwise they will never be '1'. The hardware only clears the bits when a situation happens. It is the program's responsibility to set these bits.
    Last edited by falingtrea; - 13th March 2008 at 14:50.
    Tim Barr

  23. #23
    Join Date
    Feb 2005
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    You know...I was thinking...
    In this type of project, there's nothing that says the PIC has to turn itself completely off right away.
    Why can't it stay running for, say 10 seconds, after the LED is powered off.
    So, the process looks like this:

    Initial power on with an initial mode...
    LED lit, PIC waiting...
    button pressed, LED off, PIC still waiting...
    If one second passes without a button press, the PIC shuts itself off.
    If a button press happen inside of one second, the mode changes and the 1 second timer is reset.
    Requires a bit more thought with the single button power on/off circuit, but that's easy...
    This is the circuit Im using:


    With this code:
    Code:
    @ device pic12f683,INTRC_OSC_NOCLKOUT , wdt_on, mclr_off, protect_off, bod_on
    
    CMCON0 = %00000111     ' Disable comparator
    VRCON  = %00000000     ' disable
    
    
    '       I/Os
    TRISIO = %00000000      ' no inputs      
    
    ' definitions
     
    ' init values
    
    if PCON.0=0 then
      gpio=%00000100        'Brown-out detected turn on LED on PIN5 (red)
    else
      gpio=%00000010        'Brown-out NOT detected turn on LED on PIN6 (green)
    endif
    
    'main loop
    
    loop:
    pcon.0=1
    goto loop
    It does not work, the minute I give it power green lits and after 5 seconds¿?¿? it goes off and red lits.

    Am I missing something?

    I can use a 12F675 or even a 12F683 if a simpler / more efficient solution is possible.

    Regarding flashlight operation, think of a flashlight without buttons, it goes on or off by twisting the body, and the battery electrical path to the LED/uC is done using the metal body. So this means when power is gone, is gone for everything. To be even more clear, here is a CAD drawing of my latest creation:


    The green you see there is the uC/driver PCB that also serves as positive contact for the battery. Ground is attached inside the flashlight head.

    To check more flashlights check: www.neoca.com.ar Thanks!

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


    Did you find this post helpful? Yes | No

    Default

    Hi, Peu

    You're out ...

    Code:
    '@ device pic12f683,INTRC_OSC_NOCLKOUT , wdt_on, mclr_off, protect_off, bod_on
    
     @    __config _INTRC_OSC_NOCLKOUT & _PWRTE_ON & _WDT_ON &_BOD_ON & _MCLRE_OFF & _CP_OFF
     
     
    OSCCON = %01100110
    CMCON0 = %00000111     ' Disable comparator
    VRCON  = %00000000     ' disable
    ADCON0 = %11100000
    ANSEL  = %10000000
    
    '       I/Os
    gpio   = %00000000
    TRISIO = %00000000      ' no inputs 
    
    BOD var GPIO.0
    POR var GPIO.1
    
       
    IF PCON.1 = 0 and PCON.0 = 0 THEN BOD = 1	'BROWN OUT RESET BIT
    IF PCON.1 = 0 				 THEN POR = 1	'POWER ON RESET BIT
    
    PAUSE 1000
    
    GPIO = 0
    
    if PCON.1 = 1 AND PCON.0 = 0 then		'PCON.0 = BOD ;PCON.1 = POR
              
        GPIO.2 = 1         'GPIO.1 red led PIN6 shows a BOD state
        PAUSE 5000
        PCON.0 = 1
        gpio = %00000000
        
    endif
    
    PCON.1 = 1
    PCON.0 = 1
    
    While 1
    Wend
    
    END
    This works really fine, but with a 10 µ (MICRO) F ...and a 12F683

    so , some current draw improvements are still to add ...

    NOTE: All Outputs are Mosfet Buffered ( BS 170 ) ...

    Alain

    PS: You didn't use your brain too much, here ....
    Last edited by Acetronics2; - 13th March 2008 at 19:52.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  25. #25


    Did you find this post helpful? Yes | No

    Default

    Change your test circuit as follows:

    Put a diode between the cap and the battery disconnect point like the sample schematic at the beginning of this thread has. This will isolate the PIC power from the rest of the circuit so that the cap will power the PIC when the battery is disconnected.

    Connect the LED cathodes to the I/O pins. Then connect the LED anodes to the battery disconnect point between the battery and the diode that was added above. By doing this, the LEDs won't draw power once the battery is disconnected.
    Tim Barr

  26. #26
    Join Date
    Feb 2005
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by peu View Post
    [edit] Maybe I need to check for POR=1 and BOD=0 to know for sure that a BOD reset happened
    I wasn't that far with this late edit

    Quote Originally Posted by Acetronics View Post
    This works really fine, but with a 10 µ (MICRO) F ...and a 12F683

    so , some current draw improvements are still to add ...

    NOTE: All Outputs are Mosfet Buffered ( BS 170 ) ...

    Alain

    PS: You didn't use your brain too much, here ....
    What brain?

    Well I implemented your program and it worked, but the cap value was way too high, so I started lowering till I found a ridiculously low value...

    Then I examined your code, removed some chunks and commented it:

    Code:
    @ device pic12f683,INTRC_OSC_NOCLKOUT , wdt_on, mclr_off, protect_off, bod_on
    
    ' I use picbasic to compile!!
    
     '@    __config _INTRC_OSC_NOCLKOUT & _PWRTE_ON & _WDT_ON &_BOD_ON & _MCLRE_OFF & _CP_OFF
     
     
    OSCCON = %01100110
    CMCON0 = %00000111     ' Disable comparator
    VRCON  = %00000000     ' disable
    ADCON0 = %11100000
    ANSEL  = %10000000
    
    '       I/Os
    gpio   = %00000000
    TRISIO = %00000000      ' no inputs 
    
    ' SECTION? what is this section used for?
    ' BOD var GPIO.0
    ' POR var GPIO.1
    
       
    ' IF PCON.1 = 0 and PCON.0 = 0 THEN BOD = 1	'BROWN OUT RESET BIT
    ' IF PCON.1 = 0 THEN POR = 1	'POWER ON RESET BIT
    
    ' PAUSE 1000  this pause cannot be used in a flashlight environment
    '  SECTION?  what is this section used for?
    
    GPIO = 0
    
    if PCON.1 = 1 AND PCON.0 = 0 then		'PCON.0 = BOD ;PCON.1 = POR
              
        GPIO.2 = 1          'GPIO.2 green led PIN6 shows a BOD state
        PAUSE 1000          'I don't have patience :-)
        'PCON.0 = 1         ' not needed since you set this again below
        gpio = %00000000
        
    endif
    
    'PCON.1 = 1      replaced with one line :-)
    'PCON.0 = 1
    PCON=%00000011
    
    GPIO.1 = 1 'normal state red led
    While 1
    Wend
    
    END
    and if a picture is a 1000 words, we could say that a video is like 1000 pictures, so 1000x1000=1000000 words... WOW... I just wrote a book take a look at this video: http://www.veoh.com/videos/v6415763hQHpjMDy

    As you see, the cap is reaaally small, the green led shows BOD condition, and red led is normal operation. The diode you see there is not used. Also I left all the unused pins floating

    When I used large value capacitors, everytime I did a power interruption no matter if it was 1 second or 10 the BOD led turned on.

    I wonder why you had to use 10uF

    Also assembled a proto PCB using the 1st schematic to start testing a real world application.
    Last edited by peu; - 14th March 2008 at 00:15.

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


    Did you find this post helpful? Yes | No

    Talking

    Quote Originally Posted by peu View Post
    I wasn't that far with this late edit

    What brain?


    .
    " Whose brain ??? " could have been good level humour ...

    Well I implemented your program and it worked, but the cap value was way too high, so I started lowering till I found a ridiculously low value...

    Then I examined your code, removed some chunks and commented it:


    << ' I use picbasic to compile!! >>

    Me too !!! ... did you notice a little difference between MPLAB and Microcode studio ???


    << I wonder why you had to use 10uF >>

    I don't know ... gives me a ~ .3 s power interrupt delay ... and it won't be my headache !!!
    The Pic itself draws .77 mA ...

    Regards
    Alain
    Last edited by Acetronics2; - 14th March 2008 at 15:28.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  28. #28
    Join Date
    Feb 2005
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    Alain, I just sent you a Private Message.

    [edit] Sorry for the missunderstanding, and thanks for your reply
    Last edited by peu; - 14th March 2008 at 13:45.

Similar Threads

  1. Thermo 7 segments - little problem
    By fratello in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 27th July 2013, 07:31
  2. RS485 bus - starting probem
    By wurm in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th January 2010, 13:35
  3. 32 bit square root
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 6th May 2009, 03:37
  4. one line led light make image
    By bioul in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th February 2008, 12:19
  5. HSERIN doesn´t work
    By wurm in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th July 2007, 14:23

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