Olin Lathrop escreveu: > David Duffy (AVD) wrote: > = >> The main reason the EE was used was to persist the unit's status if it >> was power cycled, >> = > > How about keep the live value in RAM and write it to EEPROM only on power > down? It only takes a few milliseconds to write to the EEPROM. You need= to > detect input power going away, and have a large enough cap on Vdd to keep= it > running for the few ms it takes to detect the power gone signal and save = the > live values in EEPROM. > > As a quick example of the cap value, let's say it needs to provide 10mA f= or > 10mS with no more than 1V droop. > > 10mA 10mS > --------- =3D 100uF > 1V > > You probably have that much on your power supply already. > = I use this method a lot, it works extremely well. Just connect an interrupt pin (with proper circuitry of course) to a point before the voltage regulator or the like, this way you will get a much early interrupt. Don't forget that the device usually wok with voltages much lower than the ones they are usually powered (some PICs are powered with 5V but work down to 3V or less), this may help. For dsPICs I use the internal brown-out interrupt so I don't need any external circuitry, but smaller PICs have only brown-out reset and won't work without external aid, unless you use the voltage comparator (for the ones that have it). Best regards, Isaac __________________________________________________ Fa=E7a liga=E7=F5es para outros computadores com o novo Yahoo! Messenger = http://br.beta.messenger.yahoo.com/ = -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist