Serial hookup questions

516 views
Skip to first unread message

Warren Hardy

unread,
Jun 24, 2019, 12:21:52 PM6/24/19
to [PiDP-11]
I will apologize in advance, understanding technically terms is not easy for me following a head injury.

Can I use a usb to db9 cable from the pipdp to another pc?
Do I need a null modem adapter to flip tp/rx
What is the standard board rate? 9800 8N1 ?

Usb on the pipdp and db9 on the pc (old pc running Linux).

Digby R.S. Tarvin

unread,
Jun 24, 2019, 1:07:17 PM6/24/19
to Warren Hardy, [PiDP-11]
On Mon, 24 Jun 2019 at 17:21, Warren Hardy <hellfi...@gmail.com> wrote:
I will apologize in advance, understanding technically terms is not easy for me following a head injury.

Can I use a usb to db9 cable from the pipdp to another pc?
 Almost certainly yes, unless there is something very strange about the PC you are connecting to..

Do I need a null modem adapter to flip tp/rx
Depends on the PC and the USB to serial cable. Most USB to serial cables follows the gender and pin assignments of the original build in serial on PCs, so that anything that can plug into a PC can also plug into the connector on the serial cable. In that case, you probably need null modem and gender changer.  But there are exceptions, so check your documentation or use trial and error...

What is the standard board rate? 9800 8N1 ?

That is normally determined by the software talking to the serial interface. If you plan to log in to the raspberry pi, you will need to configure an agetty login, which includes nominating a speed. Sometimes it will automatically detect and adapt to the speed of the remote host, in which case it is Putty/kermit etc which will determine the speed. Same applies in reverse if you plan to use the serial interface to log in to the old PC from the RPi.. There will be a default speed which you can determine with 'stty </dev/ttyxx', but you normally want to set it explicitly.
9600, 19200 and 38400 are commonly used speeds that are widely supported.
 
Usb on the pipdp and db9 on the pc (old pc running Linux).

--
You received this message because you are subscribed to the Google Groups "[PiDP-11]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pidp-11/71924ee4-8c31-4f87-a061-f8cbad740dec%40googlegroups.com.

Warren Hardy

unread,
Jun 24, 2019, 1:41:19 PM6/24/19
to [PiDP-11]
My pc is an old 486 Decpc. Very standard pc configuration for its day. The com ports are /dev/ttyS0 and /dev/ttyS1.

On the pi side do I need to configure simh to recognize the usb serial, or is simh set up default on the raspberry pi to configure the usb as consoles? I am running BSD 2.11, as my Pidp-11 OS.

Digby R.S. Tarvin

unread,
Jun 24, 2019, 3:30:19 PM6/24/19
to Warren Hardy, [PiDP-11]
Ah, you want simh to be the software that controls the serial line, associating it with one of the emulated PDP11  serial devices. That is quite a different question.

I think you would need to consult the pdp11_doc.pdf document and read the description of the emulated terminal multiplexer or serial interface that you wish to use. If it isn't currently catered for, then you would probably need to get the source and make an appropriate modification. It is something I plan to look at at some point. but I havn't done so yet. I have been through the exercise on the dtcyber emulator, updating both terminal and tape driver emulations to support being associated with a physical serial and SCSI tape devices on the host. It wasn't too hard.

In any case, I would first just connect your old PC as a terminal on the raspberry pi system - so that you can verify that all the hardware is working properly. Then moving it from a Raspian terminal to a PDP11 terminal connection is just a software problem.

With any luck, someone else who has already done this with PDP11 on simh will chime in and give a more definitive answer. Otherwise you will either need to do some hacking yourself, or wait for me to get around to it :)

Regards,
Digby


On Mon, 24 Jun 2019 at 18:41, Warren Hardy <hellfi...@gmail.com> wrote:
My pc is an old 486 Decpc. Very standard pc configuration for its day. The com ports are /dev/ttyS0  and /dev/ttyS1.

On the pi side do I need to configure simh to recognize the usb serial, or is simh set up default on the raspberry pi to configure the usb as consoles?  I am running BSD 2.11, as my Pidp-11 OS.

--
You received this message because you are subscribed to the Google Groups "[PiDP-11]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.

Warren Hardy

