daveejhitchins wrote: ↑
Tue Nov 24, 2020 6:57 am
KenLowe wrote: ↑
Tue Nov 24, 2020 12:09 am
More generally, does anyone have any comments on what I've done here to get the RTC working? Is that a reasonable solution. It kinda mirrors what's done on the data lines for the Tube & 1MHz level shifters. Is 100R a reasonable value to use in production, or should I drop that a bit?
Reflections . . . e.g. Fast edges being reflected back from a miss matched termination/line impedance. Usually around 33R to 68R is used. Long tracks suffer more from this issue. The addition of the resistor also acts as a low pass filter using the capacitance of the inputs of any ICs it's connected to.
Thanks for providing that detail. That's helpful. My level shifters are using 33R resistors, so I'll likely go with that. Those resistors have definitely made a positive impact, but unfortunately, once the machine has been running for perhaps 30 mins I started running into problems again and the RTC stopped responding. I tried adding a series resistor into the AS and DS lines, but that didn't make any difference. So now I've wired each of the AS and DS lines through two series inverters (I'm actually using NAND gates to get the invert function) and it's been running fine now for about 30 mins. It's still too early to tell if it's really made a difference, but fingers crossed
It does appear that the timing is a bit marginal and once the machine warms up there's enough of a shift in the CPU clock timings to throw out the RTC. I'll try and capture this through some scope / logic analyser traces at the weekend. My guess is that these gates are delaying the strobe pulses enough to pull everything back in spec. Is there a way to do this on the CPLD instead? The fitter output slew rate is already set to slow.
Edit 1: So, after about an hour that's the DS12885 misbehaving again
. I don't think it's the DS12885 that's failing, because if I then swap it out for another one, it behaves the same. Leave the computer off for a while and it'll start working again. With everything still warm, I swapped out the CPU, but that didn't make any difference. I then swapped out the DS12885 for the BQ1285 and as before, it works just fine.
Edit 2: Interesting. If I disconnect the battery from RTC pin 16 and tie this input to Gnd, it starts working again. I think I see what might be happening, and it's nothing to do with temperature. The RTC datasheet indicates that the VBat input (pin 20) should not exceed 4v. I've just measured it, and it's currently sitting at 4.2v. I think what's happening is that when I switch off the computer for a period of time, the battery is discharging back down to the nominal 3.6v, VBat input is coming back within tolerance and the RTC starts working. When I switch the computer on, it recharges back up to greater than 4v, and that's when the RTC starts to fail.
The 4.2 volts that I measured seems a bit high for the Varta battery, which should sit at 3.6v. The charging circuit is a very simple resistor / diode arrangement and is a direct copy across from the original IntegraB board. I did previously consider using a non rechargeable battery for the RTC & backup RAM. Given what I've just discovered, I'll now need to rethink that.
Right now, I've connected the RTC VBat input to Gnd, and I'm powering the RTC directly from the battery instead. The datasheet says that Vcc should greater than 4v, so I'll see if the RTC has retained anything tomorrow morning once the battery has discharged back down to 3.6v. I know that's not a long term solution! I've also removed the additional inverters on the AS and DS lines, as they didn't seem to be doing much. I'll also remove the series resistors tomorrow and test again with those removed and VBat tied to Gnd.
Edit 3: Overnight, the battery voltage has dropped to 3.9v, which is just under the 4v threshold for the RTC Vcc, but it's still holding it's config and the oscillator is still running. The RTC is still responding, so I'm hopeful I've now found the culprit. I'm going to disable the charging circuit on the IntegraB board so I can reconnect the standard 5v to RTC pin 24 (Vcc) and the battery 3.6v feed to pin 20 (VBat), and test again with that configuration.