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?