unread,
Jun 24, 2019, 4:25:46 PM6/24/19
to [PiDP-11]
Thanks for offing help. I am a fish out of water, most of my hacking comes from google and trying what I find. Sometimes it works well, other times I have destroyed things.

Richard Stofer

unread,
Jun 24, 2019, 8:08:23 PM6/24/19
to [PiDP-11]
It is so easy to open a TCP connection to the PiDP11 that serial ports seem redundant.  I haven't tried it but you can do:

> apropos socket

This will get you a list of the Berkeley Socket functions that you can call from inside a C program.   Google for 'Berkeley sockets programming in c'

You can create a TCP client on the PC in either Windows (search Windows Sockets) or Linux (again, Berkeley Sockets).  It's easier with Linux.

Hint:  I NEVER trust Tx or Rx markings because I am never sure which side of the connector they are talking about.  One side's Tx is another side's Rx.  So, I write code to send <something> out of the port and put a scope on the connector to see which pin is actually transmitting.  I do the same for the other end of the conversation.  Once I know which pins are talking, I can figure out whether a Null Modem is required.  A DMM might work as well but I haven't tried it.

BTW, if I use a TCP connection, I don't need to create ports in simh, I don't have to configure devices in BSD and I don't have to tear my hair out getting it to work.  The protocol doesn't have to be Telnet and it probably won't be. It won't be any particular protocol, it's just a socket.  Sort of like plugging wires into a socket.  Once connected, communications can be <whatever>.


Richard Stofer

unread,
Jun 24, 2019, 9:10:22 PM6/24/19
to [PiDP-11]

For giggles, I took some code from the Internet, edited to deal with K&R C on the BSD box (server) and fixed up includes for the Linux box (client)

It actually works!  Files for client and server are attached.

On the BSD box enter the commands
cc -o server server.c   <=== build the server code
server 4000                 <=== open port 4000 on the server.  It will only live for one transaction - this will need to be changed

On the Linux box enter the commands
gcc -o client client.c
client <IP address of server> <port number>  <=== in my case the BSD box is 192.168,1,129 so the command is

client 192.168.1.129 4000

Pretty simple!  Way easier than trying to create serial ports.  And faster (if the transactions are in sentences rather  than characters)...

 
client.c
server.c

Warren Hardy

unread,
Jun 24, 2019, 9:21:06 PM6/24/19
to [PiDP-11]
The Minicom on my pc works, I used the FTDI cable into my Ubuntu pc, comes up as /dev/ttyUSB0. On the 486 I connect the db9 end via a null modem, and using /dev/ttyS0 I can type back and forth with Minicom running on both devices. Just not having any luck on the pi.

Warren Hardy

unread,
Jun 24, 2019, 9:47:38 PM6/24/19
to [PiDP-11]
I can Minicom from Raspbian on my PiDP-11 to my 486, that works fine. So I know the systems can connect via serial. How do I get simh to console now on /dev/ttyS0

Digby R.S. Tarvin

unread,
Jun 24, 2019, 11:12:22 PM6/24/19
to Warren Hardy, [PiDP-11]
If the old PC that you wish to connect to your PiDP11 has TCP/IP networking, and is on the same network as the PiDP11, then I agree that is an easier way to employ the old PC as a Unix terminal.  That is what I had been doing initially - in my case I just had putty installed both on the Raspbian system running the PiDP using the DZ interface (port 4000) and for remote connections using telnet.

On the other hand, if your old PC is more basic and either doesn't have a network interface, or is running an OS which does not support TCP/IP, then the serial option that was first asked about is still reasonable. 

Anyway, I did some experimenting, and happily the simh software in the PiDP distribution does support assigning DZ lines (ie emulated PDP11 terminal multiplexer hardware) to physical serial interfaces on the hosting Raspien.  My USB serial adapter showed up (unsurprisingly) in the Raspian system as /dev/ttyUSB0, and I used putty to verify that I could talk to it. So that
I could experiment without logging in as root, I gave myself ownership of the serial interface:
# chown digbyt /dev/ttyUSB0
Once I was happy that the USB serial interface was talking correctly to my remote serial hardware (I used a real VT320 terminal), I updated the simh config file at /opt/pidp11/systems/211bsd/boot.ini as follows:
                ; set one DZ11 8 line async mux
                ; accessible via telnet to 127.0.0.1:4000...4007
                set dz enabled
                set dz lines=8
                ;set dz 7b
                ;attach -am dz 4000
                attach dz 4000
                attach dz -V line=1,connect=/dev/ttyUSB0
                ;digbyt
                set dz 8b

and restarted the simh. From the host system I interrogated the serial interface to determine how the BSD/SIMH combination had configured it:
digbyt@PiDP11:~ $ stty </dev/ttyUSB0
speed 9600 baud; line = 0;
min = 1; time = 0;
-brkint -icrnl -imaxbel
-opost -onlcr
-isig -icanon -iexten -echo -echoe -echok
Then I updated the terminal settings accordingly - 9600, 7 bits, even parity, 1 stop bit.
The result is as shown below:

IMG_20190625_032400.jpg
IMG_20190625_033349.jpg

Regards,
DigbyT


On Tue, 25 Jun 2019 at 02:47, Warren Hardy <hellfi...@gmail.com> wrote:
I can Minicom from Raspbian on my PiDP-11 to my 486, that works fine. So I know the systems can connect via serial. How do I get simh to console now on /dev/ttyS0

--
You received this message because you are subscribed to the Google Groups "[PiDP-11]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.

Warren Hardy

unread,
Jun 25, 2019, 12:43:06 AM6/25/19
to [PiDP-11]
That took me a step closer. It now displays "Connected to the PDP-11 simulator DZ device, line 1”

Then nothing follows any idea?

Warren Hardy

unread,
Jun 25, 2019, 1:03:35 AM6/25/19
to [PiDP-11]
More progress, the the connect to sim statement, nothing until I remote login via ssh and start bsd 2.11. The the login prompt appears. The first part is running 9600 8 n 1, when the login appears I need to change to 9600 7 e 1.

The 486 is a DECpc LPx dx33. With a real dec keyboard and mouse. The graphics card and mother board are both dec made. I added cdrom so i could install Linux 1.2.13, the system currently only has 8mb ram.

Richard Stofer

unread,
Jun 25, 2019, 1:09:35 AM6/25/19
to [PiDP-11]


DigbyT, I like your MOTD (just guessing)!  Nice work...


One of the reasons I was thinking about client/server is to find an answer to the inevitable question:  "What are you going to do with it?".  It's actually an interesting question.

Do I write some code on the PiDP11 side to drive some downstream device - maybe some kind of IoT thing?  It turns out that the mbed LPC1768 board can have full networking by just building a daughter card to hold the MagJack.  Adding client sockets is dead simple because I have already done a similar application where I wanted the 1768 to make a connection with my LaserJet and do some plotting.


When I think about external connections from the PiDP11, I don't think about I2C or serial.  Networking is dead simple!
 

Digby R.S. Tarvin

unread,
Jun 25, 2019, 7:30:47 AM6/25/19
to Richard Stofer, [PiDP-11]
I can't claim credit for the motd display - I stumbled across welcome(1) in /usr/local in the BSD 2.11 system I am running, and just added it to my .login. The man page indicates that it is 1988 vintage. My usage isn't just aesthetic - it is a good test that my character encoding is good. For example, when connecting with PuTTY, if you forget to change 'window/translation/Remote character set' from UTF-8 to something like DEC-MCS, the line drawing characters don't display properly..

As for the 'what are you going to do with it' question, I have a raspberry pi connected to my router as my 24/7 server which manages my OpenVPN server, ssh server, DHCP, httpd, mail, dns, file server...  a capable but visually boring black box next to my router.

I am toying with the idea of replacing it with my PiDP11. Obviously some things like sshd and the OpenVPN server will have to sit on the Raspberry pi side, but I could probably move some services to the 70, and in any case it would be nice to have the visual indication that my server is still up and running. I also have an emonpi to manage and log my solar panels/batteries and other environmental information. 

Another idea is that I have a decwriter III to resurrect at some point. Connecting my PiDP11 to that would seem very appropriate, and the BSD system could run a network LPD service to make the decwriter available to other hosts on my network. The appeal of this is that it fits nicely with my CDC Cyber emulation - PDP11's were a popular choice of peripheral to serve in Cyber batch stations, for terminal servers, print servers, etc.

Regards,
DigbyT

