brown out resets


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    Join Date
    Aug 2009
    Posts
    63


    Did you find this post helpful? Yes | No

    Default

    im gonna look into the battery idea actually, but flaws with it could be that over 20 years a rechargeable battery will have effectively "lost its ability to recharge" and also there will be points where the wind is dead for longer than the battery can keep the pic and lcd running...

    are there any commands to just turn off the pic and then get it back going when the voltage is high enough? cos surely if the pic is turned off... how can it be turned back on again? since the software is obvioulsy not running because the pic is off :S

  2. #2
    Join Date
    Aug 2009
    Posts
    63


    Did you find this post helpful? Yes | No

    Default

    actually does the power on reset turn the pic back on after i have turned it off? if i put the mclr pin to Vdd, it will detect a rise in voltage? and cause a reset?

    if i turned the pic off at a certain voltage... and then when the pic detects a rise in voltage the power on reset occurs and turns my pic back on and restarts the program?

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by robertpeach View Post
    im gonna look into the battery idea actually, but flaws with it could be that over 20 years a rechargeable battery will have effectively "lost its ability to recharge" and also there will be points where the wind is dead for longer than the battery can keep the pic and lcd running...
    Pros and cons no matter what. I have one of the "smart thermostats" at the house. It runs on two AA batteries that need changed once a year or so. Might have to be a bit of upkeep for the end user???? I know, not good.
    are there any commands to just turn off the pic and then get it back going when the voltage is high enough? cos surely if the pic is turned off... how can it be turned back on again? since the software is obvioulsy not running because the pic is off :S
    There is the sleep command but that just puts the PIC in low power mode.

    I have a feeling that the best way to go will be an external comparator working a latching relay or FET on the 12 volt line. Rig it so when the voltage drops below X the relay stays off untill the voltage comes back up to Z. Give a little range between the two points.

    Then the interrupt thing should work. If the PIC shuts down only from lack of power it will restart.

    Just thinking.... Or is it babbling
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Aug 2009
    Posts
    63


    Did you find this post helpful? Yes | No

    Default

    no ive been thinking and the ways that you describe are the only two ways i can think of doing it... the battery thing would work nicely i just dont think a customer would be too happy having to change batteries much...

    im gonna try out ur second example with the comparator! thanks for your help once again mack! ill let u know how it goes

  5. #5
    Join Date
    Aug 2009
    Posts
    63


    Did you find this post helpful? Yes | No

    Default

    update:

    well basically dave i looked into the whole idea... and basically it just seemed all a bit much for one thing. ive decided on the simplest option, even if it is a bit time consuming and not as efficient for the pic. im just gonna save the data to eeprom every 0.25 kwh instead of only saving when pic powers down... this will require a bit more pic power and wont be as accurate since it could be 0.24kwh through when the pic dies... and that 0.24 kwh is not actually added on... this could happen quite alot if the wind is low and the turbine keeps starting and stopping...(although it wont matter that much since the energy out at those stages is pretty negligible anyway) but will be cheaper and easier probably! less things to go wrong in my case

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    One more thought....
    To keep from missing that last bit of good data you could have the code do a last write when the power, speed or what ever drops to a certain point. Anything below that point and you do not write data. Once the machine is running above a certain point it goes back to writing every 0.25kwh. That way the starts and stops will not bother.
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Aug 2009
    Posts
    63


    Did you find this post helpful? Yes | No

    Default

    thanks mack thats actually a good idea, ive already got the code for when the low voltage detection, so ill just implement that in. would i bother resetting the interupt flag once an interupt for low voltage detection is made? because that would cause an endless loop of the interupt if the wind turbine was at a speed low enough for low voltage detection but not low enough for a reset...

    additionally ive come across another problem which is actually just me being stupid...

    if ive got a power output which is being updated on my pic at a high frequency (power output is found from comparing the revolutions of the wind turbine per minute). how would i get a total energy accumulation value?

    since the power will be changing over time... it means the rate that my total energy accumulation is increasing will change also... would i find the average poweer over lets say 10 seconds and then multiply that by 10 to get the total energy accumulated over 10 seconds?

    additionally since ive only got picbasic pro and not pbpl it means i cant use LONG. this means i can only get up to 65536, whereeas the number of kwh is gonna be about 200,000 over the 20 years... any ideas on this one? if im gonna be wanting to use a decimal e.g 655.25 kwh then thats gonna mean im gonna get a max of 655 kwh...

    its goonna be about 10,000 kwh a year... over 20 years thats 200,000... so if i write to eeprom every 0.25kwh then thats 800,000 writes... and a pic can only take a million erases?

  8. #8
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I would try something like.
    If rpm is less than X then disable the INTCON.

    Calculating power from the RPMs. Setup a timer to read the rpm evert so many seconds, after maybe a 100 reads average the RPMs giving aveage power over that time span??? If the wind is not changing much it should be pretty accurate.

    Of you have PBP then you have LONGS. Using MCS? Tell it to compile using PBPL. That can be found under one of the options in the tool bar. MPLAB? When you set the language it should b there.

    Yup, the EEPROM has some limits. I have been using a SD card for data logging.
    Add a RTC if you do not have one in the project and you have plenty of room on a SD to save the time, RPM, power and what ever else. When you want to just pop it into a PC and chart, display or what ever. Easy way to get data from PIC to PC.

    Yup, more babbling
    Last edited by mackrackit; - 24th September 2009 at 13:08. Reason: If you have PBP 2.5 or greater you have LONGs.
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. 16f877a porta.5 resets chip
    By lecoind in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 1st October 2009, 18:29
  2. Device Resets / erratic operation - 16F88
    By turbokinetic in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 11th April 2009, 03:08
  3. servo motor resets 16f877a
    By burak450 in forum mel PIC BASIC Pro
    Replies: 85
    Last Post: - 19th October 2008, 22:25
  4. PIC resets every now and then
    By passion1 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 12th June 2007, 21:41
  5. Freqout resets port pins?
    By MikeLewis in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 16th July 2004, 04:29

Members who have read this thread : 0

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