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: > 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 >> Resend, tag added, sorry. >> >> =20 >> Dear Piccers, >> >> I developped a small battery operated device, using a 16F684, everything >> 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 roo= m >> left on the PCB to add any components and I also have no PIC pins left f= or >> any batt voltage detection. >> Now the 684 has an brown out reset, which is pricipally doing what I wan= t, >> but I see no possibility to distict between a "cold boot reset" (made wh= en >> 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 until= new >> batteries are inserted. >> >> Does anybody have an idea, know of any sort of "hidden features", any so= rt >> of dirty tricks to make this? >> >> Thanks for any help. >> >> Peter >> =20 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .