Second Serial Port

277 views
Skip to first unread message

Andrew Pamment

unread,
Apr 24, 2020, 7:34:30 AM4/24/20
to retro-comp
Hi there

My System: I've got an SIO/2 card (an SC104 I think) together with a SC108 and a base board I forget the SC number of that, also a Compact flash card with CP/M on it.

What I am trying to do, is access the second serial port on the sio/2 card. I hooked up an arduino mega to via the second serial port on the mega and put in a little script to echo stuff from the second to the first serial port. So the idea was I would type in a terminal program on CP/M and it would show up on the arduino serial monitor, and vice versa.

I really don't know what I am doing.

Firstly, I found two terminal programs, one called ASCOM and another called IMP. I figured out how to use IMP, but I suspect it needs to be tailored to the SIO card, as reading the comments it looks like it's meant to work something else. I also found mention a CTC module, perhaps I need one of those too?

So I think setting up the mega with (MEGA) TX1 -> (SIO2) RX and (MEGA) RX1 -> (SIO2) TX and Ground -> Ground should work?

I'm guessing my problem is getting a terminal program to talk to the second serial port?

Any tips would be greatly appreciated, I'm a complete newbie :P

Andrew

Anna Christina Naß

unread,
Apr 24, 2020, 9:18:52 AM4/24/20
to retro...@googlegroups.com
Am 24.04.20 um 13:34 schrieb Andrew Pamment:

Hi Andrew,

> What I am trying to do, is access the second serial port on the sio/2
> card. I hooked up an arduino mega to via the second serial port on the
> mega and put in a little script to echo stuff from the second to the
> first serial port. So the idea was I would type in a terminal program on
> CP/M and it would show up on the arduino serial monitor, and vice versa.
[...]
> So I think setting up the mega with (MEGA) TX1 -> (SIO2) RX and (MEGA)
> RX1 -> (SIO2) TX and Ground -> Ground should work?
>
> I'm guessing my problem is getting a terminal program to talk to the
> second serial port?
>
> Any tips would be greatly appreciated, I'm a complete newbie :P

First, please check the voltages of the serial connections on your
Arduino. If it only accepts 3.3V, you should use level shifters, as the
RC2014 SIO/2 outputs +5V on TX.
If your Arduino accepts +5V (or you use a level shifter), the connection
should work as you write (RX->TX, TX->RX, GND).

As for the terminal program, you have to use a program that can talk to
the SIO chip - or that uses the generic "iobyte" mechanism.

I've patched the program "QTERM" to use the SIO/2 chip, you can find it
here: https://git.imzadi.de/acn/rc2014-tools/src/master/qterm
QTERM82.COM will talk to the second serial port of the first SIO/2
module, so this should work with your setup.
(QTERM84.COM would talk to the first serial port of a second SIO/2 card)

In the file QTERM43F.LBR, you can find the whole program and documentation.

Another program you could use is KERMIT, which you can find here:
http://www.z80.eu/kermit.html
Just download CPSKER.HEX and CPVGEN.HEX, the "generic CP/M 2.2 IOBYTE"
version, together with MLOAD.COM and combine them using:
MLOAD KERMIT=CPSKER,CPVGEN
to get a KERMIT.COM.
After starting KERMIT, you might have to use the command SET PORT to set
a port, use "SET PORT ?" (I think it was that way) to get a list of
available ports.

Just ask, if you have further questions :)

Have a nice weekend!

Regards,
Anna

Steve Cousins

unread,
Apr 24, 2020, 9:25:18 AM4/24/20
to retro...@googlegroups.com
Hi Andrew

SC108 processor module normally has the Small Computer Monitor (SCM) in ROM. You can test your second serial port via SCM as follows:

The Z80 system's first serial port should be connected to PC/Mac/Linux box via a USB to serial adapter and the PC should be running a terminal program set for 115200 baud. Power up the Z80 system and you should be able to interact with the Z80 system using the terminal program. You now have a working serial port, USB adapter, and terminal program. Now type the command "CONSOLE 2" on the terminal. You will see no response as you have switched to serial port 2. Now move the USB adapter from serial port 1 to serial port 2. You should now be able to continue using SCM via serial port 2. You will need to power the Z80 system from something other than the serial port for this to work.

