hey again guys, ive managed to create my program eventually.. the pic is basically the controller of the rectifier controller of a wind turbine... :P everything works nice and smooth and how id like it to.

however there is one last thing i want to implement. im trying to display total kilowatt hours on the LCD, however obviously when the wind dies then the pic has no power and therefore turns off... but when the wind revives the pic restarts due to the brown out reset.

however when the brown out resets occurs i will have lost all temporary data in the ram. i was wondering if there was a way to use some form of brown out interupt to quickly save the data of "total energy accumulated" before the voltage goes so low that the pic turns off. and then when the reset occurs the energy accumulated is then taken from flash and carried on counting the energy?

or if there is another way of doing this effectively

thanks :P