开云体育

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

Re: Using Z80MC SIO RAM BANKS

 
Edited

To be clear CP/M once running only used one of the possible 4 ram banks??
I ask as then I don't have to search trough the code to understand if it
does and how.?
?
Reason I ask Is I have a version of a Bios that is banked.? I've developed more
than a few BIOS for different systems most to improve the rather simplistic
support for IO.? That and allow for more disk starting with 5mb in 1980 and
growing from there. ? The result? of a banked BIOSis larger TPA as the BIOS
is less than 2K in high ram but the paged ram contains the rest of the bios
and especially the large buffers used for the allocation vectors.? ?The remaining
two pages (64K total) can be used for RAM disk or foreground/background
programs.? Foreground background is easy to do, periodic interrupt driven
code causes a simple tasker manager to see if a task is pending?and if so
executes it.? Only one task level for simplicity usually print spooler.
Its easily extended to more.? Since its an interrupt driven CP/M doesn't
directly see it as it steels cycles and returns.? If IO such as a circular input
buffer (to support type ahead)? exists and interrupt drive then its the
priority task in the list.
?
Nice system.
?
Most people don't really understand CP/M and really don't realize that?
it is very permissive in what can be done.??
?
?
Allison


Re: Using Z80MC SIO RAM BANKS

 

>>>Josh's CP/M Explorer works on my computer with Win 7. That's the latest version of Windows I have. He wrote it back in 2019. Perhaps Microsoft has broken something in later versions? I think he wrote it in Visual BASIC. Maybe it needs to be re-compiled to work in later version of Windows.<<<
?
NOTE: I'm not a winders user, I use Linux Ubuntu or Mint both derived off the Debian tree.
?
So to run windows code I use Wine (windows emulation) and generally V7 winders
programs are compatible with wine.
?
In this case its more like the code is one big no-op try to run it and linux says
not there, nobody's home.
?
So I'm stumped.
?
Allison


Re: Using Z80MC SIO RAM BANKS

 

Hi Allison,

I just got back home from a trip to VCF-East in New Jersey, and then a week visiting family in Michigan (over 3000 miles of driving -- yech). I'm still catching up on emails while I was gone. Josh Bensadon (who wrote the software for the Z80MC) was also at VCF-East, so I imagine he's busy catching up as well. I see there's been a lot of activity on the Z80MC list. Thanks to Allison for holding sway in our absence!

Josh's CP/M Explorer works on my computer with Win 7. That's the latest version of Windows I have. He wrote it back in 2019. Perhaps Microsoft has broken something in later versions? I think he wrote it in Visual BASIC. Maybe it needs to be re-compiled to work in later version of Windows.

Allison is right about the Z80MC memory map. With just the CPU card, or the CPU + Front Panel card. it has the EPROM at 0-32k, and the RAM at 32-64k. Very simple. Kerem can't load programs at 0-32k unless he writes them into the EPROM (there is still quite a bit of space in it).

With the Z80-SIO card, things get more complicated. The CPU card has series resistors between the address decoder and RAM and ROM chip-selects. These allow other cards (like the Z80-SIO) to alter the memory map. U4 on the Z80-SIO (75HCT151) is the memory decoder. It is controlled by output port C1h bit D0 (BANK).

At power-up, or reset, or if xxxx.xxx0 is written to port C1h, BANK=0. The SIO card has no effect on CPU card RAM or ROM.

If xxxx.xxx1 is written to port C1h, BANK=1. This changes the memory map as follows:

1. Writes with A15=0 (0-32k) write to the SIO card's current RAM bank.
2. Writes with A15=1 (32-64k) write to CPU card's RAM.
3. Reads with A15=0 (0-32k) disable the CPU ROM, and instead read the SIO card's current RAM bank.
4. Reads with A15=1 (32-64k) read CPU card's RAM.

The 128k RAM on the SIO card has 4 banks of 32k each. These are selected by writing to output port FCh (8250 MODEM control register 4). The extra address bits are as follows:

FCh bit 0 = /DTR = B15 \ selects bank in 128k or 512k RAM
FCh bit 1 = /RTS = B16 /
FCh bit 2 = /OUT1 = B17 \ selects bank in 512k RAM
FCh bit 3 = /OUT2 = B18 /
FCh bits 4-7 should be set to 0

