I got THIS far...

A project log for Vintage Z80 palmtop compy hackery

It even has a keyboard!

esot.ericesot.eric 07/21/2021 at 03:173 Comments

Hm... no rotate?

OK, so look at how perfectly a backup battery fits in there, leaving accessible almost every pin I plan to probe! Amazing!

I noticed something very strange about the backup battery implementation... I dunno how much steam I have to describe it except to say that it's wired-up with a common Positive, rather than ground. And it required hooking up the battery and measuring voltages to figure out. The key factor is that when the main batteries are removed, there is no voltage source for the rest of the components (Z80, ROM, Display)... so, the voltage across /their/ V+ and /their/ ground is 0V. Since their V+ is wired directly to the backup battery's V+, that means every pin on every non-powered device is at roughly +Vbatt with respect to the /SRAM's/ ground. Thus, /CE1 on the SRAM is pulled high through the Z80's being off, but connected to the +Vbatt rail. 

This goes against all my instincts. If /any/ current is drawn through those pins (ALL of the bus pins, mind you, at roughly Vbatt) then, it seems to me, the whole shebang collapses.... because now that current puts a voltage drop across V+ and those pins,... and, at the very least, causes the output voltage to vary... and that can be seen already. According to the RAM datasheet, /CE1 must be at or above VCC-0.2V to go into standby... VCC is around 2.7V, /CE1 around 2.4V... we're already out of range. And, that extra 0.3V? Isn't it powering the other devices in a really bad brownout /through/ the outputs?

K, then there's the other factor... when I first measured the voltage between the backup battery's ground and the system ground, I got a /higher/ voltage than the battery is outputting. 0.2V higher. Weird. I reproduced it for a few attempts, but as I began to trace it down, it didn't add up. Then things started getting even weirder, the voltages on the RAM's inputs, especially /CE1, (from the unpowered z80) started getting even further from the VCC-0.2V minimum! All the way down to 2.2V before rising back up to 2.3, and I never did see 2.4 again (nor ever saw the 2.5 minimum).

Turns out if i touch the system ground, with my finger touching one meter probe, and touch the other with the other finger to the RAM's ground, the /teeny/ current flowing through my body was enough to affect the voltage the z80 is sitting at... and... actually put some voltage across it. Hah!

I dunno... i mean, it's not exactly going to run into such conditions when it's sealed up... but something about this all seems strange.

Oh yeah, there's also the bit about how the RAM's ground is always 0.3V higher than the other devices, due to the diode, under normal power, and so therefore can see input voltages /right/ at its Vil-min limit of NEGATIVE 0.3V.


This is not at all what I planned for my day. I was going to solder! Too late now, gotta pack up.

Then I got all sidetracked on how transistors work... couldn't get my mind off it. Nothing related came of it, but I think I may've come up with an interesting "guitar effect"... not that I know anything about those... wherein the positive half of the waveform is undistorted, but the bottom half is... deamplified. Wonder what it'd sound like...

... "Time to pack up..." which sucks, because it's just about right now I actually have the soldering energy.

...Oh yeah... this all came about because I was looking for solder points that would be out of the way and strong enough to support a pin header. Hah! I almost forgot.

Oh Oh! There's a friggin' capacitor to ground on /WE...! WTHeck? My guess: to prevent it from writing randomly when powering-up the z80... but, seriously... what? Mind you, that same trace also goes to the ROM, for writing when they were in development, and used FLASH instead. So, yahknow, nothing like slowing precisely-timed signals... which is also a plausible explanation, being that /OE isn't used, the timing may be a bit funky, so delaying /WE may be useful to assure it stays active after the chip-select is disabled? But there's no series resistor, so... oh, and consider this: Even though it has zero volts across it when powered only by the backup battery, that's /across/ it... wherein, when the actual batteries are installed, it will be 0V with respect to system ground... NOT the Vbatt it was resting at prior. So, actually, immediately after installing regular batteries /WE WILL be active?! What on earth is this thing?!


Next day... soldering ain't happening again again again...

But I couldn't get this stupid /WE capacitor off my mind, so dug out the meter again and verified again (again) that that capacitor indeed goes between /WE and the main system ground.

So, let's just pretend it's not for delaying-purposes... I verified on the Z80 timing diagram and the SRAM's that things should work properly even with /OE tied to ground, since the address is held /after/ /WE is deactivated. So, even if maybe the address-remapping circuitry slows the address's propagation, /WE should be deactivated /before/ the address changes... Right? Oh, I guess there's some possibility the address may not arrive stabley at the bus /before/ /WE, without a slight delay maybe from the capacitor.... hmmm. That'd be a crazy design. Maybe that was an overclocking trick?

