| Posted: 08:04am 03 Jul 2019 |
Copy link to clipboard |
 Print this post |
|
cheers isochronic. I think it must be a failing cell (not a rechargeable), but what a borderline situation.
Here is the bit of code that handles the RTC initialization so you can understand the output after it:
Print "Configuring CPU & RTC for MkII" CPU 48 'cpu to maximum speed 'take the RTC out of store mode RTC GetReg &h0E,n Print "Register &H0E ";bin$(n,8) RTC SetReg &h0E,n And &b00111111
'test the validity of the time RTC GetReg &h0F,n Print "Register &H0F ";bin$(n,8) If n And &b10000000 Then Print "NOTE: Internal RTC Oscillator has been stopped during power down." RTC SetReg &h0F,0 EndIf
Here is the last time I powered it up (having had no problem all day with dark periods of about an hour or so apiece...
Micromite MKII MMBasic Ver 5.04.08 Copyright 2011-2017 Geoff Graham
0.481 System coming up. Platform is Micromite MkII Configuring CPU & RTC for MkII Register &H0E 00000110 Register &H0F 00000000 Configuring working environment Starting Main process 02-07-2019 16:40:40 Start Current Target ---------------------------------------------------- <snip>
and then after a night with no power ... 07:28 power re-applied.
Micromite MKII MMBasic Ver 5.04.08 Copyright 2011-2017 Geoff Graham
0.481 System coming up. Platform is Micromite MkII Configuring CPU & RTC for MkII Register &H0E 00000110 Register &H0F 10000000 NOTE: Internal RTC Oscillator has been stopped during power down. Configuring working environment Starting Main process 03-07-2019 07:18:29 Start Current Target ---------------------------------------------------- <snip>
It is showing Reg 0F,bit 7 set thus reporting a stopped oscillator and I only caught it by 10 minutes(!?) doesn't sound very likely - I am not that lucky but it was definitely 07:28 when it got Vcc and the last time is reported as 07:18. This alone makes me think it might be more insidious than just the coin cell, but it is an easy change to try before anything else. It also exhibits the symptoms of a failed cell now - having been on Vbat all night (so the cell has had a kicking), if I drop power for just a few minutes and then reconnect I get the same thing... so it looks like the cell recovers with prolonged Vcc (no load on Vbat) but 5 minutes not enough.
Never seen anything like this before but then never had a failed cell before (really). Nothing in the datasheet says that the registers go static when the cell drops out in power-down - I really would have expected all zeroes. Can the relief of a few nA used by the oscillator really be enough to preserve the registers? The evidence suggests so.
On the upside, it does provide a mechanism for a "time untrustworthy" test and at what point that happened. Could be useful.
UPDATE: Definitely looking like a failed cell... parasitic Vcc from the console port was holding power on the circuit enough to keep the RTC alive (but nothing else). I reckon the diode clamp on the serial Rx must have been leaking power from the idle PC Tx pin held in a marking state. If I unplug the USB<->serial dongle and then remove Vcc , I can get it to complain every time. Need to get into the habit of carrying a DMM with me everywhere... maybe there is a use for these piddly little scopes for a tenner from China? would go in my travel bag no probs and could be better than nothing. Edited by CaptainBoing 2019-07-04 |