Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New persistent storage of time since launch count pauses when batteries are out, then resumes when back in. Omits RTC backup capacitor. #42

Merged
merged 17 commits into from
Jul 27, 2024

Conversation

bigjosh
Copy link
Owner

@bigjosh bigjosh commented Jul 21, 2024

Lots of other clean up and improvements as well.

bigjosh added 17 commits July 10, 2024 13:39
Still need to update firmware to continuously track elapsed time as per #29.
I am skeptical this is needed, but it is cheap and low risk so we will add it just to be safe. Must make sure to turn off VBAT in the firmware as per #35.
Call out that C1 is actually a resistor even though it starts with C.
Saves a word of program memory and and cycle of run time.
Count power usage:

Prev firmware with backup enabled and cap on PCB | 2.0uA
New firmware with cap on PCB (should not happen) | 2.0uA
New firmware with 10K resistor in place C2 | 2.0uA

...and the failure case where old firmware gets on new PCB | 120uA

So we need to make sure that old firmware does not get on new PCBs. It should get caught during commissioning because the power will not be able to ride the time between programming and battery insertion.
… counters

1. Delete all the old code that read and parsed the RTC time. We now never look at the actual RTC time data - we only copy it on launch just to have a record. We also do not bother to check if the RTC when undervoltage because we don't care.

2. Cleaned up the sharing between C and ASM routines.

3. Made the TSL tick ISR be the default ISR so we can use the FRAM ISR tables while running in TSL mode.

4. Added the frame work fo the persistant counters and made the C code use them (although they are not yet updated by the ASM ISR).

5. Took out the centiday message, will need to add back into next_day() later.

6. Cleaned up the whole startup sequencing and made it so that a power loss during ready-to-launch mode is now an error (Batt Err 1) since we definitely want to know if this happens and not just seamlessly pick up where we left off.

7. Finally suppressed the "unused variable" warnings on the unused LCD chars.

8. Changed the name of the info memory segment of the FRAM from InfoA to Persistant.
… rather than RTC backup

Closes #29 , #30 , & #35.

Overall current draw is still less than 2uA.

Currently we unlock/lock the info FRAM where we keep the counters each time we update them, which is once per minute. This uses slightly more power than just leaving them unlocked, unknow if there is any safety benefit.

Lightly tested and seems to work, but big changes so needs way more testing.
... we lose power in the middle of an update that updates the day.
Now to switch to the RV3032 so we can test the CLKOUT trace for shorts also.
Looks like we get about 1/2 a second between 3.3V and 1.8V for a good unit with all the LCD segments on. Might need to tweak the "pass" values for current drawn during the power down test.
Still low enough to last a century. We'll have to see what the variance among units it.
@bigjosh bigjosh merged commit e900bf5 into main Jul 27, 2024
@bigjosh
Copy link
Owner Author

bigjosh commented Jul 27, 2024

Implements the new "pausable" behavior whereby the unit simply stops counting when there is no power (typically because batteries were removed) and then starts counting again where it left off when power is restored. Previously, we had a backup capacitor that would let the RTC continue running (only) for a few minutes to allow time for a battery change. This closes #29

As part of this change...

  1. We removed that backup capacitor and replaced it with a resistor. The capacitor was a source of a couple of field failures, so this is a win.
  2. Added code to measure the power drain during factory initialization, and reject units that fall out of bounds. This will prevent the rare unit that has manufacturing defect that causes a subtle short somewhere from getting into users' hands and using up the battery prematurely. Closes Test for high current draw during commissioning  #39
  3. Change the copyright notice cadence from 100 days to 128 days. This will eliminate awkward baby milestone photos. Closes Move copyright notice to a binary rather than decimal cadence #30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant