LZ: Re: Re: Batteries


[Prev][Next][Index][Thread]

LZ: Re: Re: Batteries



On Thu. 5 Jun 1997, Michael Wyman wrote:
> On Thu, 5 Jun 1997, Erik Huizing wrote:
> 
> >  I don't know how correct this is, but here's my reasoning: The lithium
> > battery _does_ work. When the calc is turned off, you can pull all 4 AAAs
> > out, leave em out (I've done this overnight cause I needed to recharge my
> > AAAs) and put em back in later. As long as the calc remains off, the
> > lithium battery keeps your memory intact. I think something happens that
> > switches power useage over to the lithium when you turn the calc off. (Any
> > one tried pulling the batteries after a powerdown from within ZShell?) But
> > if the calc is on and you pull the batteries, you distrupt the circuit and
> > the calc doesn't have a chance to switch power sources.
> > If anyone can confirm this, let me know.
> 
> I have also had occasion to remove all four AAA batteries from my calc at 
> one time, and leave it that way for a while... The lithium does work at 
> that time.
> 
> As for turning the calc off from CShell and removing the batteries, Keith 
> has worked it out to have the calc turn off with the _EXACT_ same routine 
> the calc uses... I know that for sure, because we actually let the TI-ROM 
> turn the calc off... This should then allow for the same kind of 
> treatment of the batteries that you get if you turn the calc off in the 
> TI-OS and pull the batteries...
> 
  I know this was a couple weeks ago but I am new to this list and wanted to 
catch up on what was going on by reading the archives and I came across this.
  I just got done reading a book about the Z80 hardware and software, so I 
think I know what is happening (but I haven't opened up my 85 yet to verify 
this).  All referances to the interupts are correct though.  I'm just not 
positive about anything relating to the 85, but I pretty sure.
  The ROM's powerdown subroutine (like PowerDown) has a instruction in it, 
which is HALT, that when the processor reads it the Z80 stops executing code 
and pauses until an interupt occurs, (there are 2 kinds of interupts on the 
Z80, maskable:the INT(active low or 0) pin on the chip; and non-maskable:the 
NMI(active low or 0) on the chip.  INT has 3 modes, 0,1,2.  0 needs external 
hardware to plasce a RST xx instruction on the data bus to jumps to 1 of 8 
addresses:$00- 00, 08, 10, 18, 20, 28, 30, or 38 where a small int routine is 
or a jump intruction to a larger one; 1 jumps to $0038 where a small int 
routine is or a jump to a larger one; and 2 uses the I register for the high 
byte of the interupt routine and the data bus for the low byte(this is why 
there is the need for a 256 byte vector table since it is not known what will 
be on the data bus) where a address word is that points to an interupt routine.  
An maskable interupt can be ignored or "masked" or turned off by the Z80 with a 
DI(disable interupts).  Use EI(enable interupts) to turn them back on and then 
the Z80 can acknowledge them.  Non-maskable interupts cannot be turned off and 
are always acknowledge( like the timer interupts).  When a NMI occurs the Z80 
jumps to $0066 and starts reading the interupt there.)(now back to the original 
discusion) which the Z80 starts to read the and execute the next instruction 
after the HALT instruction.  When it does execute the HALT instruction it 
enables the HALT(an active low or 0 pin) which engages circuitry that switches 
the RAM's power supply (with a capacitor to ensure no drops in power and data 
loss, no doubt) from the 4 AAA's to the 1616 or 1620 backup battery.
  This is why the data isn't lossed when the AAA's are taken out when the calc 
is off, and the backup battery engages, and why the mem is reset when the calc 
is on the AAA's are taken out and the backup battery doesn't engage.
  I hope all of you understand this (it ended up being a lot more complicated 
than I originaly planed on but I think it was necessary to grasp the concept of 
interupts) and if you have any questions email me at mjb25@hotmail.com.  I hope 
this answers the question for once and forall about the backup battery.

Matt Butch