--
You received this message because you are subscribed to the Google Groups "[PiDP-11]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.

Digby R.S. Tarvin

unread,
Jun 25, 2019, 7:58:06 AM6/25/19
to Warren Hardy, [PiDP-11]
Ah, thats a co-incidence - sounds similar to mine:

IMG_20190625_123733.jpg
IMG_20190625_123848.jpg
Thats my old BSD/OS server (486dx) and backup spre (486sx). It ran 24/7 from about 1990 till the raspberry pi took over from it about 3 years ago. I had expanded the memory on the main machine to the maximum 64MB, used SCSI to connect external disks/tape drives/scanner, a NCD HMXpro XTerminal as main user interface, a VT420 on the serial and HP laserjet on the parallel interface. And I used an ISA parallel interface for 16 'front panel' LED lights. . No addition graphics card - as I used the XTerm, the keyboard/screen was just the console and the VGA on the motherboard was adequate. Like the PiDP11, a surprisingly usable Unix machine - except when you tried to run a web browser or public key crypto like the ssh server.

Anyway, that should certainly be adequate to serve as a PiDP11 terminal.

DigbyT

On Tue, 25 Jun 2019 at 06:03, Warren Hardy <hellfi...@gmail.com> wrote:
More progress, the the connect to sim statement, nothing until I remote login via ssh and start bsd 2.11. The the login prompt appears. The first part is running 9600 8 n 1, when the login appears I need to change to 9600 7 e 1.

The 486 is a DECpc LPx dx33. With a real dec keyboard and mouse. The graphics card and mother board are both dec made. I added cdrom so i could install Linux 1.2.13, the system currently only has 8mb ram.

--
You received this message because you are subscribed to the Google Groups "[PiDP-11]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.

Traci Collins

unread,
Jun 25, 2019, 8:50:21 AM6/25/19
to Digby R.S. Tarvin, Warren Hardy, [PiDP-11]
You want more than a USB to DB9 cable, you want a USB serial adaptor which will look like just a cable but which actually has electronics built into it so it can present itself as a serial device to your PC. These adaptors aren't expensive and will save you lots of grief. A null modem cable prevents hardware handshaking between your PC and your PiDP11. Hardware handshaking prevents the loss of data even at high data transfer rates. Data transfer rates and baud are only synonyms at 300 baud. Any rate higher than that encodes multiple bits into a single baud. Hardware handshaking is actually quite simple but even service techs get it wrong, hence the popularity of null modem cables. At a speed where you can read the stream as it comes in you are probably okay because even speed readers can't keep up with anything other than the slowest speeds but if you ever want to connect a higher speed device to that port you will want the hardware handshaking. Better to support it from the beginning and save yourself trouble down the road. It makes me angry when I see someone has setup a terminal with a three wire serial cable. It is just ignorance on the part of technicians and IT directors that should not be ignorant.

Tom Lake

unread,
Jun 25, 2019, 12:20:32 PM6/25/19
to [PiDP-11]

Not all systems support hardware handshaking. It does no good to completely wire a cable if the computer you're connecting to doesn't support it. I have an 8-port USB-RS-232 adapter that I use with RSTS/E 10.1 on my PiDP-11 and it doesn't support hardware handshaking. The terminals work just fine. Four are Teletype ASR 33s @ 110 baud and four are VT-320s @ 9600 baud. Why introduce more complexity than necessary for your particular requirements?


Tom L

Johnny Billquist

unread,
Jun 25, 2019, 5:02:44 PM6/25/19
to pid...@googlegroups.com
On 2019-06-25 14:50, Traci Collins wrote:
> You want more than a USB to DB9 cable, you want a USB serial adaptor
> which will look like just a cable but which actually has electronics
> built into it so it can present itself as a serial device to your PC.

If it don't have that, it will be a useless collection of cables that
will burn your USB port. I doubt anyone ever put such a cable together.

Something with a USB connector on one side, and a DE9 on the other, has
got to have a USB to serial converter inside. Otherwise it just don't
make any sense.

> These adaptors aren't expensive and will save you lots of grief. A null
> modem cable prevents hardware handshaking between your PC and your
> PiDP11. Hardware handshaking prevents the loss of data even at high data
> transfer rates. Data transfer rates and baud are only synonyms at 300
> baud. Any rate higher than that encodes multiple bits into a single
> baud.

