¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: NVRAM with Z80MC

 

Kerem,
?
Makes no difference if the CPU is Cmos or Nmos as the bigger
difference is overall power consumed, usually it is only part of
the systems power needs.
?
The z80MC only senses power good where it de-asserts /Reset on
power on after delay.? It has no power fail or DC good sensing.
?
NMI is available but what action it causes is define in eprom
and likely not directly usable.? ?Asserting NMI causes a handler
to do effectively nothing as Bigboot has no specific use for it.
?
Start with the Z80 user manual (mostec or zilog) to understand
how the chip works.? All of this is close to the iron work so
understanding the CPU and how its used in the hardware
environment becomes the task.? The Z80MC and Basic manuals?
cannot even attempt to cover this or could if it were larger
than 200 pages.
?
The reason nothing was found for saving the CPU state or
restoring it as its assembly programming 101.? That and
likely the question asked would mislead most search engines
(AI or not).? It is not something that is unusual or rarely done.
Most Debugger software has it wired in.? Its also sometimes
called a Context Save or interrupt programming.
?
Generally the Z80 MC is many levels above those early days
of Altair where limited ram, no rom, dumb front panel,
no IO,?no software was the then context for users.? To do
anything you hand coded assembler and hand entered
a byte at a time.? Doing computers ca1975.
?
?
?
Allison


Re: NVRAM with Z80MC

 

Rich,
?
That can work IF the fail rate is slow enough from initial 5V to trigger
level to assure enough work (save state).? Very iffy and depends on
precision in the supervisory device.? Also those NV-rams have their
own power fail so writing to them could be locked out.? ?The
general assumption with most supervisory chips is assuring
power good before releasing reset.? ?Less so for power fail (unsafe).
?
The big boys (DEC, DG, IBM, and others) did it by first detecting
when?main power fails (AC power) or has decayed below acceptable
limits.? That is used to provide POWER-FAIL or some similar named?
control voltage.? The also provide a set of signal to say DC-GOOD.
That is then used to trigger high priority interrupt, or in the case
of Z80 NMI (non maskable interrupt).
?
This is all assembly language work.
?
I've built systems that do the latter as most (many) supervisory
circuits have boundary cases that may fail.? Harder than it looks.
as then the power supply must have enough "hold" time before
it completely fails to regulate.? The system I still have uses the
raw DC side that is typically 6-8 volts higher than DC out (5V bus).
That gives early warning of potential power fail and? assert
NMI.? ?That was an analog supply with some larger caps to
store enough for 80-100 milliseconds of known good
regulated output.? Typically a NMI routine that preserves
state is under a few milliseconds then it self halts before
power fail.
?
Start up is a Debug monitor system with option of
restore-resume in an orderly way or do a cold start.
?
An alternate way is to have the CPU turn itself off.
Simple push button to NMI makes the system? go to
a quiescent state (stop the machine or finish disk write)
then store its state and under program control
VIA IO port (relay or electronics switch) turn off
the power.
?
The latter is used for many cases as power fail is a?
random event that may have impacts (in robotics?
you need all stop, in an orderly way!) where power
off can be a user command (or event) with
orderly shut down.
?
Startup can be restore and run or cold start depending
on system and potentially establishing? external states
for external hardware or mechanics before resuming
operation but that is a system level consideration like
a machine tool or robotics application.
?
Its a system level application or use situation programming
with hardware to support it.
?
?
Allison
?


Re: NVRAM with Z80MC

 

To add to this a bit, assume that the loss of power is unpredictable. The Z80 needs to know when a power loss occurs in order to be able to ¡°save state¡± (i.e. the registers, etc.). The z80 has a non-maskable interrupt that could be triggered by the power loss through another circuit. The NMI vector would point to the save state code. But then, how long do you have to save the state??

You¡¯d need to figure out how long it takes for the power to drop to a point where the chips stop operating (let¡¯s say that¡¯s 4.8v), but that timing depends on power consumption and supply voltage.? Then you can calculate how many instructions can execute in that time period, and hopefully that¡¯s enough to save the CPU and hardware state. At 4mhz, the instructions take anywhere between 1us and about 6us. So, its ¡°just math¡± so to speak.?

On power-up, you¡¯d check a flag to see if the state was successfully saved and either re-load it or start fresh.?

NVRAM supervisory chips can sense the power fail and trigger the interrupt. I have?not tried this, but that¡¯s the theory on how it could work but as Allison said, it¡¯s both a software and hardware solution.?

Rich



