ZB64EC-bus Z80 Bank 0 ROM-RAM Switch Bd.

PCB Circuit (click to enlarge) Circuits and Info

Eagle CAD: 1. Memory and

Bank 0 ROM-RAM Switch Logic



Eagle CAD: 2. EC Board Connector


Eagle CAD: 3. Possible PCB Layout



Bill of Materials

BOM: Bank0 ROM/RAM Switch Bd.

System Overview

The basic ZB64EC Z80 system is modular and is composed of 4 boards:

 - an extendable 6-slot backplane

 - a CPU/ROM/RAM board

 - a Bank0 ROM-RAM switch board: permits the unused memory in the lower 16KB part of ROM to be used as RAM

 - a UART board for terminal communcation: USB/FTDI, RS232/Bluetooth, and RS232 D-sub


Additional boards can be added to the system, including a bus extension board. See the ZB64EC-bus Z80 MBC menu for the current list.


System Features

1) Essential system functions have been distributed over 3 boards. The boards are 4" wide x 3" high (102 x 76mm). This makes for easier troubleshooting as well as learning how the system and bus communication works.

2) 12 user bus lines, USER_A to USER_L, have been added for customization. These are in addition to the BANK_0 to BANK_3 and IO_0 to IO_3 bus lines created by Peter Murray of 39k.ca for his M62-bus based Z80 single board computer. Each USER_x bus line can be terminated high (10K) or low (4.7K) or not at all.

3) Each bus line is available at each slot via jumpers. It is possible to use a single bus line across the backplane many times for different functions.

4) The second adjacent screenshot lists the User lines for Slot 1 and Slot 2 of the system. An example of carrying a signal from slot to slot would be the RESET signal of USER_F1. This is not the Z80_RESET signal used by the Z80 CPU; this is a separate positive-going signal used by the UART's MR on pin 39 of the UART Comm board that will most likely occupy Slot 3. The USER_F1 signal will need to be jumpered to USER_F2 and then to USER_F3 in slot 3.


The Bank0 ROM RAM switch board explained

With many existing ROM monitors or BIOSs, only a portion of the ROM is used which essentially results in memory waste. Peter Murray engineered the idea of making use of the unused memory.

If the Z80 64KB memory is carved up into four 16KB banks, the first 16KB (BANK_0) is typically used for ROM. The next 16KB (BANK_1) is used for RAM, as could be the remaining two 16KB banks (BANK_2, BANK_3). (However as you will see with the Memory Expansion Board, RAM MEB, we'll set aside the 16KB BANK_2 to be used as a window into many, many 16KB banks of RAM. The same could also be done with a ROM MEB. More on that later.)

If we copy the small ROM Monitor/ROM BIOS of BANK_0 into the RAM of BANK_1, then switch BANK_0 to be used as RAM, we have recycled a "lot" of RAM that would otherwise go untapped.


How is the bank switching done?

If you examine the adjacent screenshot, Eagle CAD: 1. Memory and Bank 0 ROM-RAM Switch Logic, in the right-middle you'll see that Base Address IO_0 (I/O addresses $00 to $3F) and I/O address $00 (default) will set Bank 0 to be ROM if a 0 is written to data bus signal, D0. If however, if you write value $01 instead of value $00 to address $00, the system will enable the RAM_A14 line (carried from the Bank 0 switch board to the CPU board via bus lines USER_E1 and USER_E2 jumpered with JP1 and JP2 on the backplane). That means the lower 16KB of this 128KB chip will be used as RAM BANK_0 and so will the next 16KB as RAM BANK_1. (The remaining RAM has its address lines above A15 tied to ground so they aren't used.)  The lower right portion of the Bank 0 Switch board schematic also shows two LEDs that have been added to reflect ROM (red) or RAM (green) operation of BANK 0.


ROM/RAM Bank Switch Programming

In the adjacent schematic the circuit is used to switch out the ROM so it can be used for local RAM. Peter Murray has modified his M62 Operating System such that once Bank_0 ROM has been replaced by RAM in the local RAM (the SRAM chip is 128KB so there's lots of room), it copies the BIOS and vectors to the upper portion of the RAM. Now the entire 16KB (except $0000-$0100 for boot vectors) originally occupied by the ROM in Bank_0 is available as RAM in Bank_0.

By issuing an "OUT 00, 01" instruction in your programs or via the ROM Monitor menu, the RAM is expanded from $0000-$3FFF (BANK 0) to $0000-$7FFF (BANK 0 and BANK 1). This is because the BANK 0 address range which normally points to the ROM that was used to boot the Z80 now points to the first 16KB of RAM. The ROM is no longer addressed so it effectively does not exist. BANK 0 is now RAM with address range $0000-$3FFF. Now RAM exists in both BANK 1 and BANK 0.  Sending instruction "OUT 00, 00" resets the configuration so BANK 0 is ROM ($0000-$3FFF) once again and BANK 1 is RAM ($4000-$7FFF). This configuration is also the default bootup configuration. Note that with the ROM excluded, you'll need to modify the boot vectors between $0000 and $0100 ($00, $38, $66, etc.) to RAM, otherwise the system will crash if an interrupt or NMI is issued because the ROM is "gone". More on that later when we talk about the M62 Operating System. Suffice it to know for now that you do not have to switch out the ROM for RAM; the Memory Expansion Board (MEB) has plenty to go around.


I see the schematics. Where is the Bill of Materials parts list?

The BOM is at the bottom of the adjacent panel.


Note: M62 Bus is copyrighted by Peter Murray of Murray Electronics, http://www.39k.ca