It would be a bit more expensive, and take slightly more space than a big capacitor and resistor, but have you considered a real time clock chip?
...
Unfortunately there's not enough space (IC and battery?), money, or power when the PIC is off. I have never used an RTC before. Those are nice. Thanks for the heads up.
The capacitor discharge method will not work because when power is restored to the PIC it will reset and change the port values altering the reading on the capacitor before your user code can begin.
Unless there is something I'm missing... on power up, the ports are high-z until changed. That's 1uA worst case leakage. When power is off, this pin is practically a direct short to ground thanks to the I/O pin's clamp diodes.
So there's a compromise (assuming capacitance is fixed to a low value) between RC time constant and voltage drop across the resistor due to input leakage. Basically we struck a balance with 500k and a 10uF (Fig1). Although it didn't give the performance they were looking for, I think it's something they can live with.
Fig1:
http://www.digikey.com/schemeit/#eo8<iframe width='500' height='300' frameborder='0' scrolling='no' src='
http://www.digikey.com/schemeit/embed/#eo8'></iframe>
Do you have eeprom space to work with?
Power on, after 2 seconds, set an EEPROM bit to 1, then 5 seconds later, set it to zero.
On power up, if the bit is 1, you know it was short cycled (powered up 2 to 7 seconds the last time), so do a sync, and clear the bit.
PIC EEPROMs are rated for about 1M write cycles, so as long as it's power cycled less than 1/hour, there shouldn't be a concern.
edit: changed logic to provide a range of time
We not only need to know if the unit was recently turned off, but also if it was off for longer than a few seconds. So we need some way to know if the system was without power for X seconds.
If they need more than Fig1 provides, my only other attempt is Fig2.
FIG2:
http://www.digikey.com/schemeit/#eo7<iframe width='500' height='300' frameborder='0' scrolling='no' src='
http://www.digikey.com/schemeit/embed/#eo7'></iframe>
Essentially the Darlington is biased on while power is applied thanks to the diode's leakage current. With power off, the Darlington is off and the only current flowing out of the capacitor (through the base/collector junction) is limited to the diode leakage current. I don't see an issue with it yet. I'll SPICE it at work Monday.
I know the leakage current and Darlington's gain varies wildly with temperature, but so far the numbers aren't looking too bad. Worst case gain and leakage at -45°C still would charge the cap in a reasonable amount of time. Worst case leakage from something like a BAT54C @3V and 100°C would discharge the cap significantly slower than what we have now.... I think...