On Thu, Apr 10, 2025 at 17:09 ajparent1/kb1gmx via <kb1gmx=[email protected]> wrote:
Its done in programming.? I do not mean in BASIC.
?
Preserving the CPU state means writing all of the registers, internal? flags,
and interrupt status, to protected ram.? Fairly easy but the on startup
(aka reset) the first code in rom has to restore all that and then continue
where the CPU was stopped on power down.? That also means the state
of hardware like serial IO.? So power down is not something to be
allowed to happen randomly and power must be maintained for some
amount of time to permit the needed programming to complete.
?
However all this interacts with the design of hardware so if power down?
happens at a random point then saving all that before the power is
collapsed completely is problematic.
?
This takes a fair amount of understanding how Z80 works and how
the circuitry around? it has to work to support it.? Generally the z80MC is
not going to make all that easy for you.
?
So the best you can hope for is that ram only holds the program and?
basic will allow you to access it on startup (many can do that).? In that
case your treating memory during power down as a rom.
?
Also you unclear on what you wish to accomplish and the question
is not clear.? ? It also suggests working with hardware ie: ram, Eprom,
and IO chips is new and unfamiliar.? My early (1970s) experience was
opposite of that I had to build hardware, understand how that
works and then write code in assembler as little to none was
available (no Basic!).? ?That lead to the need to understand the
interaction of code and hardware.? ?Programming? on the bare metal.
People? brought up with PCs rarely, if ever, do that.
?
I hope this helps to answer your question. Or ask more questions.
?
Allison


Re: NVRAM with Z80MC

 
Edited

Its done in programming.? I do not mean in BASIC.
?
Preserving the CPU state means writing all of the registers, internal? flags,
and interrupt status, to protected ram.? Fairly easy but the on startup
(aka reset) the first code in rom has to restore all that and then continue
where the CPU was stopped on power down.? That also means the state
of hardware like serial IO.? So power down is not something to be
allowed to happen randomly and power must be maintained for some
amount of time to permit the needed programming to complete.
?
However all this interacts with the design of hardware so if power down?
happens at a random point then saving all that before the power is
collapsed completely is problematic.
?
This takes a fair amount of understanding how Z80 works and how
the circuitry around? it has to work to support it.? Generally the z80MC is
not going to make all that easy for you.? It would add features not
planned for or typically expected.? that and the built in code in rom
would have to change.
?
So the best you can hope for is that ram only holds the program and?
basic will allow you to access it on startup (many can do that).? In that
case your treating memory during power down as a rom.
?
Also you unclear on what you wish to accomplish and the question
is not clear.? ? It also suggests working with hardware ie: ram, Eprom,
and IO chips is new and unfamiliar.? My early (1970s) experience was
opposite of that I had to build hardware, understand how that
works and then write code in assembler as little to none was
available (no Basic!).? ?That lead to the need to understand the
interaction of code and hardware.? ?Programming? on the bare metal.
People? brought up with PCs rarely, if ever, do that.
?
I hope this helps to answer your question. Or ask more questions.
?
Allison


Re: NVRAM with Z80MC

 

Hi Allison,
I have been researching how to preserve the CPU state before power down and restore on Z80 while using NVRAM without any luck.

How would that be done on the Z80 membership card? If I understand correctly, if it is a CMOS Z80 vs NMOS Z80, it is done automatically. I am not sure if the Z80 on my MC is CMOS or NMOS.

Perhaps that section of the Z80MC user manual can be expanded to include set up and use cases with NVRAM. If I can figure this out, I don¡¯t mind providing the first draft notes.

Thank you,
Kerem

On Thu, Apr 10, 2025 at 11:02?AM ajparent1/kb1gmx via <kb1gmx=[email protected]> wrote:
Oh, when using NV-ram in Z80 systems one needs to preserve the
CPU state before power down.? And restore that state on power up.
?
Easier way is an all CMOS Z80 system, then battery to run CPU and
all is manageable.
?
?
Allison
?


Re: Testing the piezo speaker

 

Piezo speaker is somewhat inaccurate as its actually a resonator.
Being much louder at its resonant frequency.
?
They are best when well supported by their edges with airspace
under and over.
?
?
?
Allison
?


Re: NVRAM with Z80MC

 

Oh, when using NV-ram in Z80 systems one needs to preserve the
CPU state before power down.? And restore that state on power up.
?
Easier way is an all CMOS Z80 system, then battery to run CPU and
all is manageable.
?
?
Allison
?


Re: NVRAM with Z80MC

 
Edited

On Wed, Apr 9, 2025 at 04:07 PM, Kerem Kapkin wrote:
ST M48Z35
That's a 32K byte part. similar to 62256 as used on CPU card.
The SIO board comes with 64K byte part.
?
They can be used if pinout matches as "battery backed" Ram
which is what they are.
?
I have used them for other systems, be wary as the battery in
it does fail with time.? Experience is? 4-8 years.
?
-Can it be used besides Micro-Basic?
?
Yes, it runs CP/M and there are at least 15 different basics including
at least two Basic compilers ( I use M$-Bascom and matching
interpreter).? ? Also using CP/M it can easily run other available
languages, and a raft of other software.
?
?
Allison


NVRAM with Z80MC

 

Hello,
Anyone using NVRAM instead of RAM in Z80MC as described Z80MC Operating Manual page 4?
-Does this NVRAM replaces the RAM on Z80MC or SIO card?
-Can it be used besides Micro-Basic?
-Default recommendation is ST M48Z35. Are there other alternatives?
Thank you- Kerem