Note that the physical pins are *inverted* (so you have to write a "0" to set the address pin high).

What does all this mean? CP/M expects an all-RAM system, with RAM from 0-64k. 0-100h needs to contain restart and interrupt vectors, jumps to the BDOS, input and DMA buffers, and other important constants. The high end of RAM needs to contain the CCP, BDOS, and BIOS. The C/PM "boot" program sets all this up for you. The source is on my website, and Josh did an excellent job of commenting it. User programs usually start at 0100h, so they have full access to all of C/PM's subroutines and features.

I hope this helps. If you find any errors or omissions, please let me know!

Lee
--
Excellence does not require perfection. -- Henry James
But it *does* require attention to detail! -- Lee Hart
--
Lee A. Hart


Re: uSD card content?

 

Hi Paul,
?
In order to prepare a new 2GB uSD card to work with SIO, you need to partition it correctly. I couldn't figure out how to do it from scratch. So I copied the Partition Table from the original uSD (MassStorageDevice(2GB).ptf) and Restored it on a new one using a freeware called DiskGenius. I am attaching the Partition Table. Once you Restore the partition table, either you can save the files from the .zip on Lee's website or use the attached "Restore from partition image files" function (Z80-SIO.pmf).
?
Doing so I have functioning new uSD cards with no problem.
?
Regards,
Kerem


Re: uSD card content?

 

It never worked for me either (Windows).

Paul
On Apr 17, 2025 at 4:56?PM -0400, ajparent1/kb1gmx via groups.io <kb1gmx@...>, wrote:
?

Anyone have a clue on CPM-DI-2.exe? that's disk explorer?
a winders program....?
?
Linux wine and Dosbox find it unexecutable.? I run? a lot
of windows and dos programs but this one appears broken.
I get no error messages or any indication of life.
?
?
Allison
?


Re: uSD card content?

 

Anyone have a clue on CPM-DI-2.exe? that's disk explorer?
a winders program....?
?
Linux wine and Dosbox find it unexecutable.? I run? a lot
of windows and dos programs but this one appears broken.
I get no error messages or any indication of life.
?
?
Allison
?


Re: uSD card content?

 

Disk A though D are fat 16 container files but there content
is a CP/M disk with CP/M formatted directory and applications.
?
That means only a utility on the PC that understands CP/M file
format (disk Explorer) can read the content of the container
file.? It also requires that the BIOS on the Z80MC understand
the FAT16 to find the container and open it for CP/M use.?
Hence the files are named like A.bin.? All reads a write to the
uSD by cp/m are to within the container files.
?
That has two effects convenient from the PC side and
slow from the z80 side.
?
?
Allison


Re: uSD card content?

 

Hi Paul,
According to the Z80MC-2017 manual on page 20,
"On a Cold or Hard Reset, the system will look for, and if found automatically load and execute a
file called “Z80MC_GO.HEX” from the SD Card. The option to get to the regular monitor
menu will be provided for a short time while the system slowly prints dots.
CP/M
The SD Card files come with 4 files called Disk-A.BIN to Disk-D.BIN, a file called
CPMDISKS.TXT and the Z80MC_GO.HEX file needed to load CP/M."
?
Also regarding to the FAT16 format : "The card must be formatted with
FAT-16 and then the files in the root directory can be listed and any Intel Hex formatted file can
be opened and loaded to memory. Sub directories/folders are not supported. Creating or
appending to a FAT-16 file is not supported. Only writing to an existing fixed length file is
possible. "
?
Regards,
Kerem


Re: uSD card content?

 

see Formatting the uSD at thread starting at
?
Yes, it fat16.?
?
Bigboot is in files ?
?
I don't have a list andy for actual content. Use disk explorer tool.
I think its on Lee's site.? Its effectively the standard CP/M distribution files.
?
Allison


uSD card content?

 

HI all,
?
I have mislaid the uSD card for my Z80MC board.?
?
Do I just download Z80MC Bigfoot.zip from the files section and save it on a uSD card? I recall something about FAT16?
?
Help!
?
Paul?


Re: Using Z80MC SIO RAM BANKS

 
Edited