Nonsense.
First of all, a null modem cable can consist of more than three wires.
There is no standard for what defines a null modem cable.

Second, hardware flow control is actually a pretty modern perversion of
the modem signalling lines of RS-232. They were never intended for flow
control from the start, and DEC was very good at actually following the
standard, so using the modem signalling lines for flow control to DEC
equipment does generally not work at all.

Third, DEC usually did inband flow control, using XON/XOFF, which works
just fine with just three wires.

Fourth, if we assume, by "data transfer rate" the simple counting of
bits per second, then transfer rate and baud might, or might not be
equivalent, but it definitely is not tied to something at 300 baud.

Finally, baudrate, or bauds, are about symbols per second (or symbol
changes per second). How much one symbol means depends on a lot of
things. If we talk about analog modems over phone lines, then they never
went above around 3500 baud. This has to do with the fact that telephone
lines sample at 8 KHz. Furthermore, telephone lines encode voice with an
8-bit encoding, so the theoretical max would have been 64 Kbit/s (8 KHz
* 8 bits), but of course, too low frequencies are filtered out, and the
encoding is not perfect. In reality, modems managed around 57 Kbit/s
through compression and lots of clever attempts at coding, but still
doing about 3500 baud, since the sample theorem essentially tells us we
cannot get above 4000 baud and be able to recreate the signal at the
receiving end.

But that is all about analog modems on telephone lines. If we talk about
an RS-232 serial line, then each symbol is always just one bit, and baud
and bits per second are always equivalent, no matter what speed you are
running at.

You can possibly talk about a difference between baud and bits per
second, if we apply a compression on the serial line, and look at the
data rate with compression applied. Baud rate would still be the same,
but you would possibly have managed to raise the bits per second number.

> Hardware handshaking is actually quite simple but even service
> techs get it wrong, hence the popularity of null modem cables. At a
> speed where you can read the stream as it comes in you are probably okay
> because even speed readers can't keep up with anything other than the
> slowest speeds but if you ever want to connect a higher speed device to
> that port you will want the hardware handshaking. Better to support it
> from the beginning and save yourself trouble down the road. It makes me
> angry when I see someone has setup a terminal with a three wire serial
> cable. It is just ignorance on the part of technicians and IT directors
> that should not be ignorant.

I understand the comment about sometimes getting angry at people who
don't get it. Everything about serial ports and serial communication is
actually simple.

And now repeat after me: flow control does not require modem signals.
Hardware handshaking is not the only way to achieve flow control. Three
wires can be enough. It all depends on more factors than just the number
of wires. Null modem cables can include modem signals. Baud and bits per
second are equivalent on a serial port. You cannot connect a USB
connector, which uses 0 and 5V to an RS-232 connector, which uses
-3..-24V and +3..+24V for the logic levels.

Johnny

> On Tue, Jun 25, 2019 at 5:58 AM Digby R.S. Tarvin <digb...@gmail.com
> <mailto:digb...@gmail.com>> wrote:
>
> Ah, thats a co-incidence - sounds similar to mine:
>
> IMG_20190625_123733.jpg
> <mailto:pidp-11%2Bunsu...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pidp-11/5f989b6f-cea3-46c8-b502-997cfdbf4031%40googlegroups.com.
>
> --
> You received this message because you are subscribed to the Google
> Groups "[PiDP-11]" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to pidp-11+u...@googlegroups.com
> <mailto:pidp-11+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pidp-11/CACo5X5jpLmkQ01z%2BOWSexY-EQeSOX5Ej4hiO_qPGQy00CzVO1Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/pidp-11/CACo5X5jpLmkQ01z%2BOWSexY-EQeSOX5Ej4hiO_qPGQy00CzVO1Q%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "[PiDP-11]" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pidp-11+u...@googlegroups.com
> <mailto:pidp-11+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pidp-11/CADfeAF%3D9RrMHOKez4e2qQX2aUCuLL%2BKa_LnRvz7vWu7LWurgPQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/pidp-11/CADfeAF%3D9RrMHOKez4e2qQX2aUCuLL%2BKa_LnRvz7vWu7LWurgPQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.


--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: b...@softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol
Reply all
Reply to author
Forward
0 new messages