Re: Strange behavior of #8 button

 

After a few days, it seems like adding the 22k resistor between pins 1-2 of R4A did the trick. Haven't had any more issues with the #8 button.
Some things to note:
R4 is a 15k sip. That's what was in the kit. So with the 22k in parallel, that makes 8.9k ohms.
The transistors Q2, Q3 are FNJ3305 and Q5 is FNJ4303. This matches the schematic.


Re: Z80 MC testing

 

I don't know,? I will need some time to set up and test here.



On Friday, April 4, 2025 at 12:09:14 a.m. EDT, Kerem Kapkin via groups.io <kkapkin@...> wrote:


When I use the instructions on page 24, Examine Input Port, Press 5 12, read in12 78, instead I am getting blinking FF. Is this normal? Does this indicate in have an HW problem?


Re: Testing the piezo speaker

 

It can be activated through software, but I don't recall if the firmware made that available.?



On Monday, April 7, 2025 at 12:56:52 p.m. EDT, Mitch Smith via groups.io <kb3gkc@...> wrote:


Yes, it actually beeps on each key press. I just couldn't hear it.

Is there anything else I can do with it?

Mitch






Re: Testing the piezo speaker

 

Thanks Kerem, I¡¯ll give that a try.?

Paul
On Apr 7, 2025 at 8:10?PM -0400, Kerem Kapkin via groups.io <kkapkin@...>, wrote:
?

It is louder if the Piezo speaker is not in contact with the chips below, and suspended in the air with the ground wires.
<IMG_8573.jpeg>

On Mon, Apr 7, 2025 at 4:27?PM PRL via <prlaba=[email protected]> wrote:
?
I have the same problem.? If I put my ear to it I can hear a faint beep.? Checked all the wiring and connections, everything looks right.

Paul
On Apr 7, 2025 at 12:56?PM -0400, Mitch Smith via <kb3gkc=[email protected]>, wrote:
?
Yes, it actually beeps on each key press. I just couldn't hear it.

Is there anything else I can do with it?

Mitch





?
?
?


Re: Testing the piezo speaker

 

It is louder if the Piezo speaker is not in contact with the chips below, and suspended in the air with the ground wires.

On Mon, Apr 7, 2025 at 4:27?PM PRL via <prlaba=[email protected]> wrote:
I have the same problem.? If I put my ear to it I can hear a faint beep.? Checked all the wiring and connections, everything looks right.

Paul
On Apr 7, 2025 at 12:56?PM -0400, Mitch Smith via <kb3gkc=[email protected]>, wrote:
Yes, it actually beeps on each key press. I just couldn't hear it.

Is there anything else I can do with it?

Mitch






Re: Testing the piezo speaker

 

I have the same problem. ?If I put my ear to it I can hear a faint beep. ?Checked all the wiring and connections, everything looks right.

Paul
On Apr 7, 2025 at 12:56?PM -0400, Mitch Smith via groups.io <kb3gkc@...>, wrote:

Yes, it actually beeps on each key press. I just couldn't hear it.

Is there anything else I can do with it?

Mitch






Re: Testing the piezo speaker

 

Yes, it actually beeps on each key press. I just couldn't hear it.

Is there anything else I can do with it?

Mitch


Re: Testing the piezo speaker

 

Each key press creates a beep as well as turns on the led. If you don¡¯t hear a beep, I would check to see if the opto coupler is installed?correctly.

On Sun, Apr 6, 2025 at 12:30?PM Mitch Smith via <kb3gkc=[email protected]> wrote:
I finally added the piezo speaker to the Z80MC. It only took me 2 years!
What I'd like to know is how is the speaker accessed?
I half expected there to be a beep or something when the system booted up but I didn't hear anything.
Is there a way I can test the speaker?
Short assembly or basic program maybe?
I looked in the monitor code but I couldn't find anything other than the "beep" LED.
Thanks for the help.

Mitch






Testing the piezo speaker

 

I finally added the piezo speaker to the Z80MC. It only took me 2 years!
What I'd like to know is how is the speaker accessed?
I half expected there to be a beep or something when the system booted up but I didn't hear anything.
Is there a way I can test the speaker?
Short assembly or basic program maybe?
I looked in the monitor code but I couldn't find anything other than the "beep" LED.
Thanks for the help.

Mitch


Re: Strange behavior of #8 button

 

I just did the same thing. Added a 22k resistor to R4 pins 1-2.
Since my problem was intermittent, I'm hoping this resolves the issue.

Mitch


Re: Z80 MC testing

 

Removed the SIO card, now I am getting in12 78
Is it possible that the SIO card interfering with input port 12? SIO card is a new one, assembled with great caution and seem to be working fine, except this test case. I will have to replace all the ICs on the first one to recover, hopefully.

On Thu, Apr 3, 2025 at 9:09?PM Kerem Kapkin via <kkapkin=[email protected]> wrote:
When I use the instructions on page 24, Examine Input Port, Press 5 12, read in12 78, instead I am getting blinking FF. Is this normal? Does this indicate in have an HW problem?