>>Is it possible to run a program from Z80 SIO RAM? <<
?
The answer is yes.? But not the way you want to do it.
?
The keyboard and display is part of the issue and the other part
is that the rom that runs that is in that space.? The two are linked
and while ram is accessible your simple code depends on the rom
and the display to be available or it would not be visible.
?
That code?
8000? ? ? 3C? ? ? ? ? ? ? ? ? ?inc ? A
8001? ? ? C2 00 80 ? ? ?Jp ? ?NZ,8000? ? ?; jump to 8000 if A ne 0
8004? ? ? ?03? ? ? ? ? ? ? ? ? ?inc ? BC? ? ? ? ? ? ? ; Inc BC
8005? ? ? ?C3 00 80 ? ? ?JMP ? 8000? ? ? ? ; go to 8000
?
takes about 142 seconds to execute the double loop?
(roughly 570 million clock cycles).? the AC will overflow
to zero every 640us (approximately).
?
The problem is if you are seeing BC increment that means
you have the monitors interrupt stopping it to show the
state on the display and its capturing the register and
placing on the display.? So that simple code is running
several hundred bytes of the rom to do what you see.
?
?
Allison


Re: Using Z80MC SIO RAM BANKS

 

It means if you are using the monitor to load at 0000, you can't, rom is there.
also 0000 is the start address for the eprom so it will bark at you.
?
The rom has to be there to run and communicate with the buttons.? Its
why I suggested reading the V15 code to understand what the rom
does and the memory map it expects.
?
If you wanted to run code at 0000 for some reason then you need to
put a (new) monitor in high ram then enable the low ram bank. The
code in High ram allows you to talk to the machine rather than crash it.
?
The design is such that from 8000h and up is always ram.
?
FYI CP/M enables low ram and loads itself in high ram.? Once you get the
startup message you have 64K of ram with CP/M eating about 8k of the
high end of the ram.? It reserves 0-100H as system page and from 100 to?
end of the TPA as program space.? ?The TPS is Transient Program space
and something like 56K.? Asm, DDT, Stat, PIP, and a few other are tools
in the uSD.? That's my normal development environment.
?
?
Allison


Re: Using Z80MC SIO RAM BANKS

 

Thank you Allison for your explanation and patience.
I turn on the CPU Card+SIO+FP combination, wait for loading from SD with message FL 0030
Then F+E soft reset to stop PC from moving, I think it is executing CP/M
Click on "9" to set RAM bank to 0 "RAM 0"
Set PC to 0000
Set BC to 0000
Enter program (example from the manual) into 0000 (3C C2 00 80 03 C3 00 80)
Verify PC and BC are 0000
Then press 4 "go" to execute the program from RAM address 0000 SIO Bank 0
It crashes with HARD 01
Same steps when entered into 8000 works fine, I can see BC is counting up.
What am I doing wrong? Does this mean I cannot run a program from SIO RAM Bank?
Thank you,
Kerem


Re: Using Z80MC SIO RAM BANKS

 

Also read and understand ZMCv15 which is about the erom contect monitor and Basic.
?
How register are used is in there and also the memory mapping bits.? AS Z80 code
its loaded with good examples.? Its not trivial code!
?
That means reading Z80 code and understanding it.? ?Lee did a decent job of
organizing and commenting the code.? ITs in a Zip file in the files area.?
?
/g/Z80MC/files/AllisonKB1GMX/ZMCv15.zip
?
?
Allison


Re: Using Z80MC SIO RAM BANKS

 

Depends from CP/M, yes.
From basic in Eprom, no.
?
Keep in mind when you do ram banking your changing the active memory map
and stuff may disappear or end up in the wrong place.
?
The memory map is not at all explained.
?
Base machine (no SIO) rom is lower 32K and ram U2 is always upper 32K.?
At reset EProm U3 is the lower 32K.
?
Add SIO with standard AS6c1008 128k byte ram...
That ram exists as one of 4 banks of? in the lower 32K or as 32K eprom.
How they are selected is the Bank register U5, memory decoder U4,
and bits from the output of the 8250 register.
?
Picture included of what the memory map can be logically.
?
Allison


Using Z80MC SIO RAM BANKS

 

