Home » RBC Forums » General Discussion » RIZ180, a simple hobbyist-friendly Z80180 SBC for RC2014
|
|
|
|
|
|
|
|
|
|
|
Re: RIZ180, a simple hobbyist-friendly Z80180 SBC for RC2014 [message #8226 is a reply to message #8225] |
Sun, 24 January 2021 12:45   |
norwestrzh
Messages: 196 Registered: November 2015
|
Senior Member |
|
|
I'm taking a careful look at this. Seems that the CPU is an 8 MHz part? No problems running at 12.<something>?? I have several Zilog Z80180's (10 MHz) that I got a while ago, anticipating that they would be a nice step up from the Z80. They disappointed me in that they have less address capability than the PLCC version of the 180, AND the 180 is not really completely code compatible with Z80 (as advertised). Seems the in/out instructions, via (C), don't work the same way as they do on the Z80. I understand the reason for this, but lots of legacy Z80 code uses those instructions. I had a big discussion about this with Bill (wsm) in Canada, who is a big fan of the 180. It seemed to me that you'd have to add a discrete UART to work around the issue, so what's the point of the 180? BUT, maybe I ought to give the 180 another chance? Seems like a nice CPU, and the way Plasmo has done this is a very nice, compact, design! Where did you get your boards made, Plasmo? No problems with clearances around the shrink dip socket??
Roger
|
|
|
|
Re: RIZ180, a simple hobbyist-friendly Z80180 SBC for RC2014 [message #8228 is a reply to message #8226] |
Sun, 24 January 2021 13:44   |
wsm
Messages: 232 Registered: February 2017 Location: AB, Canada
|
Senior Member |
|
|
Quote: ... the 180 is not really completely code compatible with Z80 (as advertised). Seems the in/out instructions, via (C), don't work the same way as they do on the Z80.
Lest anyone be confused, let me clarify: "IN r,(C)" works exactly the same way on the Z180 as it does on the Z80 and both processors present 16-bits on the address bus during I/O. Likewise for "IN A,(n)", IND, INDR, INI, INIR, "OUT (C),r", "OUT (n),A", OTDR, OTIR, OUTD and OUTI. The difference is that the Z180 has internal registers that require A15..A8 to be zero whereas many Z80 systems and some legacy software assumes that I/O ports only use 8-bit addressing on A7..A0. The Z180 introduced the "IN0 r,(n)" and "OUT0 (n),r" to aid in addressing internal registers.
Roger:
Although the oscillator is 12.288 MHz it's required to be 2*PHI on the HD64180 and Z80180. i.e. 12.288 MHz crystal or oscillator = 6.144 MHz PHI.
There's really no need for a discrete UART unless you want all the modem signals. While that might solve your addressing issues, most of the legacy CP/M code has source available and it's a simple matter to change the I/O code to be Z180 compatible which should also make it compatible with Z80 systems that use 16-bit I/O addressing.
Give me a PM if you want a Z180 PCB for a PLCC version or an assembled and tested Z8S180 system at 33 or 36.384 MHz.
Bill
As a follow up: I assume that much of the 8-bit only I/O addressing used on many Z80's is a holdover from the 8080 predecessor which only specified an 8-bit I/O address on A7..A0 plus it makes for simpler I/O decoders and software.
[Updated on: Sun, 24 January 2021 16:02] Report message to a moderator
|
|
|
Re: RIZ180, a simple hobbyist-friendly Z80180 SBC for RC2014 [message #8229 is a reply to message #8227] |
Sun, 24 January 2021 13:52   |
plasmo
Messages: 916 Registered: March 2017 Location: New Mexico, USA
|
Senior Member |
|
|
Roger,
The Z180 speed marking is confusing; the external clock is 2 times rated CPU clock, so 8MHz CPU works with 16MHz external clock. But because 16MHz does not divided down to reasonable baud, the clock for 8MHz CPU is quite often 18.432MHz! That's overclocked, but generally work just fine.
Z180 is not fully compatible with Z80, but the I/O block can be relocated to avoid conflicts with existing I/O. It is not a perfect solution so there are lots of dancing around the compatibility issues.
RIZ180 pc board was fabricated by JLCPCB. Design rules are 7 mil trace/spacing/annual ring. It was designed so the autorouter can route a trace between pads, but somehow my autorouter refused to run traces between pads. Stupid machine! Had I known that I'd used bigger pads and larger holes to make assembly easier. In the existing design, the shrink DIP socket need to be soldered down first because the pin alignment need to be perfectly straight, so do that first before rest of components get in the way.
Bill
Edit, I see Bill has already explained the compatibility issues and does a better job than I.
[Updated on: Sun, 24 January 2021 14:51] Report message to a moderator
|
|
|
Re: RIZ180, a simple hobbyist-friendly Z80180 SBC for RC2014 [message #8230 is a reply to message #8229] |
Sun, 24 January 2021 14:53   |
plasmo
Messages: 916 Registered: March 2017 Location: New Mexico, USA
|
Senior Member |
|
|
Gary, Now I remember what I did to do XMODEM without handshake. With 18.432MHz clock, RIZ180 operates at 57600 baud serial port. I have a version of CP/M that operates at 19200. It is loaded into memory, run from 0xF200, and boot into CP/M. At that point change the serial port to 19200 N81, no handshake. File transfer with XMODEM works fine without handshake at 19200. Once the required files are transferred, change baud to 57600, press reset then 'b2' to boot into normal CP/M. Attached is the modified CP/M BDOS/CCP/BIOS, but it assume your clock is 18.432MHz.
Bill
|
|
|
|
Re: RIZ180, a simple hobbyist-friendly Z80180 SBC for RC2014 [message #8234 is a reply to message #8228] |
Sun, 24 January 2021 19:11   |
norwestrzh
Messages: 196 Registered: November 2015
|
Senior Member |
|
|
We've had this discussion before, Bill (wsm not Plasmo). It all boils down to how you define "works exactly", and "code compatible". The attached snippet of code works on every Z80 I've ever encountered. Last time I tried it, it wouldn't work on my breadboard Z180 (PLCC). I've torn it down now, so I can't try it again. Whether you attribute it to sloppy coding or legacy 8080, or whatever -- it doesn't work. If you can get it to work (other than changing the IN/OUTs to IN0/OUT0s) then my apologies.
My interpretation of "code compatible" is that anything written for the Z80 will work on the Z180. If I were writing code, and trying to sell it (thank God I'm not), I'd be very upset to have to track down "glitches" like this and spend man hours modifying legacy code that ought to work on a "code compatible" CPU. Sorry, but that's the way I look at it.
Maybe there was something wrong with the breadboard Z180 that I built that would cause this code to fail?? Always possible.
; command is "I xx [yy]", where xx is hex port #
; and yy is hex count (0 if continuous)
RES 0,(iflag) ; not continuous
LD A,xx ; port addr
LD C,A ; put in C
LD B,1
LD A,nargs ; # of arguments
CP 2
JR C,loop ; lt 2? just do 1x
LD A,yy ; # of iterations
LD B,A
OR A
JR NZ,loop ; B is # of inputs
SET 0,(iflag) ; yy is 0, do continuous
loop: LD A,C
CALL phexsp ; print port #, space
IN A,(C)
CALL phex ; print input data
CALL ck4dot ; stop if '.' pressed
PUSH BC
CALL crlf ; print cr/lf
POP BC
BIT 0,(iflag) ; if continuous, just loop
JR NZ,loop
DJNZ loop ; otherwise count
[Updated on: Sun, 24 January 2021 19:19] Report message to a moderator
|
|
|
|
Re: RIZ180, a simple hobbyist-friendly Z80180 SBC for RC2014 [message #8243 is a reply to message #8234] |
Mon, 25 January 2021 14:33  |
 |
lowen
Messages: 226 Registered: August 2016 Location: Western NC USA
|
Senior Member |
|
|
norwestrzh wrote on Sun, 24 January 2021 22:11We've had this discussion before, Bill (wsm not Plasmo). It all boils down to how you define "works exactly", and "code compatible". The attached snippet of code works on every Z80 I've ever encountered. Last time I tried it, it wouldn't work on my breadboard Z180 (PLCC). I've torn it down now, so I can't try it again. Whether you attribute it to sloppy coding or legacy 8080, or whatever -- it doesn't work. If you can get it to work (other than changing the IN/OUTs to IN0/OUT0s) then my apologies.
My interpretation of "code compatible" is that anything written for the Z80 will work on the Z180. ...
The Z80 places the contents of B on the upper 8 bits of the address lines (A8-A15) for an IN or OUT using the C indirect. The Z180 will do exactly the same thing, EXCEPT in the case of B=0. If A8-A15 is 0 (this can also happen with IN, A,(xx) and OUT (xx),A if A=0!) then the Z180 will include the internal peripheral addresses (wherever they're programmed to be) in the port map.
The B-> A8-A15 and C-> A0-A7 is fully documented Z80 behavior. The Z180 just has the internal peripherals respond if A8-A15 is 0. See "Programming the Z80, 3rd Edition" (available online by permission of the author, Rodnay Zaks) pages 260 (PDF page 261) for the IN r,(C) case and 262 (PDF page 263) for the IN A,(xx) case. All the other I/O instructions behave the same way, INI, INIR, IND, INDR, OUTI, OUTD, OTDR, OTIR, all.
In your code it looks like B will never be 0, thus the internal peripherals will never be accessed. If you want to access the internal peripherals, either B needs to be 0 or you need to use IN0 r,(C) instead.
No, it's not 100% compatible; Z180 doesn't do the undocumented opcodes of Z80 either, like the operations that address the lower-order or high-order individual bytes of IX and IY.
NOW, Z280 DOES support that, and further has 24-bit I/O port addressing with the upper 8 bits (A16-A23) being non-zero for internal peripherals, and an IOBASE register to manipulate those bits.
But the Z280 is alone in this regards; ALL of the other members of the Z80 family (Z380, eZ80) operate like Z180.
--
Bughlt: Sckmud
Shut her down Scotty, she's sucking mud again!
[Updated on: Mon, 25 January 2021 14:34] Report message to a moderator
|
|
|
Current Time: Mon Mar 24 22:02:44 PDT 2025
Total time taken to generate the page: 0.03826 seconds
|