Interfacing with a PDP-11/05

This article describes how to interface a PDP-11/05 over serial line to a modern PC.

While this is normally the easiest thing of the world on a later PDP-11 (connect PDP-11 and PC with nullmodem cable, choose right baudrate, power ON), on the '05 it took me many (hobbyist-) weeks to get it right.

Interfacing with a PDP-11/05: Serial console monitor

Parent Category: How-to's Category: Interfacing with a PDP-11/05
Written by Administrator

Installing a console monitor program

Now that the PDP-11/05 is equipped with a serial console port, you soon will get tired of watching "Hello world!".

To be really useful, it would be nice to have a monitor program installed. Such a monitor would allow you to read and write memory, start programs, and boot from devices ... over a text terminal.

 The M9312 bootstrap terminator

Well here it is. In the PDP-11/34 the "M9312" card is installed. This is an UNIBUS terminator that also carries 5 ROM chips. One ROMs contains monitor software, the other four contain bootloaders for various devices. "M9312" is the archetypic boot ROM card, so google for "DEC M9312" to learn more.

M9312 has also logic to detect when the CPU performs its first memory access after Power-On. In this case, the card manipulates the UNIBUS memory cycles so the processor begins executing ROM code. In effect, the monitor (or a certain bootloader) starts automatically every time the the PDP-11 is booted.

The M9312 was designed 1978, while the '05 is 1972. Despite being made for a different generation of  PDP-11's, the M9312 runs also in the PDP-11/05 (Thanks to Thomas Hoeffken for detecting this!)

In other words: A PDP-11 is a PDP-11 is a PDP-11!

Plugging in

So all you have to to is to replace one of these passive UNIBUS terminators

unibus terminator

 with the M9312 card:

m9312

M9312 has many switches and zero-Ohm jumpers, set them as on the picture. See the attached doc for more, but reserve some time for reading ...

You see the four Boot ROM sockets on the left side in the upper half, they have 16 pins. The console monitor is located in the larger 18-pin socket in the middle of the board. Be aware: there are different monitor ROMs for 11/34 and 11/60&70, use the 11/34 one.

And there must be at least one boot loader ROM in socket "ROM 1", even if no device is attached.

Finally the 11/05 could look like this:

terminators in pdp1105

 

The 11/34 serial console emulator

So now after powering on, the PDP-11/05 executes the monitor program and its "@" should appear:

console emulator prompt

If the auto-start does not working, you can execute the monitor manually by loading address 165020 and toggle START.

DEC calls the 11/34 monitor a "serial console emulator", because it very close simulates the work with the console panel switches.

For example:

  • "L <value>"  sets the current address as the "LOAD ADDR" switch does,
  • "E<space>" does an EXAMINE, like toggling the EXAM switch
  • "D <value>" does "DEPOSIT", and so on.

From today's view, this makes work unnecessary complicated. See chapter 3 in the attached M9312 documentation.

 

Attachments:
Download this file (M9312 bootstrap-terminator module technical manual (Mar 1981, EK-M9312-TM-0~.pdf)M9312 bootstrap-terminator module technical manual (Mar 1981, EK-M9312-TM-0~.pdf[DEC M9312 bootstrap terminator documenation]3500 kB

Interfacing with a PDP-11/05: About baudrates

Parent Category: How-to's Category: Interfacing with a PDP-11/05
Written by Administrator

Well, if you do not have an external baudrate generator, there are some bad news: selecting the baudrate is not very comfortable. Apparently it was not a normal operation, but at least you don't need to solder ...

The internal baudrate generator:

On M7260 data path is a primary clock signal for the baudrates, called "TTY CLK H".
It's frequency is controlled by operating a potentiometer.
This clock is divided by 5-stage binary counter in the ratios 1:1 down to 1:16.
A rotary switch with 5 positions is used to select one of the scaled baudrates (the switch has actually 10 positions, only positions 1-5 are used).

See the baudrate logic on the M7260 datapath board:

pdp1105-datapath baudrate Switch and potentiometer

The round flying-saucer-like component with the many legs is the rotary switch. He is hard to turn, so he's quite damaged (not by me, what do you think?)

The final clock is fed into the UART chip, it must be 16 times the desired baudrate.

These are the TTY CLK frequencies and switch settings for several baudrates:

Switch position baudrate
range 1
baudrate
range 2
1 2400 strange
2 1200 strange
3 600 strange
4 300 strange
5 150 110
     
TTY CLK 38400 Hz 28160 Hz
TTY CLK period 26 µs 35.5 µs

 

You see: you have to decide early wether you want to drive a 110 baud TTY, or a terminal with baudrates 300 to 2400.

Procedures to set the internal baud rate:

If you just want to change between 300, 600, 1200 or 2400 baud, simply pull the M7260 out of the case, set the rotary switch and push the M7260 datapath module back into the backplane.

Switching between 110 baud and the other baud rates is really hard. There are five possible procedures:

  1. You can put an oscilloscope probe onto a certain wire-wrap pin on the PDP-11/05 backplane. The pin hast the coordinates E02D2. You turn the potentiometer until the scope shows the right period of TTY CLK. This is the way DEC wants it. At least you can operate the potentiometer from the outside on a running M7260 datapath module.
    Required tool: an oscilloscope, good nerves.
  2. You can put the M7260 datapath onto a hex extender card and let it run outside the BA11 case. Then you hold the oscilloscope probe onto pin 17 or pin 40 of the big white UART chip, there they feed the baud rate clock in.
    Required tools: an oscilloscope, a hex extender board.
  3. Same as #2, but use a wire (soldered to the UART ) to get TTY CLK out of the running machine.
    Required tools: an oscilloscope, a wire, the will to tamper with historical equipment.
  4. You set the rotary switch at first. Then you toggle in a program which permanently writes a data byte with many 0/1 transitions, for example an ASCII "U", which is hex 0x55. Start the program, connect the oscilloscope to the "TxD" pin of the RS232 and watch the data. The smallest period is one bit, calibrate it's width according to the desired baudrate.
    Required tools: an oscilloscope, a test program, blinken light skill, a working PDP-11/05.
  5. Similar as #4: You set the  rotary switch at first. Toggle in a program which permanently writes a data byte to the serial port. Connect  a PC with terminal emulator and watch the display, while trimming the potentiometer.  When the connected PC begins to display the data, rotate the potentiometer further until the data gets distorted again. Then rotate back to the middle of the receiver range to get a stable baudrate.
    Required tools: No oscilloscope, a  terminal or a connected PC, a test program, blinkenlight skill, a working PDP-11/05.

I found procedure #1 too hard (you have to dismount the PDP-11/05 for this, and must locate the "E02D2" pin in the big pin array on the backplane). I was succesful with #2, so I did not tried #3. Procedure  #4 worked too, but had too much error sources (you must be able to operate the 11/05 through the console). Procedure #5 has still more error sources, I was not feeling like trying it.

 

Higher baudrates?

2400 baud is not too fast, but higher baudrates are not possible with the internal baudrate generator.

  • First I played with the the trimmer, but it's range does not allow to go to the next higher 4800 baud.
  • Then I changed one resistor value to get a greater trimming range. I could reach 4800, but then the oscillator reached his limit. 

That's why I build my own generator! Now the '05 runs fine even at 38400 baud.

Slow baudrates

I normally use USB-to-RS232 converters on my PC, typical with FTDI chips.  I have several of them.


usb to rs232


But despite their data sheets emphasize the capability to handle astronomical baudrates (e.g. "up to 1MBaud"), they failed for me at the low end, for 110 baud.
Better use the physical COM port on your mainboard ... if you still have one. Or buy a PCI extender card with some truly 16550 compatible COM ports on it.

Interfacing with a PDP-11/05: Test programs and "Hello, world!"

Parent Category: How-to's Category: Interfacing with a PDP-11/05
Written by Administrator

The serial interface from a programmer's view

The PDP-11/05 has a serial interface compatible with the KL11/DL11 standard.

Here is one excellent additional documentation about a DL11 card.

And this is the register interface in the UNIBUS I/O page, as described in the PDP-11/20 documentation. At 1972, the nomenclature is very paper-tape orientated. Simply translate "Reader" as "Receiver" and "Punch" as "Transmitter".

Register name

Address

Register bits

15-12

11

10

9

8

7

6

5

4

3

2

1

0

TKS = Reader status register

177560

 

RCVR BUSY

 

 

 

RCVR DONE

RCVR INT ENB

 

 

 

 

 

RDR ENB

TKB = Reader buffer register

177562

 

 

 

 

 

RECEIVED DATA BITS

TPS = Punch status register

177564

 

 

 

 

 

XMT RDY

XMIT INT ENB

 

 

 

MAINT

 

 

TPB = Punch buffer register

177566

 

 

 

 

 

TRANSMITTER DATA BUFFER

Name of bits/datafields:

Name of bit field

Function

r/w

RCVR BUSY

1 between the start and the stop bit of an incoming character

read-only

RCVR DONE

1, if an entire character has been received. Starts interrupt if receiver interrupt enable bit is set.

read-only

RCVR INT ENB

receiver interrupt enable bit

r/w

RECEIVED DATA BITS

these bits contain the character just read

read-only

XMT  RDY

Transmitter ready. Cleared when transmit buffer is loaded, set when transmit buffer can accept another character. Will start interrupt if transmitter interrupt is enabled.

read-only

XMIT INT ENB

Transmitter interrupt enable.

r/w

MAINT

Maintenance. When set, the serial line input is connected internally to the serial line output for loopback tests.

r/w

TRANSMITTER DATA BUFFER

A write will start transmission of a character

write-only

 For interrupts, the vector is 000060 for the Reader part, and 000064 for the Punch part. Priority level is BR4.

Serial protocol parameters?

Well, we talked already about the baudrate ... but what about bit length, parity, stop bits?

On other DL11 boards, these values can be set over jumpers. But on the PDP-11/05, there is no choice. The UART is hard wired to 8bit, no parity, 2 stop bits ... the format of paper tapes.

 

Testprogram #1: "Hello, world"

This programs uses and tests only the transmitter.
You have to toggle it in over the blinkenlight console. In the attachement file "hello.blinkenlight_instruction.txt" you find the detailed word-for-word procedure how to enter this program.
Good news: if you have core memory, you have to do this only once.
Start address is 2000.

       1                                
       2                                        .title  Hello world program
       3                                
       4                                        ; This program prints "Hello, world"
       5                                        ; (or any other string) on the serial console at 177650.
       6                                        ; Then it HALTs.
       7                                        ; On CONT, it repeats.
       8                                
       9                                        .asect
      10                                
      11 177560                                 serial = 177560         ; base addr of DL11
      12                                
      13                                
      14 002000                                 .=2000
      15                                
      16                                start:
      17 002000 012702  177564                  mov     #serial+4,r2    ; r0 points to DL11 transmitter section
      18 002004 012701  002032                  mov     #string,r1      ; r1 points to the current character
      19                                nxtchr:
      20 002010 112100                          movb    (r1)+,r0        ; load xmt char
      21 002012 001405                          beq     done            ; string is terminated with 0
      22                                
      23 002014 110062  000002                  movb    r0,2(r2)        ; write char to transmit buffer
      24 002020 105712                  wait:   tstb    (r2)            ; character transmitted?
      25 002022 100376                          bpl     wait            ; no, loop
      26 002024 000771                          br      nxtchr          ; transmit nxt char of string
      27                                
      28 002026 000000                  done:   halt
      29 002030 000763                          br      start
      30                                
      31                                string:
      32 002032    110     145     154          .ascii  /Hello, world/  ; arbitrary text
         002035    154     157     054  
         002040    040     167     157  
         002043    162     154     144  
      33 002046    012     000                  .byte   12,0            ; LF char, end marker
      34                                
      35                                        .end
      35                              

 

Testprogram #2:

This program echoes back any character typed in. Thus it tests receiver and transmitter.
Start address is 1000, so it can coexist with the "Hello world" program above.

       1                                
       2                                        .title  Console serial port
       3                                
       4                                        ; http://www.psych.usyd.edu.au/pdp-11/hints.html
       5                                        ; Any DL-11 style serial port (including the console) can be simply
       6                                        ; tested by depositing 060 (octal) into its 'transmitter buffer ',
       7                                        ; 0777566 in the case of the console. A '0' should appear on the
       8                                        ; console. If it is anything else, check the baud rate settings.
       9                                        ;
      10                                        ; To check the input register, press the '0', then examine the
      11                                        ; receive register 0777562 and it should contain 060.
      12                                        ;
      13                                        ; Needles to say, if you are using any of the Qbus processors,
      14                                        ; or a PDP11/24, /44, /84 or /94 then you need the serial console
      15                                        ; working to do anything.
      16                                        ;
      17                                        ; As simple serial echo test would be:-
      18                                
      19                                        .asect
      20                                
      21 177560                                 kbs = 177560
      22                                
      23                                
      24 001000                                 .=1000
      25                                
      26                                start:
      27 001000 012700  177560                  mov #kbs, r0
      28                                
      29 001004 105710                  wait:   tstb (r0)       ; character received?
      30 001006 100376                          bpl wait        ; no, loop
      31 001010 016060  000002  000006          mov 2(r0),6(r0) ; transmit data
      32                                
      33 001016 000772                          br wait         ; get next character
      34                                
      35                                        ; Note:- PDP11 guru's will notice that I don't test for
      36                                        ; transmitter ready, as there is little point given that you
      37                                        ; cannot type fast enough for it to overrun!
      37                              
Attachments:
Download this file (consoleserialport.blinkenlight_instructions.txt)consoleserialport.blinkenlight_instructions.txt[Detailed instructions how to toggle in the "echo" program]9 kB
Download this file (hello.blinkenlight_instructions.txt)hello.blinkenlight_instructions.txt[How to toggle in the "hello world" program]15 kB

Interfacing with a PDP-11/05: Becoming RS232

Parent Category: How-to's Category: Interfacing with a PDP-11/05
Written by Administrator

 

Using which SCL signals?

After sorting out the serial wires mechanically, (see previous page), it is now time to care about voltage levels and polarity.

Electrically, the SCL connector on the PDP-11/05 carries these signals:

  • the 20mA serial signals RCV+,RCV-, XMT+, XMT-.
  • special 20mA signals to control a paper tape reader: READER RUN+, READER RUN-
  • TTL level signals for serial receive and transmit
  • Clock control: you can disable the internal baud rate generator with CLK DISAB and provide an own baudrate clock over the CLKIN TTL signal.
  • GND, -15V and +5V, without any fuses.
  • there are no RS232 signals
  • there are no modem control signals

Warning: Because of the mix of TTL signals and -15V, you can damage a lot if the wrong wires touch.
And remember: The +5V have the full power supply behind it!

A try with the 20mA interface

I first tried to connect a PC with the 11/05 over a industrial RS232-to-20mA converter, but this failed.

A 20mA interface works by one side providing a 20mA current, which drives receiver and transmitter of the closed loops for Transmit and Receive.

But the 20mA interface of the PDP-11/05 is not a proper one: the receiver is more like a low impedance voltage sensor, while the transmitter simply switches voltage at the levels +3.5V to -15 V.  At best you call the PDP-11/05 serial interface a "TTY interface": it is well suited to read data generated by mechanical switches to GND, and driving solenoids for transmit data.

Using TTL signals

Then I decided to use the SERIAL IN/OUT TTL signals over a RS232-to-TTL converter. You can buy these as kit for a few Euro, they are based on the popular MAX232 chip.

pdp1105 sclconnector to rs232 adapter

 

This worked immediately!

A RS232 adapter with baudrate generator

Later I build my own adapter, because I wanted run the PDP-11/05 with higher baudrates than 2400. Here is the schematic:

rs232 schematic

Level converter

In the upper half you see the MAX232 level converter circuit. The MAX232 isolates PC and PDP-11/05 from each other, and converts the TTL levels (0 to +5V) to RS232 levels (+/- 9V) .

You will notice that the RS232 RxD signal goes through one extra inverter (between R1IN and R1OUT ). A look into "PDP-11/05-S,11/10-S systems engineering drawings", sheet "DPH" revealed, that the signal "Serial IN H" is in fact three times inverted, so it should be labled "Serial IN L".

The adapter has a DSUB 9 male connector ("X1") and acts like a RS232 "DTE" (data terminal equipment), just like a PC. Connect it to a terminal or a PC with a null modem cable.

Baudrate generator

The baudrate generator occupies the bottom half  of the schematic. Different baudrates are generated by an ATmega48 microcontroller, which is totally underemployed by this task.  Input is a base frequency of 4.9152 MHz and a ten-position select switch. Output to the PDP-11/05 is the "CLK IN" frequency (baudrate x 16)  and the "CLK DISAB" signal. Only if CLK DIAB is low the '05 runs with  the external baudrate.

If the selector switch is at "0", the PDP-11/05 runs with its internal baudrate. Other positions select 110, 300, 600, 120, 2400, 4800, 9600, 19200 and 38400 baud. The UART is not specified to run faster than 38400, and and even at 19200 baud the '05 processor is limiting the speed in console mode operation.

 

Interfacing with a PDP-11/05: Sorting the wires

Parent Category: How-to's Category: Interfacing with a PDP-11/05
Written by Administrator

Signal routing for the serial interface inside the PDP-11/05 case

As an experienced DEC hobbyist, you will expect a 40 pin BERG connector to plug the standard serial cable KL8E in.

The KL8E cable is used on PDP-8's and 11's as a link between on board logic and 20mA / RS232 interface plugs. It comes in many length and adapter styles, and carries a lot of serial signals.  See two examples:

Intern 1' KL8E cable with
20mA MATE-N-LOCK connector

Extern 5' KL8E cable with
DSUB25 male connector carrying
RS232 and modem signals

kl8e cable nmatelock kl8e cable dsub25

 

So you quickly register that the Datapath M7260 indeed contains a 40 pin BERG connector in the near of the UART.

But don't waste time: this is the interface to the blinkenlight console. There is NO connector for the serial interface, the serial signals are routed over the edge connector of M7260 onto the backplane.

The further signal routing depends on the exact 11/05 model:

  • In the full size PDP-11/05 case, you have to plug a M9970 adapter board into the next backplane slot. This is simply a passive adapter between flip chip slots and an on-board 40 pin BERG connector.
    You plug the KL8E cable into the M9970 then.
  • in the slim size 11/05, theres a plug on the backplane which connects the serial signals to a 40pin BERG on the back side of the BA11 case.

 

 

The SCL connector of the slim PDP-11/05

The 40 pin male BERG connector on the backside is called "SCL connector", "SCL" standing for "Serial Communication Line"

In the "PDP-11/05, 11/10 Computer Manual" (Jan 1973, DEC-11-H05AA-A-D) on bitsavers.org it is barely visible due to contrast problems in the scan.
And on a real machine you would not expect an unsecured BERG connector on the outside of a BA case carrying the serial signals, so here is the location in detail:


The pinout for the SCL connector is documented in manual "DEC-11-H05AA-A-D" in Appendix C "Computer Connectors".

Documentation for the SCL connector is very confusing:

  • a usual, the wires in the 40 pin flat cable are not numbered, but labled with letter combinations from the "DEC alphabet". The DEC alphabet cleverly uses only letters which can not be confused with other ones... there is no "G", "I", "O" or "Q".
  • the SCL connector is mounted up side down, but you have to connect the KL8E cable with its "this side up" label still facing upward. So the KL8E cable has to be plugged in rotated by 180 degrees. The flat cable's red #1 wire must be oriented to the left. On my 11/05, I marked this side with an "A B" label.
  • Decoding the DEC alphabet

I got half crazy until I made this conversion chart between DEC pin labels and flat cable wire numbers ... it should be pinned onto every PDP-11 !

01
A
03
C
05
E
07
H
09
K
11
M
13
P
15
S
17
U
19
W
21
Y
23
AA
25
CC
27
EE
29
HH
31
KK
33
MM
35
PP
37
SS
39
UU
B
02
D
04
F
06
J
08
L
10
N
12
R
14
T
16
V
18
X
20
Z
22
BB
24
DD
26
FF
28
JJ
30
LL
32
NN
34
RR
36
TT
38
VV
40

And since the SCL is mounted up side down, the same again rotated by 180°:

40
VV
38
TT
36
RR
34
NN
32
LL
30
JJ
28
FF
26
DD
24
BB
22
Z
20
X
18
V
16
T
14
R
12
N
10
L
08
J
06
F
04
D
02
B
UU
39
SS
37
PP
35
MM
33
KK
31
HH
29
EE
27
CC
25
AA
23
Y
21
W
19
U
17
S
15
P
13
M
11
K
09
H
07
E
05
C
03
A
01

The big signal conversion table 

So getting from a documented SCL connector pin to a 40 pin flat cable number involves looking up the rotated DEC label of the wire and then converting it to a normal number ... it is a bit like deciphering a cryptographic code.

This is the final translation table. It includes also the connectors of the RS232-to-TTL level converter and the MATE-N-LOCK connector for 20mA TTYs.

Of course you should not trust me: check this table again and again!

PDP-11/05 Signal SCL
connector
KL8E
cable
= M9970
40 pin
flat cable
wire #
 RS232
level converter
TTL side
RS232
DSUB 9
female
20mA
MATE-N-LOCK
-15V BB U  17
SERIAL OUT+ (20mA) V AA  23 5
CLK IN (TTL) T CC  25
SERIAL IN- (20mA) DD S  15 3
READER RUN- (20mA) R EE  27 4
CLK DISAB (TTL) N HH  29
SERIAL OUT- (20mA) L KK  31 2
+5V C TT  38 +5V
SERIAL OUT H (TTL) D SS  37 TX 2 TxD
READER RUN+ (20mA) F PP  35 6
SERIAL IN L (TTL)1,2 RR E  05 RX 3 RxD
20mA Interlock1 NN H  07
SERIAL IN+ (20mA) LL K  09 7
GND A VV  40 GND 5 GND
GND B UU  39
GND UU B  02
GND VV A  01

 1 "20mA Interlock" has to be connected to "SERIAL IN (TTL)" in the cable, if using the 20mA interface.
 2  Inverted, but labled "SER IN H" in the DEC schematics.