Hello,
Is it possible to run a program from Z80 SIO RAM??
With SIO installed and RAM Bank 0 selected, I can type a short program starting #8000 (CPU RAM) then point PC to #8000 and execute with no problem.
When I type the same program in #0000 (SOI RAM Bank 0), point PC to #0000, execution crashes the system. Either I get a blank no responsive front panel or HARD 01 message.
Is this the normal behavior or indicates a hardware problem?
Thank you,
Kerem


Re: NVRAM with Z80MC

 
Edited

Lee,
?
Even with NMOS 8250 and the few TTL pieces the total power is quite small
and a battery plus 5V SMP regulator will produce very long run times before
battery goes too low.
?
Haven't measured it (as all up stack) as yet but I'd expect with parts as are
supplied under 140mA at 5V which is easy to deal with for battery unless
extended operating life is needed.
?
When compared to the Z80 S100 crate with 64K ram dual serial and
FDC and two FD55GF drives (5V at 6A, 12V 1.5A ,and -12 at .20ma) the
Z80MC is power frugal.? ?FYI that was a built in 1980 system and?
no CMOS.? The other S100 crate, very full, has a 8V 25A supply for
the 5V regulator input bus and a somewhat noisy fan to cool the
boards.? ?So something like the Z80MC is way lower power needs.
?
I have lower power Z80 CMOS systems that are built to be very
low power. its needs are clock speed dependant.? About 10ma
at 4mhz and under 3ma at 1mhz.??
?
?
Allison


Re: NVRAM with Z80MC

 

I've been travelling (to VCF-East) and so have missed the start of this thread. But in general...

?

The Z80MC CPU board can be run all by itself. It's all CMOS, and draws so little current that I can run it on just the power from my RS-232 adapter. It has diodes from the two PC handshake lines and serial output to a filter capacitor. When my modem program sets the handshake lines high, it delivers 10-15mA, which is more than enough to power the 5v regulator and board.

?

You can use a NV RAM, but they generally write-protect themselves before the Z80 and related circuitry crashes from falling power. Thus whatever your program was doing when the power fails will crash.

?

As Allison noted, you can use NMI to warn the Z80 to save its state. You'd need a little circuitry to detect when the input to the 5v regulator is getting low, and pull the NMI pin low. Write an NMI interrupt handler to save the state in your NV RAM. It could be an old 60 Hz transformer-rectifier power supply that normally delivers about 8-10vdc. When it falls below about 6vdc, it pulls the NMI pin low.

?

The Front Panel uses the most power when the LEDs are active. If the Z80 stops handling interrupts, it times out and blanks the display; so standby power is pretty low.

?

When I can find them, I provide 16C450's for the SIO card. It's CMOS, and so draws a lot less power than the 8250. (The 16C550 won't work.) If you have an SD-card, the NMI handler could save the state on the SD-card.

?

Since total power consumption is pretty low, the simplest scheme might be to simply power everything from a modest size battery.

?

Lee

?

--

Excellence does not require perfection. -- Henry James

But it *does* require attention to detail! -- Lee Hart

--

Lee A. Hart


Re: NVRAM with Z80MC

 

Since most of the boards and parts are CMOS running the whole thing off a
battery and switch mode regulator (for power conversion efficiency) would
be easiest.
?
For mine that means replacing the 8250 with 16C450 and the ttl parts with CMOS.
Everything else save for leds and display are CMOS.?
?
The FP (display) and SIO (8250 and TTL) boards are the highest power consumers.
?
I've built a few all comos systems (both z80 and 80C85 based) and I can get the
power under 30ma @ 5V without effort with the system running CP/M and
application.? I use those for monitoring things (data logger) where run time on
battery needs to be greater than a full week (24x7).
?
?
Allison


Re: NVRAM with Z80MC

 

Thanks Allison and Rich for your?responses and guidance.

I have more learning to do until I can figure out how to replace the RAM with NVRAM on the CPU board, if ever practical.

In the meantime, I explored available NVRAM options for direct pinout replacement of the SIO card RAM but nothing seems to work which potentially could resolve the power up and down issues by having the NVRAM in banks of the SIO card instead of CPU card RAM.
Regards,
Kerem



On Fri, Apr 11, 2025 at 12:25?PM ajparent1/kb1gmx via <kb1gmx=arrl.net@groups.io> wrote:
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