Let's assume it's /not/ for delay purposes... that it's instead related to power-up/down.

When the system is only powered by the backup battery (main batteries being swapped-out): /WE should be a "don't care" since both the chip enables are (supposedly) disabled. I measured 0.00V across that cap in that setting. Which means /WE is 0V above system-ground, which is somehow pulled to the backup battery's voltage /through/ the rest of the circuitry's V+ bus. OK.... /WE disabled.

Now, when batteries are inserted... the capacitor should hold 0V across it briefly... but its ground is the system ground which is no longer floating, it's 5-6V /below/ the V+ rail. /WE is briefly pulled active, presuming the z80 doesn't immediately drive it, and even if it does, since it can't /immediately/ change the voltage across the capacitor. But... /CE doesn't have a capacitor (that I've seen)... So, maybe it relies on the idea that /CE will remain high /immediately/ upon power-up...? That... seems... well, maybe. Maybe it's internally pulled-up with a resistor. Could be by-design, since it does seem like the RAM and ROM /ChipSelects are dedicated outputs on the z80-alike. OK... power-applied, /CE prevents /WE from mattering.

Similarly, maybe those "internal pull-ups" are used during "power-down" when the z80 may otherwise put all its other pins Hi-Z to save power... Now, most CMOS-inputs, as I understand, are none too happy "floating". But it may well be that RAM and ROM are designed to handle such, since address and data lines are often floating between transactions... especially devices designed for low power standby modes. So, power-down... maybe /CE's pulled-up and maybe /WE floats, but since there's a capacitor, it won't have much "antenna effect" so will most likely hold some value (doesn't matter which, functionally) rather than oscillate, in which case input-circuitry uses power.  Maybe it toggles a little bit, but nothing like 60Hz. (Or higher, picking up internal noise) OK...

Now, main batteries removed... Presumably it wasn't in the middle of writing something... (You /did/ "2nd-On" first, right?). Then /WE is initially high... the capacitor has ~5V across it, the main power capacitor discharges, the Z80 keeps outputting High on /WE as long as there's enough voltage to run it... But, that high is referenced to the backup battery's V+, so, even if the z80 can still run at, say, 2V, it'd be 2V from the power capacitor, whose ground is 1V above the SRAM's ground... so 3V for the SRAM's /WE input... Now, presumably there's some power-monitoring circuitry that turns off the z80, or at least puts it in reset) at a low enough voltage, presumably allowing its outputs to float. Now as the main power capacitor continues to deplete, the /WE capacitor tries to hold that last voltage... so, now, /WE may actually exceed the backup battery's V+ for a little bit... maybe the z80-alike outputs have protection diodes, so it can't go too much higher... maybe 0.5V. Eventually the main system cap depletes to 0V, putting both its ground and V+ at Vbackup WRT the SRAM's ground. So, again, once the /WE cap discharges to 0V, /WE will be at Vbackup. Fine. But, what about /CE? Oh yeah, we decided it must have a pull-up resistor, which holds it at Vbackup.

This whole thing seems crazy. A pull-up resistor would make a heck of a lot more sense, no?

I'm no power guy, though... what do I know?

Maybe when the z80-alike goes into reset the /WE pin goes low...? If that's the case, then the capacitor would push the main system ground....

Heck, nah... I just don't get it. Too friggin weird, this.

BTW, the TI-85 apparently did it /very/ differently (judging by the schematics someone traced-out)... but, also, quite a bit more within my understanding of such things, using a common ground, a pass/no-pass transistor, and a pull-up resistor.

It could be the 86's method is cleverer and I just don't get it. Maybe it reduces standby current dramatically!


dearuserhron wrote 07/21/2021 at 15:41 point

Another novel is John Varley - Press enter. It is a sci-fi horror too.

The same thing. You can learn and dig deeper into tech, but once you get THIS far, something strange begins to happen.

  Are you sure? yes | no

esot.eric wrote 07/21/2021 at 17:53 point

heh... thankfully those are fiction, eh?

  Are you sure? yes | no

dearuserhron wrote 07/21/2021 at 15:26 point

I do remember a novel by Stanislaw Lem called Przyjaciel. It is a sci-fi horror about stranger who asks a boy from radio-club to help him implementing strange obfuscated circuit.

Read in russian:

It is not translated into English yet. Google translate is terrible but it gives you a clue about this novel.

Read via Google Translate

  Are you sure? yes | no