Once you have established the second serial port works you should have fewer unknows to play with.

You only need a CTC if you want software control of the baud rate.

I hope that helps.

Steve

Wayne Warthen

unread,
Apr 24, 2020, 12:26:34 PM4/24/20
to retro-comp
On Friday, April 24, 2020 at 6:18:52 AM UTC-7, Anna Christina wrote:
Another program you could use is KERMIT, which you can find here:
http://www.z80.eu/kermit.html
Just download CPSKER.HEX and CPVGEN.HEX, the "generic CP/M 2.2 IOBYTE"
version, together with MLOAD.COM and combine them using:
MLOAD KERMIT=CPSKER,CPVGEN
to get a KERMIT.COM.
After starting KERMIT, you might have to use the command SET PORT to set
a port, use "SET PORT ?" (I think it was that way) to get a list of
available ports.

FYI, I have added KERMIT.COM to all of the RomWBW boot disk images.  It is the generic version of Kermit created just as  described by Anna above.  Just a convenience.  Note that there is a CP/M 2.2 and CP/M 3 version of the generic Kermit.  I have placed the correct version in each of the boot disks.  The port selection mechanism on each is slightly different.

This change is in the dev branch of RomWBW at GitHub.

-Wayne

Jim McGinnis

unread,
Apr 24, 2020, 12:36:07 PM4/24/20
to retro-comp
Great news that Kermit for CPM3 will be generally available via the distribution. I use it extensively with Raspberry Pi running C-Kermit in server mode. I can't get past 38400 baud with it using USB port to Pi. Not sure if CTS and RTS are active, yet.

Kermit for CPM3 depends on how AUXIN: and AUXOUT: are mapped. There are no port commands supported in the CPM3 version.
Using DEVICE commands to set the AUXIN: and AUXOUT: is all that is required (along with MODE command for baud rates, etc.).

BTW - I have rebuilt Kermit (4.11 baseline) for CPM3 (and CPM2.2) that further defines the terminal IO as VT100 mode.

Let me know if these are interesting to you and I will send them.

Cheers

Jim

Wayne Warthen

unread,
Apr 24, 2020, 12:40:32 PM4/24/20
to retro-comp
On Friday, April 24, 2020 at 9:36:07 AM UTC-7, Jim McGinnis wrote:
BTW - I have rebuilt Kermit (4.11 baseline) for CPM3 (and CPM2.2) that further defines the terminal IO as VT100 mode.

Let me know if these are interesting to you and I will send them.

Yes, please!  If possible, can you send along the source changes?  I like being able to rebuild things from scratch as needed.

Thanks,

Wayne 

Jim McGinnis

unread,
Apr 24, 2020, 12:45:38 PM4/24/20
to retro-comp
Roger. Wilco!

Jim

Andrew Pamment

unread,
Apr 24, 2020, 5:07:05 PM4/24/20
to retro-comp

Thanks guys!

I'm so happy! I connected to my BBS via the arduino -> tcpser

Anna's QTerm worked perfectly.

Steve, the CONSOLE 2 worked as well! Thankyou!

Only thing I noted, while connecting from Arduino -> SIO/2 worked at 115200, I had to adjust the Arduino -> PC baud rate to 38400 as otherwise it seemed to drop characters.

Thanks all

Andrew

Anna Christina

unread,
Apr 26, 2020, 9:37:47 AM4/26/20
to retro-comp
Am Freitag, 24. April 2020 18:36:07 UTC+2 schrieb Jim McGinnis:

Hallo Jim,

BTW - I have rebuilt Kermit (4.11 baseline) for CPM3 (and CPM2.2) that further defines the terminal IO as VT100 mode.

Which files did you use?
I guess CPSKER.HEX (Kermit base) and CPVCP3.HEX (Generic CP/M 3), but what file did you use for VT100 mode?

Thank you!

Regards,
Anna

Jim McGinnis

unread,
Apr 26, 2020, 10:45:42 AM4/26/20
to retro...@googlegroups.com
Greetings Anna!

You need to rebuild modified ASM files to get VT100 support. I have provided the original as well as modified source files (2) that are required.

