RetroBrew Computers Forum
Discussion forum for the RetroBrew Computers community.

Home » RBC Forums » General Discussion » Z1RCC, a RC2014-compatible, RomWBW-capable 2"x4" Z180 SBC
Z1RCC, a RC2014-compatible, RomWBW-capable 2"x4" Z180 SBC [message #10454] Tue, 17 October 2023 06:21 Go to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
Edit (12/4/23):
Homepage for prototype Z1RCC, https://www.retrobrewcomputers.org/doku.php?id=builderpages: plasmo:z1rcc:prototype:home
Homepage for rev0 PCB Z1RCC, https://www.retrobrewcomputers.org/doku.php?id=builderpages: plasmo:z1rcc:rev0:home
Homepage for rev0 PCB overclock Z1RCC, https://www.retrobrewcomputers.org/doku.php?id=builderpages: plasmo:z1rcc:overclock:home
------------------------------------------------------------ -----------------
I still have a couple 64-pin Z80180 left over from RIZ180 project so I thought I'll do another Z180 design. RIZ180 is a simple design using recycled DIP64 Z80180 and without using programmable logic. DIP64 version of Z180 can only support 512K memory space so it is challenging to have 512K RAM and 512K ROM that RomWBW needed. However, recently Wayne Warthen has created a version of RomWBW that needs no ROM, only 512K RAM. This version of RomWBW produces a 512K image and requires the external hardware/software to load the image into RAM then jumps to 0x0 to start RomWBW. Notably, the top 32K of the 512K image is the common area that RomWBW actively use while running, but it does not need to be initialized for RomWBW. So the RomWBW image is effectively 480K with the top 32K of 512K RAM available for temporary utility software like RomWBW loader that'll be overwritten once RomWBW has started.

With that operating characteristic in mind, a small bootstrap ROM can reside in programmable logic such as EPM7064S or ATF1504 so that Z180 boots from this bootstrap ROM, copies a loader from CF disk to top 32K of RAM, runs the loader to bring in the 480K RomWBW image from CF disk, then start RomWBW from 0x0. This sounds rather complicated, but RomWBW actually has all the tools to create a CF disk image that contains the 480K RomWBW image, the loader, and the 8 slices of CP/M files. All I need for the party is the small bootstrap ROM resides in the CPLD and the new hardware to do all that, thus Z1RCC.

Z1RCC begins with a blank RIZ180 pc board which has most of the circuitry already wired. It will retain Z80180, oscillator, and CF disk; it will upgrade the 128K RAM to 512K; and it will replace the flash and 2 TTL logic with a EPM7064S which will be glued upside down on the 512K RAM.

It is named Z1RCC because it is a 4-chip SBC based on Z180, RAM, CF disk, and CPLD. Here are features of Z1RCC:



    * 9.22MHz Z80180 DIP64
    * 512K RAM
    * 44-pin IDE interface
    * EPM7064SLC44 CPLD
    * RTC with DS1302
    * I2C bus
    * 18.432 MHz oscillator
    * 2"x4" pc board
    * RomWBW capable
    * Compatible with RC2014 bus
Here is Z1RCC schematic. I'll show a picture of the modified hardware once I have it modified.
Bill
  • Attachment: Z1RCC_scm.pdf
    (Size: 37.75KB, Downloaded 179 times)

[Updated on: Mon, 04 December 2023 06:34]

Report message to a moderator

Re: Z1RCC, a RC2014-compatible, RomWBW-capable 2"x4" Z180 SBC [message #10455 is a reply to message #10454] Tue, 17 October 2023 10:07 Go to previous messageGo to next message
norwestrzh is currently offline  norwestrzh
Messages: 196
Registered: November 2015
Senior Member
Interesting, Bill --

I have a number of the 64-pin shrink DIP Z180's (and sockets), and I've always been curious about building a SBC with one of them. I'm a KiCAD user, and the biggest problem I've encountered is the footprint for the shrink DIP device. So far I haven't been able to find one that can be used in KiCAD, and I'm not adept enough with KiCAD to try to make my own. How did you handle this? Also, the closeness of the shrink DIP pins precludes trace pass through, I think. It seems to me that the footprint would in effect create a two "fences" across the PCB and make routing difficult. I'd be curious to see your layout.

I was goofing around with KiCAD and the Z180, and did a simple PCB (don't laugh -- I was just fooling around). See attached. Of course, the Z180 socket used on this one is not a *real* shrink DIP.

A long time ago, I built a Z180 on a breadboard using the PLCC version of the chip. I got it working OK, but got discouraged when I found out about the IN x,(C) and OUT (C),x problem. The classic Z80 monitor that I had used for many years would not run properly on it without major re-work. I gave up on the idea, but have had renewed interest lately.

Roger
Re: Z1RCC, a RC2014-compatible, RomWBW-capable 2"x4" Z180 SBC [message #10456 is a reply to message #10455] Tue, 17 October 2023 12:45 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
I'm not a KiCAD user so I don't know how to create a KiCAD libarary. My old CAD program is now 25 years old, only run on Windows 98/Me (remember that?Wink, but its autorouter is pretty good and I do know how to create library components for it. The spacing between shrink DIP64 is such that a 6 mil trace can go through it and still have 7 mil clearance.

Z180 has in0 and out0 instructions to deal with internal peripherals, so you can just replace the in with in0 and out with out0.
Bill
Re: Z1RCC, a RC2014-compatible, RomWBW-capable 2"x4" Z180 SBC [message #10457 is a reply to message #10456] Tue, 17 October 2023 21:35 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
Spent the evening wired in the CPLD. It is an EPM7064SLC44 glued on top of the 512K RAM. I'm NOT going to power it up because I know I would pull an all nighter troubleshooting if it doesn't work and winding up making bad mistakes. I'll work on it tomorrow when I've rested up.
Bill
Re: Z1RCC, a RC2014-compatible, RomWBW-capable 2"x4" Z180 SBC [message #10458 is a reply to message #10457] Wed, 18 October 2023 20:20 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
Z1RCC is now alive!

The 64-byte ROM program inside CPLD decides whether to boot from serial port or from the CF disk. If it detects a keyboard input before CF disk is ready then it will load and boot 256 bytes of data from serial port; else it will load and run 256 bytes of program from CF's master boot record. CF disk is not present currently so it will always boot from serial port. The 256-byte program initially loaded via serial port is an Intel Hex loader which load and run larger application program. The screen shot show the serial loader load and run Z1RCC monitor.

Next step is plugging in the CF disk and bootstrap from CF disk. Afterward is porting RomWBW to it.
Bill
/forum/index.php?t=getfile&id=2910&private=0
/forum/index.php?t=getfile&id=2911&private=0
Re: Z1RCC, a RC2014-compatible, RomWBW-capable 2"x4" Z180 SBC [message #10464 is a reply to message #10458] Sat, 21 October 2023 06:48 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
Picture shows the CF adapter installed.

The small bootstrap code in ROM (attached) looks for either serial input or CF ready. If CF ready is detected, it loads and runs the contents of CF's master boot record. The program in the master boot record, in turn, loads and runs the monitor program resided in other area of the CF disk. So I got the monitor sign-on message one second after reset.
/forum/index.php?t=getfile&id=2912&private=0
Re: Z1RCC, a RC2014-compatible, RomWBW-capable 2"x4" Z180 SBC [message #10466 is a reply to message #10464] Mon, 23 October 2023 05:47 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
Wayne Warthen's RomWBW is now running on Z1RCC. This is a major milestone for Z1RCC. The RomWBW binary is produced by adding the following lines to the standard RCZ180_ext.asm:

RAMSIZE .SET 512 ; SIZE OF RAM IN KB (MUST MATCH YOUR HARDWARE!!!)
ROMSIZE .SET 0 ; SIZE OF ROM IN KB (MUST MATCH YOUR HARDWARE!!!)
MDROM .SET FALSE ; MD: ENABLE ROM DISK


Then use "BuildROM" script to produce a loadable 512K RomWBW binary. Because the loader software is located at the top 32K bank of the 512K RAM, the top 32K of RomWBW binary must not be loaded or it will overwrite the loader program. The top 32K or RomWBW binary are all 0x5E; it is the common working area for RomWBW when it is running, but does not need to be initialized prior to RomWBW start. After RomWBW is loaded into memory, jump to 0x0 will start up RomWBW.
/forum/index.php?t=getfile&id=2916&private=0

This demonstrates RomWBW is operating in Z1RCC and the BuildROM has successfully added essential CP/M files in the 256K RAMdrive.

Additional works are needed in Z1RCC monitor to save and restore RomWBW binary so it can be loaded and ran from CF disk. It is also time to wire up the RTC which can be automatically detected by RomWBW if properly installed.

Bill
Re: Z1RCC, a RC2014-compatible, RomWBW-capable 2"x4" Z180 SBC [message #10469 is a reply to message #10466] Tue, 24 October 2023 05:18 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
/forum/index.php?t=getfile&id=2918&private=0
I added the RTC and an I2C connector and completed all connections to the CPLD. The I/O address of RTC is 0x0C so it can be auto-detected by RomWBW. The 64-macrocell CPLD is lightly used, 38 macrocells in use out of 64 available, but the I/O pins are 100% utilized. It may be possible to optimize the design for the cheaper 32-macrocell CPLD, but I rather have the extra resources for unexpected problems or future features. The CPLD design is in schematic as attached below.

I've modified Z1RCC monitor to add commands to save 480K RomWBW image to CF disk as well as load it from disk. So now I can start up RomWBW in a couple seconds with 'B 4' command. Notice RomWBW has detected RTC in its sign on message and displayed current time.
/forum/index.php?t=getfile&id=2917&private=0

Z1RCC monitor has features to update itself and load/save new RomWBW. These are desirable features during software development, but once the software are stable, it is faster to build an entire CF image on the PC and copy the image to a new CF disk. RomWBW provides a framework for such capability and I'll describe my Z1RCC addition to RomWBW later.
Bill
Re: Z1RCC, a RC2014-compatible, RomWBW-capable 2"x4" Z180 SBC [message #10472 is a reply to message #10469] Sat, 28 October 2023 18:22 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
In previous post I mentioned that RomWBW can generate CF disk image such that master boot record, monitor, RomWBW itself, and many CP/M slices are assembled into an image that can be copied to new CF disk using image copying tool such as Win32DiskImager. Just as importantly, Wayne Warthen has provided an easy-to-understand framework so board designers like myself can generate our own custom components for a new RomWBW-capable board so disk image for this new board can be generated with collection of existing slices and new programs.

For Z1RCC, here is what I've added to RomWBW to generate a CF image for Z1RCC. The works are all done in RomWBW\Source subdirectory. The actual files are zipped in attached file, Z1RCC_image_maker_for_RomWBW.zip.

* First, the image of RomWBW for Z1RCC needs to be created using BuildROM script and specify "RCZ180" and "Z1RCC" parameters. This will create a RomWBW customized for Z1RCC in RomWBW\Binary\RCZ180_z1rcc.rom.
* Generate a powershell file, BuildZ1RCC.cmd that calls Build.cmd in RomWBW\Source\Z1RCC
* RomWBW\Source\Z1RCC is a newly created sub-directory for Z1RCC. There are several new files in this sub-directory
--Z1RCC Disk Layout.txt that describes the programs in CF's first megabyte (prefix) area. This is where Z1RCC loader located in master boot record, the partition tables, Z1RCC monitor program, RomWBW for Z1RCC are defined.
--Z1RCC_CFLDR.BIN is the binary of Z1RCC loader located in the master boot record
--Z1RCC_ptbl.bin is RomWBW partition tables located in last 72 bytes of the master boot record
--Z1RCC_mon is the binary of Z1RCC monitor
--Build.cmd is the new powershell script that collects all relevant files and put together a CF image in RomWBW\Binary\hd1k_z1rcc_combo.img
* Win32DiskImager can copy hd1k_z1rcc_combo.img to a new CF to create a bootable CF disk for Z1RCC.

This way of generating CF disk image is the prefer way of distributing Z1RCC software once the system software has stabilized. Currently Z1RCC monitor and RomWBW are still evolving rapidly, so I'm still using built-in commands in the monitor to update itself as well as RomWBW.

Z1RCC is a member of the Rom-less RomWBW Zx80 computers. The other members are ZRC512 (Z80) and ZZRCC (Z280) and more Zx80 computers are on the drawing board. They are all Rom-less and depend on CF disk to boot into monitor and RomWBW, so this is the process to generate CF image for this class of computers.
Bill

Re: Z1RCC, a RC2014-compatible, RomWBW-capable 2"x4" Z180 SBC [message #10474 is a reply to message #10472] Mon, 30 October 2023 05:38 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
I've tested enough features of Z1RCC to design a pc board and sent it to JLCPCB. It is 2-layer board 2"x4". The design rule is slightly tigher than what I used to in order to route a trace between adjacent pads of the shrink DIP64. The trace is my standard 0.007", but the clearance is slightly smaller 0.006". JLCPCB's no-additional-cost minimum is 0.006" for trace and clearance. This board has all the features I planned in the original post.
/forum/index.php?t=getfile&id=2923&private=0
A closely related board is also out to JLCPCB. It is the overclocked version of Z1RCC using 33MHz Z8S180 in PLCC68 package and CY7C1049 512Kx8 in SOJ36 package. It is the same electrical design as Z1RCC, but intend to run 36.8MHz using faster RAM and Z180. It is a 4-layer 2"x4" pc board.
/forum/index.php?t=getfile&id=2924&private=0
In the mean time I'll work on homepages for Z1RCC prototype, Z1RCC, and Z1RCC-ovrclk.
Re: Z1RCC, a RC2014-compatible, RomWBW-capable 2"x4" Z180 SBC [message #10488 is a reply to message #10474] Tue, 07 November 2023 06:18 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
/forum/index.php?t=getfile&id=2937&private=0
This is pc board version of Z1RCC. In the prototype Z1RCC, the RTC did not keep time accurately because it was bodged in middle of board among many active signals. The pc board version has an exclusion zone around DS1302's oscillator as specified in its datasheet. So now the clock is accurate and RomWBW is able to correctly measure its CPU clock using RTC as the time base.
Bill
/forum/index.php?t=getfile&id=2936&private=0
Re: Z1RCC, a RC2014-compatible, RomWBW-capable 2"x4" Z180 SBC [message #10496 is a reply to message #10488] Sat, 11 November 2023 05:07 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
/forum/index.php?t=getfile&id=2944&private=0
This is the overclocked version of Z1RCC. It is a 2"x4" 4-layer pc board. The processor is changed to Z8S180 and AS6C4008 RAM is replaced with 10ns CY7C1049; CPLD is the same 64-macrocell EPM7064S, in fact, it has the same CPLD equations. It has the same features of Z1RCC including RTC and I2C, except the clock is raised to 36.8MHz, 4 times Z1RCC. The ROM-less RomWBW image is same as Z1RCC, but RomWBW is able to auto-detct and raised CPU clock to 36.8MHz but keeping the serial baud clock at 115200. The CPU is sufficiently fast that hardware handshake is not needed for XMODEM file transfer at 115200.
Bill
Re: Z1RCC, a RC2014-compatible, RomWBW-capable 2"x4" Z180 SBC [message #10500 is a reply to message #10496] Sun, 12 November 2023 19:50 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
Z1RCC-ovrclk has a I2C interface in CPLD that consists of 2 flip flops driven by I/O address 0x9E with data[0] for clock and data[7] for I/O. The I2C interface can also serves as a neopixel interface because 36.8MHz Z180 is fast enough to toggle the flip flop in software to drive WS2812 LED. The timing spec for WS2812 is fairly loose; it is nominally 800KHz 33%-67% pulse-width modulation. The 1.25uS period is divided into 3 phases. The first phase, nominally 400nS, is always high; the 2nd phase is also 400nS in duration and contains the actual information such that high denotes '1' or low denotes '0'; the third phase is 450nS and always low. The timing is fairly loose with tolerance of +/-150nS.

This is software bit-bang approach: Assuming reg D is 0x1, reg E is 0x0, and reg A contains the 8-bit color data then phase 1 is OUT (C),D which is 12 clocks or 325nS with 36.8MHz clock, followed by outputting data in phase 2, OUT (I2C),A and RRA, which are 407nS, and then phase 3, OUT (C),E The core pulse width modulation routine for each bit is:

	OUT (C),D		;phase 1, always high, 325nS
	OUT (I2C),A		;phase 2, high or low, 407nS
	RR A			 
	OUT (C),E		;phase 3, 325nS
; pad with 2 NOP to reach 1275nS

The core routine is duplicated 24 times to generate 24 bits of LED color data or 192 bytes of instruction per LED. The program becomes rather long if we want to drive a 16x16 panel of 256 LEDs. In practice, timing for phase 1 and 2 are fairly important, but the dead time between end of phase 3 and beginning of next phase 1 is pretty relaxed, enough to tolerate extra time for decrement&jump looping. The attached program is able to drive the 5 WS2812 LED in the picture. The prototype board is plugged in the I2C socket with I2C-clock driving the WS2812 LEDs. The colors, from bottom to top, are green, red, blue, yellow, and white.
Bill
/forum/index.php?t=getfile&id=2945&private=0
Re: Z1RCC, a RC2014-compatible, RomWBW-capable 2"x4" Z180 SBC [message #10503 is a reply to message #10500] Mon, 13 November 2023 11:01 Go to previous messageGo to next message
wsm is currently offline  wsm
Messages: 232
Registered: February 2017
Location: AB, Canada
Senior Member
Bill: I think your timings may be heldover from Z80 T states rather than the Z180's which are typically lower. Perhaps the following might be a different approach for the Z180, assuming 36.864MHz & T~=27.1 ns. I'm not sure if the delays between colours and LEDS will cause a problem as I haven't gotten around to actually working with these LEDs.

If the Z1RCC CPLD schematic is correct and I can read that and your code correctly, it would appear that you connected the WS2812 DI to I2C SCL (i.e. D0). If DI was connected to SDA (D7) instead and the RRA was changed to RLA then there wouldn't be a need to reverse the ledTbl bit orders. My simple mind likes to keep things like tables as straightforward and obvious as possible. DE would also need to be changed to 8008h in my example. To change the number of LEDs, just add the 3 values for each LED into ledTbl.

I2C      EQU 9Eh          ; I2C data port, bit 0
;
writeLED: MACRO
         LOCAL BYTE
         LD   A,(HL)      ; Data to be sent
         INC  HL
         LD   B,E         ; Byte / bit counter
BYTE:    OUT0 (I2C),D     ; 13T high      = 352.6 ns
         OUT  (I2C),A     ; 10T high|low
         RRA              ;    + 3T = 13T = 352.6 ns
         OUT0 (I2C),E     ; 13T low
         DJNZ  BYTE       ;    + 9T = 22T = 596.8 ns
          MACEND                           ======
;                                          1302.1 ns
         ORG 100h
         LD  C,ledCnt     ; Number of LEDs
         LD  DE,0108h     ; Hi/low values plus byte count
         LD  HL,ledTbl
         DI
oneLED:
         writeLED         ; Green
         writeLED         ; Red
         writeLED         ; Blue
;
         DEC C
         JR  NZ,oneLED    ; Do all LEDs
;
         EI
         RET
;
ledTbl:
;LED values in reverse order so d0 is msb while d7 is lsb
         DB  20h,0,0       ; Green
         DB  0,10h,0       ; Red
         DB  0,0,8h        ; Blue
         DB  20h,20h,0     ; Yellow
         DB  40h,40h,40h   ; White
ledCnt   EQU ($-ledTbl)/3
         END
Re: Z1RCC, a RC2014-compatible, RomWBW-capable 2"x4" Z180 SBC [message #10504 is a reply to message #10503] Mon, 13 November 2023 16:11 Go to previous message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
Thank you! I completely missed the part about Z180 timing is different than Z80. My oscilloscope is tied up for another project and I didn't want to tear down the setup to check the timing. I have a version similar to yours with more instructions setting regB, inc HL, fetching next value. I was surprised it worked but I've concluded that low level of the output can be much longer than the spec and still drive WS2812 successfully. The high level needs to be more accurate, however.

Shifting out of D7 is more logical, but I was worrying about the active-low, resistor-pull-up characteristic of I2C SDA signal.
Bill
Previous Topic: Jackalope Progress
Next Topic: Dummies guide to compiling uClinux?


Current Time: Tue Jul 15 13:13:48 PDT 2025

Total time taken to generate the page: 0.00958 seconds