bigjosh / TSL

CW&T Time Since Launch
https://cwandt.com/products/time-since-launch
Other
15 stars 6 forks source link

Skipped counts from rubbing #51

Closed bigjosh closed 5 years ago

bigjosh commented 5 years ago

DESCRIPTION: The seconds counter (or Ready to Launch pattern) can skip a count when you rub the glass.

IMPACT: While not catastrophic, this sucks because it skips are jarring to the user and would accumulate to make the Time Since Launch be fast in between battery changes unless we periodically correct it (which would cost power).

CURRENT BEST THEORY: I think this is due to the fact that the signal from the RTC to the XMEGA that drives the 1Hz update tick (called FOUT) is (intentionally) very low power so it does not take much to glitch it, and apparently the static fields from rubbing the glass are enough. This is not completely unexpected.

MITIAGTION STRATEGY: You would typically add a hardware RC filter or increase the drive on that signal, but these are both costly in terms of power.

I think I have a way to mitigate this while only increasing power a few percent by effectively adding a software low pass filter to the incoming FOUT signal on the XMEGA.

bigjosh commented 5 years ago

Switched interrupt on FOUT to be on both edges and interlocked on both phases in ec39e9944f04327199e54861b12ef638854d7997