Wayne has been working to include the builds in his distribution. He also wanted to be able to rebuild from sources.
So, I sent him the following and you are welcome to the same information as is everyone here:




I have added three Google Drive zip files containing:

1. Kermit411 Baseline Sources from http://www.kermitproject.org/
2. A build directory (build on CP/M 2.2) - currently configured for CPM3 build
3. Executable - CP/M2.2 Generic w/VT100 Emulation and CPM3 Generic w/VT100 Emulation

Note that I elected to use LASM and MLOAD after converting the HEX files to COM files. The projects are configured for LASM. I was unsuccessful in using M80 and L80.

The build is pretty straight forward:

1. Modify CPSKER.ASM and CPXTYP.ASM as needed.
2. LASM CPSKER
3. LASM CPXTYP
4. MLOAD KERNEW.COM=CPSKER,CPXTYP

You can name the result file anything. KERNEW.COM matches a lot of the Kermit documentation.

The build details/methods were found in the "Kermit User Guide:CP/M-80 KERMIT (15.4.2)" page 338 or so.  https://retrocmp.de/transfer/kermit-ugd.pdf

Let me know if you run into any problems with this set of files or access to the google drive files...



Note that the two source files modified (CPSKER.ASM and CPXTYP.ASM)  have "[JRM] blah blah" notes inside. Just search for [JRM] to find the very few tags and see what I changed.

What was daunting was the sheer mass of files for Kermit. When you assemble the two base files you will see it just isn't that complicated.

Cheers

PS Edit:

Note that the KERCPM22 reports 4.11 and KERCPM3 reports 4.11A. The "A" in the version report is all that you get when differentiating these builds. That and the fact that SET PORT is unsupported in the 4.11A version. That is your hint that the build is CPM3 based.

Jim

Wayne Warthen

unread,
Apr 26, 2020, 2:03:06 PM4/26/20
to retro-comp
On Sunday, April 26, 2020 at 7:45:42 AM UTC-7, Jim McGinnis wrote:
Greetings Anna!

You need to rebuild modified ASM files to get VT100 support. I have provided the original as well as modified source files (2) that are required.

Wayne has been working to include the builds in his distribution. He also wanted to be able to rebuild from sources.
So, I sent him the following and you are welcome to the same information as is everyone here:

This is done.  In the GitHub dev branch, the boot disk images will now contain either KERMCPM22.COM or KERCPM3.COM as appropriate.  These were created based on Jim's work.
 
Note that the KERCPM22 reports 4.11 and KERCPM3 reports 4.11A. The "A" in the version report is all that you get when differentiating these builds. That and the fact that SET PORT is unsupported in the 4.11A version. That is your hint that the build is CPM3 based.

I am embarrassed to say that I did not manage to pick up on this.  Both Kermit variations in my distribution report 4.11 without the A.  I just missed that you had built the CP/M 3 variant differently.  Anyway, I can fix this, but I just assumed the filename was sufficient to differentiate.  Now that I think about it, I actually may take a quick look at changing the startup banner.  They both say "Generic CP/M-80" now.  Seems like one should say "Generic CP/M-80 for CP/M 2.2" and the other should say "Generic CP/M-80 for CP/M 3".

Thoughts?

-Wayne

Jim McGinnis

unread,
Apr 26, 2020, 3:05:01 PM4/26/20
to retro-comp
You are right. The banners could be easily modified to be more helpful.
I think that is a great idea.

Jim

Wayne Warthen

unread,
Apr 26, 2020, 4:37:59 PM4/26/20
to retro-comp
On Sunday, April 26, 2020 at 12:05:01 PM UTC-7, Jim McGinnis wrote:
You are right. The banners could be easily modified to be more helpful. 

Yeah, it was trivial now that I have a working build environment!  In cpxvdu.asm, I changed this:

IF gener or cpm3
sysver: db 'Generic CP/M-80$'
ENDIF;gener or cpm3

to this:

IF gener
sysver: db 'Generic CP/M-80 v2.2$'
ENDIF;gener

IF cpm3
sysver: db 'Generic CP/M-80 v3$'
ENDIF;cpm3

I'll be checking in the modified .com files shortly.

Thanks!

Wayne
Reply all
Reply to author
Forward
0 new messages