ROMWBW and serial ports

416 views
Skip to first unread message

Kevin Boone

unread,
May 31, 2023, 10:29:22 AM5/31/23
to RC2014-Z80
Hi folks

I have an SC130 Z180 motherboard with two serial ports. I've just discovered that one of these ports doesn't support hardware flow control (this is in the documentation, which I didn't read :/ ).

I can get around this problem for simple applications just by setting the baud rate at both ends to low value. However, it's not very elegant, and won't work if the CP/M application has to do anything with the incoming data more time-consuming that displaying it.

I note that there is a dual-port serial module[1] called SC104 from (I guess) the same designer as the SC130. So it I bought/built one of these, would ROMWBW recognize it? How would it appear to CP/M?

Thanks in advance,
Kevin


Richard Deane

unread,
May 31, 2023, 11:36:35 AM5/31/23
to rc201...@googlegroups.com
A tip - you can rebuild romwbw to swap port A and B , so console on A loses hand shake which you don't need if you use port B for data transfers. Port B can then be used with hardware handshaking .

It's a simple  change. I just forgot which file it is in  😀 

Richard



--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rc2014-z80/b5bb3d1f-23af-4355-8183-f7a21ea16035n%40googlegroups.com.

Derek Cooper

unread,
May 31, 2023, 12:40:40 PM5/31/23
to RC2014-Z80
Hi,
In the CBIOS.ASM file, it looks like com2 and com3 become ur1 ur2 in cp/m

LD_TTY .EQU CIO_CONSOLE ; -> COM0:
LD_CRT .EQU CIO_CONSOLE ; -> CRT:
LD_BAT .EQU DEV_BAT
LD_UC1 .EQU CIO_CONSOLE ; -> COM1:
LD_PTR .EQU CIO_CONSOLE ; -> COM1:
LD_UR1 .EQU CIO_CONSOLE ; -> COM2:
LD_UR2 .EQU CIO_CONSOLE ; -> COM3:
LD_PTP .EQU CIO_CONSOLE ; -> COM1:
LD_UP1 .EQU CIO_CONSOLE ; -> COM2:
LD_UP2 .EQU CIO_CONSOLE ; -> COM3:
LD_LPT .EQU CIO_CONSOLE ; -> LPT0:
LD_UL1 .EQU CIO_CONSOLE ; -> LPT1:

However, If it where me I would probably check that with Wayne!  Also if i remember back in the day most software that needed reliable high speed serial used the hardware directly as cp/m does not handle things like IObyte consistently and reliably.

As well as the SC104 (Dual port SIO/2) there is also SC139 (single port ) and probably many others, i note there is a 4port SIO board on hackaday web site for example.

Derek

Wayne Warthen

unread,
May 31, 2023, 1:56:07 PM5/31/23
to rc201...@googlegroups.com
On Wed, May 31, 2023 at 7:29 AM 'Kevin Boone' via RC2014-Z80 <rc201...@googlegroups.com> wrote:
I have an SC130 Z180 motherboard with two serial ports. I've just discovered that one of these ports doesn't support hardware flow control (this is in the documentation, which I didn't read :/ ).

Yes, to be clear, primary ASCI port does support flow control, secondary port does not.

I can get around this problem for simple applications just by setting the baud rate at both ends to low value. However, it's not very elegant, and won't work if the CP/M application has to do anything with the incoming data more time-consuming that displaying it.

Yup.

I note that there is a dual-port serial module[1] called SC104 from (I guess) the same designer as the SC130. So it I bought/built one of these, would ROMWBW recognize it? How would it appear to CP/M?

This module is automatically detected and supported by the standard RomWBW SC130 ROM.  Unless you disable the ASCI driver, the SIO ports will become the 3rd and 4th character devices.  Access to the 3rd and 4th ports varies with the OS you use.  As Derek pointed out, they will be assigned to CP/M 2.2 physical devices UR1/UR2 and UP1/UP2 which may not be very helpful.  Under CP/M, they will become COM2: and COM3: and you can use the CP/M 3 DEVICE command to assign them as console, aux, and/or printer.  Another approach is to ue the RomWBW loader "I" command to make one of them the console before launching your OS.  The OS will inherit the console device.  Finally, you could build a custom ROM and use the CONDEV setting to set the desired console port.

As Richard pointed out, you can swap the ASCI ports at the driver level.  This requires building a custom ROM with ASCISWAP set to TRUE.

Thanks,

Wayne

Steve Cousins

unread,
May 31, 2023, 4:24:37 PM5/31/23
to RC2014-Z80
As Wayne says....

Here is the terminal #1 output from an SC130 with RomWBW v3.2.0 plus an SC104 module:


RomWBW HBIOS v3.2.0, 2023-03-18

Small Computer SC130 [SCZ180_sc130] Z8S180-K @ 18.432MHz IO=0xC0
0 MEM W/S, 2 I/O W/S, INT MODE 2, Z180 MMU
512KB ROM, 512KB RAM
ROM VERIFY: 00 00 00 00 PASS

AY: MODE=RCZ180 IO=0x68 NOT PRESENT
ASCI0: IO=0xC0 ASCI MODE=115200,8,N,1
ASCI1: IO=0xC1 ASCI MODE=115200,8,N,1
SIO0: IO=0x80 SIO MODE=115200,8,N,1
SIO1: IO=0x82 SIO MODE=115200,8,N,1
DSRTC: MODE=STD IO=0x0C NOT PRESENT
INTRTC: Wed 2020-01-01 00:00:00
MD: UNITS=2 ROMDISK=384KB RAMDISK=256KB
FD: MODE=RCWDC IO=0x50 NOT PRESENT
IDE: IO=0x10 MODE=RC
IDE0: NO MEDIA
IDE1: NO MEDIA
PPIDE: IO=0x20 PPI NOT PRESENT
SD: MODE=SC OPR=0x0C CNTR=0xCA TRDR=0xCB DEVICES=1
SD0: NO MEDIA

Unit        Device      Type              Capacity/Mode
----------  ----------  ----------------  --------------------
Char 0      ASCI0:      RS-232            115200,8,N,1
Char 1      ASCI1:      RS-232            115200,8,N,1
Char 2      SIO0:       RS-232            115200,8,N,1
Char 3      SIO1:       RS-232            115200,8,N,1
Disk 0      MD0:        RAM Disk          256KB,LBA
Disk 1      MD1:        ROM Disk          384KB,LBA
Disk 2      IDE0:       Hard Disk         --
Disk 3      IDE1:       Hard Disk         --
Disk 4      SD0:        SD Card           --


Small Computer SC130 [SCZ180_sc130] Boot Loader

Boot [H=Help]: h

  L           - List ROM Applications
  D           - Device Inventory
  R           - Reboot System
  I <u> [<c>] - Set Console Interface/Baud code
  V [<n>]     - View/Set HBIOS Diagnostic Verbosity
  <u>[.<s>]   - Boot Disk Unit/Slice

Boot [H=Help]: i 2

  Console on Unit #2



And then this on terminal #2 (SC104 SIO port A):

Small Computer SC130 [SCZ180_sc130] Boot Loader

Boot [H=Help]: H

  L           - List ROM Applications
  D           - Device Inventory
  R           - Reboot System
  I <u> [<c>] - Set Console Interface/Baud code
  V [<n>]     - View/Set HBIOS Diagnostic Verbosity
  <u>[.<s>]   - Boot Disk Unit/Slice

Boot [H=Help]:

Kevin Boone

unread,
Jun 1, 2023, 3:18:38 AM6/1/23
to RC2014-Z80
Hi. I presume that the problem with handshaking would affect data from _from_ the CP/M system as well as towards it, right? For example, if I wanted to use a serial printer, I'd need handshaking to work. Or is there some magic going on that I don't understand? Best wishes, Kevin

Gary S

unread,
Jun 1, 2023, 4:13:10 AM6/1/23
to rc201...@googlegroups.com
What's wrong with software flow control (or am I not going far enough back in years ?) ?



--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+...@googlegroups.com.

Kevin Boone

unread,
Jun 1, 2023, 4:22:08 AM6/1/23
to RC2014-Z80
Is it supported by the ROMWBW BIOS? Or within CP/M itself? I can see how software flow control would be fine if it were implemented properly at both ends of the link. If I wanted to use (say) a serial printer, would it support software flow control?

Derek Cooper

unread,
Jun 1, 2023, 11:34:31 AM6/1/23
to RC2014-Z80
Most serial printers "back in the day" could use Xon/Xoff software flow control.

Derek

Wayne Warthen

unread,
Jun 1, 2023, 12:18:35 PM6/1/23
to RC2014-Z80
On Thursday, June 1, 2023 at 12:18:38 AM UTC-7 Kevin Boone wrote:
Hi. I presume that the problem with handshaking would affect data from _from_ the CP/M system as well as towards it, right? For example, if I wanted to use a serial printer, I'd need handshaking to work. Or is there some magic going on that I don't understand? Best wishes, Kevin

Yes, you are right.

RomWBW supports inbound and outbound flow control for all types of serial ports, but is subject to the various deficiencies of the hardware involved.
  •  Secondary Z180 ASCI port has neither inbound nor outbound flow control available (RTS & CTS signals not available).
  • Official RC2014 SIO module has no outbound flow control available on either port (CTS not connected on module).  This limitation does not apply to Stephen Cousins modules.
Thanks,

Wayne

Wayne Warthen

unread,
Jun 1, 2023, 12:27:10 PM6/1/23
to RC2014-Z80
On Thursday, June 1, 2023 at 1:22:08 AM UTC-7 Kevin Boone wrote:
Is it supported by the ROMWBW BIOS? Or within CP/M itself? I can see how software flow control would be fine if it were implemented properly at both ends of the link. If I wanted to use (say) a serial printer, would it support software flow control?

XON/XOFF flow control is not supported by RomWBW.  I made the design decision to keep all serial ports 8-bit clean to ensure no issues with file transfers.  IMHO, XON/XOFF is better implemented in the OS because it may or may not be appropriate depending on the specific usage of the specific port.  It may be the case that some of the OSes running on RomWBW do support XON/XOFF.  I am pretty sure that CP/M 3 allows this, but I have never really tried it.

Thanks,

Wayne
 

Tadeusz Pycio

unread,
Jun 1, 2023, 1:17:21 PM6/1/23
to RC2014-Z80
I used incomplete flow control (CTS) for the second serial port on my Z180 MPU, but this involves the loss of the synchronous port. This is a matter of Z180 limitations and is only used for specific applications.

Derek Cooper

unread,
Jun 1, 2023, 1:42:56 PM6/1/23
to RC2014-Z80
Hi Wayne, I was thinking more along the lines of the application doing the Xon/Xoff. Same as Wordstar does.

Derek

Kevin Boone

unread,
Jun 1, 2023, 2:22:43 PM6/1/23
to RC2014-Z80
I can see how some applications could do xon/xoff as part of their normal operation. I was trying to use my CP/M system to log into a remote Linux system using a serial connection. The Linux system was much faster so, when it sent data, it would easily overwhelm my CP/M system. I believe that the CP/M version of Kermit supports xon/xoff, and I'm reasonably sure I could make the Linux system do it (although I confess that I haven't gotten around to trying). A job for tomorrow, I guess.

I guess what I'm meandering towards is -- I don't really know whether the absence of hardware flow control is an issue or not. I guess I'll find out in due course.

On a related note -- I was looking for level converters so provide 'real' RS232, rather than TTL levels. There are dozens of ready-built modules for this on eBay and whatnot, but I couldn't find a single one that supported hardware flow conrol. So if I wanted this, I guess I'd have to construct the hardware for it (unless I'm just looking in the wrong place).

I'm guessing that nobody cares about flow control any more because, even in the rare cases where anybody uses RS232-style serial communications, the equipment at each is likely to be much faster than the serial communication itself. Or maybe there is some other explanation?

Best wishes
Kevin

Alan Cox

unread,
Jun 1, 2023, 3:51:47 PM6/1/23
to rc201...@googlegroups.com
> On a related note -- I was looking for level converters so provide 'real' RS232, rather than TTL levels. There are dozens of ready-built modules for this on eBay and whatnot, but I couldn't find a single one that supported hardware flow conrol. So if I wanted this, I guess I'd have to construct the hardware for it (unless I'm just looking in the wrong place).

You use two of them - one for the rx/tx signals one for the cts/rts.

>
> I'm guessing that nobody cares about flow control any more because, even in the rare cases where anybody uses RS232-style serial communications, the equipment at each is likely to be much faster than the serial communication itself. Or maybe there is some other explanation?

Flow control is as good as broken on a lot of USB adapters anyway.
They do hardware flow control but the latency is so high that it
doesn't respond in time. Some of the performance also depends on what
you are using. The default RomWBW serial drivers have a very high
overhead due to the abstraction layer and banking (same problem with
Fuzix on RC2014, same reason). If you use a file transfer program with
customisable serial modules that bash the hardware directly you can
get pretty decent rates (38400 should be reliable with stuff like
xmoden).

With a DMA setup the Z180 should be reliable at 115200 but that
definitely involves magic and custom code.

Alan

Michael A. Druckenmiller Sr

unread,
Jun 1, 2023, 5:29:01 PM6/1/23
to rc201...@googlegroups.com

Sorry, I didn't see this sooner. A Maxim 232 is a 5V powered IC that generates the requisite voltages internally and provides 2 TX and 2 RX signals. Which handles the RTS/CTS signals in both directions.

The alternative is 1488/1489 IC's but they require external +12/-12volt supplies.

I've generated those voltages using a center tapped transistor radio audio output transformer and a 555. But, the Max 232 is much easier to use and doesn't have an easily fried transformer.

Hope this helps

Flow control is as good as broken on a lot of USB adapters anyway.
They do hardware flow control but the latency is so high that it
doesn't respond in time. Some of the performance also depends on what
you are using. The default RomWBW serial drivers have a very high
overhead due to the abstraction layer and banking (same problem with
Fuzix on RC2014, same reason). If you use a file transfer program with
customisable serial  modules that bash the hardware directly you can
get pretty decent rates (38400 should be reliable with stuff like
xmoden).

With a DMA setup the Z180 should be reliable at 115200 but that
definitely involves magic and custom code.

Alan

--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rc2014-z80/CAK9X0%2BuAD-tj_3ysBRXrjRY1u7CAz%2BF0K6hOR1s%3DzA8zHUX94g%40mail.gmail.com.
max232.pdf
mc1488.pdf
mc1489.pdf

Derek Cooper

unread,
Jun 2, 2023, 5:11:39 AM6/2/23
to RC2014-Z80
I have used MAX232 in the past and it's used on the MBC-68000 board. It seems to work ok.

On TTL boards like the SC108/SC114 and SC130 I have used a ready made adapter from Ebay or someplace like that. It to works fine into a serial port on a PC. Attached photo
IMG_1490.jpg

Derek Cooper

unread,
Jun 2, 2023, 5:12:55 AM6/2/23
to RC2014-Z80
That version does not support flow control, but I have seen some that do.

Derek

Kevin Boone

unread,
Jun 2, 2023, 5:47:32 AM6/2/23
to RC2014-Z80
Hi Derek

Where have you seen a version of this that supports flow control? It would certainly be more convenient than constructing something. None of the similar items I've seen for sale even have pins for the flow control lines.

Best wishes
Kevin

Phil G

unread,
Jun 2, 2023, 7:31:21 AM6/2/23
to RC2014-Z80
Re flow control within an application and missing Z180 handshaking signals, theres no particular reason that CTS/RTS has to come from the uart,
any spare I/Oport bit could be wired to the serial port device be that usb or max232 and controlled by the app (or bios).   I did this on my AX25/Fido bridge. 
Bit-banged handshaking if you will  :)

Michael A. Druckenmiller Sr

unread,
Jun 2, 2023, 8:09:02 AM6/2/23
to rc201...@googlegroups.com

If you don't have it already here is the Z180 Family Data Book

It is true that the DIP version  only has CTS/RTS on port 0. There is also a CTS Enable.

I did a search for CTS Enable and only found one (searchable) notation on page 138 and that wasn't clear, at least to me.

I did not see where the CTS input went to a register for software control.

Which would indicate to me that the CTS turns the Transmitter on and off in hardware.

In my mind that would mean your software would have to monitor TX buffer full to prevent TX over run.

There is a reason I haven't gone past the Z80 basic for my hobbies. :)

Mike Sr.

http://www.zilog.com/docs/z180/um0050.pdf

Michael A. Druckenmiller Sr

unread,
Jun 2, 2023, 8:22:55 AM6/2/23
to rc201...@googlegroups.com

The Z180 MPU Manual https://www.zilog.com/docs/z180/ps0140.pdf Has a fuller dissertation on the CTS input pages 48/49 It does appear that you can either auto control the Transmitter or use software control.

Mike Sr.

 

On 6/2/2023 5:47 AM, 'Kevin Boone' via RC2014-Z80 wrote:

Michael A. Druckenmiller Sr

unread,
Jun 2, 2023, 8:25:49 AM6/2/23
to rc201...@googlegroups.com
I am looking for a working 68B50 working serial port.

If you have one and are willing to sell it please let me know.

Mike Sr

Albany, GA USA


Bob Kircher

unread,
Jun 2, 2023, 9:23:14 AM6/2/23
to RC2014-Z80
There is an adapter available on Amazon that does support RTS/CTS: https://www.amazon.com/dp/B07BJJC3R6?psc=1&ref=ppx_yo2ov_dt_b_product_details  However although it works with some hardware it does not work with all of them, in particular not with my SC126.  The problem is that the TTL inputs to the module can only go down to ~2.4v or so, not even close to the 0.8v threshold for a logic zero.  Something on the module appears to be pulling the signal high.  I discovered this troubleshooting the serial on the SC126 and scoped TxD.  My solution was to make my own adapter with a max232 and caps on a small prototyping board.

kf5...@gmail.com

unread,
Jun 2, 2023, 9:53:15 AM6/2/23
to RC2014-Z80
I recently picked one up from Jameco.  Here is the link.

Michael A. Druckenmiller Sr

unread,
Jun 2, 2023, 9:58:09 AM6/2/23
to rc201...@googlegroups.com

Looks Interesting.

It appears to have resistors in series with the TX and RX Data Lines. Plus there are a number of other resistors which may be causing the adapter to fail.

This may be of more use over on the [rc2014-z80] ROMWBW and serial ports thread so I am going to report the URL there.

Thanks I've added it to me Amazon wish list.

Mike Sr

--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+...@googlegroups.com.

Michael A. Druckenmiller Sr

unread,
Jun 2, 2023, 10:02:35 AM6/2/23
to rc201...@googlegroups.com

on my request for a 68B50 based Serial card Bob Kirsher sent this URL https://www.amazon.com/dp/B07BJJC3R6?ref=ppx_yo2ov_dt_b_product_details&th=1

It looks like it is made for our needs. However, apparently some of the input/outputs on the TTL side don't go below 2.4 V. I think that may be do to some of the in series and pull up resistor. Still, jumpering the resistors on the RX/TX lines may cure the problem. Or, raising the resistor values if there are pullups.

Mike Sr.

Michael A. Druckenmiller Sr

unread,
Jun 2, 2023, 10:03:57 AM6/2/23
to rc201...@googlegroups.com

Thanks!

I've got the IC's what I need is the bare board that used to be part of the RC2014 kits or some equivalent.

Mike Sr.

--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+...@googlegroups.com.

Richard Deane

unread,
Jun 2, 2023, 10:06:28 AM6/2/23
to rc201...@googlegroups.com
If you end up building from scratch you my find this useful - https://hackaday.io/project/170819-16c2552-dual-uart-for-rc2014
I built one, works well, and under romwbw

richard

Alan Cox

unread,
Jun 2, 2023, 10:09:33 AM6/2/23
to rc201...@googlegroups.com
On Fri, 2 Jun 2023 at 15:03, 'Michael A. Druckenmiller Sr' via
RC2014-Z80 <rc201...@googlegroups.com> wrote:
>
> Thanks!
>
> I've got the IC's what I need is the bare board that used to be part of the RC2014 kits or some equivalent.

Drop an email to Spencer. When I wanted to get one for testing Fuzix
back compat with the old style serial he still had some boards left
but not listed for sale.

Alan
Reply all
Reply to author
Forward
0 new messages