I can't say whether it will work or not, it would have to be tried. =20 But, the idea is that in the startup code, you look to see if the reason=20 for the last reset was a brownout, or some other reason. If it was a=20 brownout, you know the battery is low. This assumes that the battery=20 has recovered enough to run the PIC. It seems likely enough, since all=20 outputs will be off after a brownout reset. If you have seen a=20 brownout, turn off brownout protection so you can continue to run, and=20 indicate that the battery is running low. Kerry Andre Abelian wrote: > Kerry, > > Brownout reset is directly connected to reset hardware and once it is ena= bled it will reset the pic. > > it is hard wire. the only thing you can do in software is disable/ enable= .. The voltage is set in configuration bits. > you can't sense and not allow to reset the pic like use it for battery in= dicator etc. "not going to work". > 16f684 is low end pic not much you can do with it. > > PCON.0 is status register you will know this bit is changed after resetin= g the pic > because of if this got set/clear it will reset the cheap. > > Andre Abelian > > > > > ________________________________ > From: Kerry Wentworth > To: Microcontroller discussion list - Public. > Sent: Monday, October 10, 2011 8:53 AM > Subject: Re: [PIC:] Distinction between RESET and BOWNOUT > > In software, you can only detect whether a brownout reset has occurred=20 > (PCON.0=3D0 if brownout reset occurred). The threshold is set by=20 > programming the word at 2008h, which is only accessible to the PIC=20 > programmer. It does not describe how the threshold varies with the=20 > value in 2008h, so some experimenting may be in order. > > Kerry > > > Andre Abelian wrote: > =20 >> Kerry, >> >> How do you read brownout setting in software? >> >> AA >> >> >> ________________________________ >> From: Kerry Wentworth >> To: Microcontroller discussion list - Public. >> Sent: Monday, October 10, 2011 6:27 AM >> Subject: Re: [PIC:] Distinction between RESET and BOWNOUT >> >> Looking at the data sheet, I see some interesting features. >> >> Brownout can be enabled/disabled in software >> >> The brownout threshold can be adjusted during programming >> >> Brownout reset can be detected >> >> So theoretically, you could bump up the brownout threshold to a value=20 >> that would allow the PIC to continue operating for a while. If a=20 >> brownout is detected, leave brownout disabled and signal "low battery",= =20 >> otherwise enable brownout and operate normally. No hardware changes=20 >> needed to implement this. >> >> Kerry >> >> >> >> IB Peter Feucht wrote: >> =20 >> =20 >>> =20 >>> Resend, tag added, sorry. >>> >>> =20 >>> Dear Piccers, >>> >>> I developped a small battery operated device, using a 16F684, everythin= g >>> works fine. Now the customer shows up, and wants to have any sort of >>> batt-low indication. For already 1000 PCS are made and assembled, there= ist >>> no chance to make any hardware modifications. Even more, there is no ro= om >>> left on the PCB to add any components and I also have no PIC pins left = for >>> any batt voltage detection. >>> Now the 684 has an brown out reset, which is pricipally doing what I wa= nt, >>> but I see no possibility to distict between a "cold boot reset" (made w= hen >>> e.g. batteries are changed) and brown out reset. >>> In case of a cold boot reset the devide should work normally, but when = a >>> brownout occured, I'd like to simply disable any further operation unti= l new >>> batteries are inserted. >>> >>> Does anybody have an idea, know of any sort of "hidden features", any s= ort >>> of dirty tricks to make this? >>> >>> Thanks for any help. >>> >>> Peter >>> =20 >>> =20 > > =20 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .