• Please review our updated Terms and Rules here

Model II Serial Port Programming

pski

Moderator
Staff member
Joined
Nov 26, 2014
Messages
1,886
Location
New York
I've been spending quite some time learning how to program the Z80 SIO and CTC on the Model II for serial port transfers in TRS-Box. Thanks to quite a bit of help from @lowen, I have it working very well at 9600 baud and below...which I will say is pretty awesome. However, when I kick it up to 19.2K baud it just craps out and won't send out any characters. I know it's not a limitation with TRS-Box because I can do 19.2K all day on the MI, III and 4.

For those who have programmed these machines in the past...before I spend too much time trying to figure out the issue...is 19.2K baud achievable on the MII?
 
I've been reading through some MII/16 documentation. All the manuals, such as TRSDOS, TRSXENIX, Multiterminal Interface, etc., only mention up to 9600 baud as the max whenever they refer to the serial ports. I am going to take this evidence along with my concrete experience and state that 9600 baud may really be the best that can be achieved with the MII architecture. Surely, a weak point of my favorite computer. According to this post by Frank Durda, the culprit may be the CTC which is used inappropriately as the baud rate generator for the SIO. He does mention 19.2k as a theoretical possiblity, but I have not seen any evidence of this.
 
Frank was the real expert on the Z80 side of the 16/6000 systems due to maintaining the z80ctl I/O supervisor. I read that post, and given the way the baud rates were generated, yes, I could see problems, especially if the CTC clock isn't precise.
 
This is interesting. I had problems getting hardware handshaking to work on the Model II and gave up for the time being. Albeit in CP/M.. but the issue was dropped characters when the machine wrote the buffer to disk, where it was (wasn't?) asserting CTS false to temporarily stop the sender transmitting data. Not to off topic, but did you succeed in getting H/W handshake going, Pete?
 
JonB, is it possible your machine has the bi-sync modification? I think that messed with the handshaking.

***SHUDDER*** the BiSync mod...
I started my business life using a Model 16 (the A style) with the BiSync running TRS-DOS (4.2?) and some custom software to transfer hundreds of disks from an IBM System 6/450. For that, I think 4800 was the max supported by this configuration. Used an Avante protocol converter to do some handshaking/conversion. Took me months to get the data all sent over. I think I still have a box of the system 6 disks somewhere.

The II series did not have the best serial I/0.
 
@JonB, there is an option on the SIO Write Register 3 called "Auto Enables" that enables some of the handshaking lines, CTS and DCD. Have you tried turning this on? It did not work with the ATC-1000 serial-IP converter so I leave it turned off. You do need to be programming directly to the SIO to get access to this feature.

https://github.com/pski/model2archive/blob/master/Hardware/Zilog_Z80_SIO_Specification.pdf

Tech Bulletin II:17 covers the Bi-Sync mod if you want to find out if you have that.

https://github.com/pski/model2archive/blob/master/Hardware/Model_II_Technical_Bulletins.pdf
 
Thanks Pete!

Doesn't look like the dreaded BiSynch mod is present here, but the SIO jumpers look a bit odd. They are as follows (warning, ASCII art ahead):

Code:
       . . . . .
             | 
      _. ._. .

 _____________________________
|                             |
|   U18 Z80A SIO             (
|_____________________________|

The bars are connections, the dots are pins as shown in the bulletin.
 
Better still, a close up..

IMG_1463.jpg

..which is upside down relative to my ASCII diagram.

Worse, I can see that some proper fixes aren't applied (like the FDC bulletin II:4)..
 
BTW, I just released a new version of TRS-Box Serial for the Model II. The MII version allows you to choose between the A and B serial ports to connect your serial-IP converter. Also the baud is limited to 9600 in the MII version for reasons we discussed in this thread. It's a easy way to get files in and out of your Model II with LS-DOS 6.

http://pski.net/trs-box/
 
Well here's a pretty pickle and no mistake.

I just got Kermit working with the Lifeboat CP/M custom code (CPSKER.HEX + CPVTLB.HEX). I had to chop the CPSKER.HEX file down into six chunks so PIP would be able to read them without filling its buffer (as it writes to disk and loses characters with no handshaking). Then I recombined the six files using pip, and followed the instructions to create a KERMIT.COM using DDT and the (now) two files.

Delighted to say, it seems to be working.

But there's more....

As a test, I transferred MBASIC.COM using kermit at 1200 baud. During transfer, it accessed the floppy drive three times, but MBASIC.COM got across fine and seems to be working. My serial port has no handshaking lines, yet it succeeded in transferring the file with disk accesses along the way. Is it using XOFF/XON to tell the host to pause while it writes?

Pete, how about a version of TRS-Box Serial for CP/M? ;)


[Edit: Just tested at 9600 baud. Some retries but working. Failed to transfer a big CPMUG archive file, but I can live without it for now (will try again with a reduced speed anyway). But it's all good!]
 
Last edited:
Back
Top