Deduced light pen operation and an implementation path, comments please

44 views
Skip to first unread message

Bill E

unread,
Jan 31, 2026, 12:56:42 PM (5 days ago) Jan 31
to [PiDP-1]
If you think this is incorrect, please update. From what I can tell looking at random documentation and hardware descriptions, this is the functionality:

When a dpy is done, the Type 30 hardware (not the pdp-1) checks for a light pen hit at those coordinates. If one was seen, then when the normal completion pulse is sent, another special pulse is sent to indicate the hit.

The dpy must have specified completion pulse wanted, the default case for dpy.
It then at some point does an ioh to wait for completion.

At that time, if there was a 'hit' pulse, which the pidp1 code doesn't support, so just the regular ioc 'pulse' is used, the IO and AC are loaded with the Y and X coordinates of the light pen hit, cks bit 0 is set, and pf3 is set. The cks flag is automatically cleared when the next dpy is issued.

What's still fuzzy:
Is pf3 also automatically cleared?
There has to be some bounding box surrounding the actual display dot where a light pen hit anywhere within it is valid and the diagnostics indicate so, but what is it?

Implementing a real light pen, not just using the mouse, is probably not practical for several reasons with the current simulated display. There is one gpio bit left, so it could be used, but mapping a hit off an lcd panel to the actual coordinates seems very impractical, not even considering the buffering that goes on inside the pidp1 and the P7 display code. It would have to somehow map screen pixel to the time the dot was posted from the pidp1, which would also require some kind of sync with the display refresh itself.

Maybe we need a real hardware Type 30 implementation with a real CRT and the same D/A logic. An old oscilloscope would be the obvious starting point. Even just a little box that had the logic in it and produced an analog X, Y out would suffice, and that's totally practical.If I only never had to sleep.....

Bill

Kevin McGrath

unread,
Jan 31, 2026, 5:28:15 PM (5 days ago) Jan 31
to [PiDP-1]
I watched this YouTube video of Lyle Bickley at the CHM showing off the PDP-1 and towards the end they show a couple light pen examples:

https://youtu.be/1EWQYAfuMYw?si=5F22N2sYFfwn8L0K&t=1227

I believe it had different lenses you could put on to narrow or widen the field of view for the light pen.

I thought how it worked was, once you called dpy and then called cks, the high-bit (bit 0, still getting used to this) of the IO register is set if the light pen witnessed a dot.  You can then use spi to skip around the jump to save the last coordinates as a light pen trigger location.

Were did you find documentation that a program flag got set as well, I don't think it needs one if cks is being called.  It might need a way to change the light pen trigger radius (distance from screen touch point) or something to adjust for those who have small 7 inch screens or the larger Type 30 displays others are using (very jealous, I'm going to have to build me one of those).  Setting a program flag may make it incompatible with non-light pen programs, right?

Can we get a copy of those light pen demo programs from the CHM?

-Kevin.

Bill E

unread,
Jan 31, 2026, 5:50:34 PM (5 days ago) Jan 31
to [PiDP-1]
 
The pf3 setting comes directly from the PDP-1 Handbook:
 
The Light Pen is designed to be used with the CRT Display Type 30. By
"writing" on the face of the CRT, stored or displayed information can be
expanded, deleted or modified. Specifically, each time a light-pulse strikes
the pen, the Light Pen status bit is set to one (see definition of Check Status
Instruction) and Program Flag 3 is set to one. At the time the status bit is set,
the x-y coordinates of the -point just "seen" by the pen are in bits 0 through 9
of the AC and bits 0 through 9 of the 10, respectively (if the Display Instruction
was given with the optional in-out wait). A program designed to accept Light
Pen input would periodically check the Light Pen status bit and when found
to be set, would store the C (AC) and C (10) thereby defining the point just
"seen" by the pen.
 
What is totally unclear is just when the AC and IO get set. The hardware manual says the lightpen hit pulse isn't sent until the completion pulse is sent, which would be 35uses after the dpy IOT, so it can't be the dpy. It can't be the cks, because that returns data in IO. That just leaves the ioh, from my reasoning.

Bill

Unibus

unread,
Jan 31, 2026, 6:15:24 PM (5 days ago) Jan 31
to Bill E, [PiDP-1]
Hi,

My best guess is to use GPIO pins 27 and 28. Dedicate one to double the number of I/O addresses. Admittedly I was looking at expanding the number of indicators on the top panel as shown in the handbook for the Type 120 Sequence Break Panel. Use the other pin for a general interrupt input that includes the light pen flag. Use the SDA/SDL for A/D and D/A interfaces and emulating other IOT devices, etc. Catch is the complete redesign of the circuits.


My understanding is:

 MIT, Technical Report 56

A Study Of The Persistence Charateristics Of Various Cathode Ray Tube Phosphors1

III. Theoretical Considerations And General Information
III-1. Buildup and Decay of Screen Luminescence.

All luminescent materials useful as cathode ray tube phosphor screens emit light after the end of the electronic excitation. Fig 1 schematically illustrates the rise and fall of luminescence. Here it is assumed that the electronic excitation of the screen is constat from time t1 to time t2, off until t3, etc. Then the electrons strike the screen, the luminescence or fluorescence increases rapidly, and follows the buildup curve characteristic of the phosphor. At t2, when the excitation is discontinued, the light output immediately begins to fall, and follows the phosphorescence decay characteristic of the phosphor.

image.png

For a double layer or cascade screen, eg. P7, the picture is changed somewhat. The blue phosphor of the P7 is directly excited by the electron beam, emitting blue light by fluorescence during the excitation, and by phosphorescence after the cessation of excitation in the manner shown in Fig. 1. The first layer is practically opaque to electrons. Thus the second, or yellow layer of the P7 is excited chiefly by the light from the first layer. The excitation of the second layer by the luminescence of the blue phosphor causes a delay of about one microsecond after the end of electronic excitation before the peak light intensity is emitted by the cascade screen.

Then there is the delay for the light pen to detect the light.  If the Light Pen is used and if it has seen a spot during the display period, a pulse similar to the display completed pu Ise wi II be produced. This pu Ise will occur at the same time as the display completed pulse. In addition, a -3 volt level is produced starting at this time and lasting until the next clear pulse is received.

Timing is 2.5 microseconds for address transfer, 35 microseconds for deflection setup, and 10 microseconds for spot intensification

The light pen is an input device which generates a signal (flag) that can be sensed and interpreted by the computer. Light pen interruptions stop the display, leaving the contents of the display registers intact, and signaI the computer that an interruption has occurred. When this happens, the programmer can examine the contents of the display registers to determine the location (on the display) of the point of light that was sensed by the light pen or determine the memory location of the data word specifying that
point. The light pen will detect light in the range 4300 to 5600 angstroms. 

Viewed from the front, the CRT housing is mounted on the left-hand side of the table (See Figure 1-2)" The indicator panel is mounted directly beneath it under the table top. 

The coordinate location (address) information for the displayed spot is determined by the contents of two 10-bit binary words, one for the horizontal coordinate and one for the vertical coordinate. Each word uses the l's complement, in which 1000000000 is -511 or the smallest number, and 0111111111 is the maximum number, +511. The bits are applied as gating levels to the two Buffers. When the Type 30 is controlled by DEC's PDP-1 computer, the two address words are applied in succession by two pairs of memory cycles.
In the next (fifth) memory cycle the computer supplies an IOT instruction which causes the clear and load pulses to be applied to the Coordinate Transfer Circuit, and usually the three intensity level bits to the Status and Intensity Circuit. The load pulse causes the two coordinate words to be transferred into the Buffers and starts the display cycle.
During the first 35 microseconds of the display cycle the output of the Buffers is converted into equivalent analog voltages and applied to separate Deflection Amplifiers through Compensation Networks. At the end of this time the CRT is unblanked for 10 microseconds and a spot of light appears on the screen at the location specified by the two coordinate address words. The intensity of the spot is controlled by the Intensity Bias Circuit.


At the end of the display cycle the Status Circuit generates a negative pulse which is returned to the computer. A second pulse and a negative level will also be generated if a Light Pen has seen the displayed spot.


 Type 370 High Speed, Photomultiplier Light Pen

F-12 PDP-1 Price List, June 1964
The high-speed light pen is a photosensitive device which senses displayed points on the face of the CRT. The Type 370 uses a fiber optic light pipe and photomultiplier system, which gives the pen a response time approximately five times faster than that of a photodiode. If the pen is held in front of a point displayed on the face of the CRT, it transmits a signal which sets the display flag to 1. The Type 370 is equipped with a mechanical shutter which prevents the sensing of unwanted information while positioning the pen. Variable fields of view are obtained by means of a series of interchangeable tips with fixed apertures.

image.png
A.1 INTRODUCTION
The function of the light pen (see Figure A-1) is to detect light pulses appearing on the face of a display oscilloscope. The light pulses are converted into electrical pulses by the light pen circuitry and interpreted by the computer program into coordinate locations on the face of a scope. These locations are then treated in accordance with the computer program.
The shutter for the light pen is located on the pen itself. There are six fixed apertures available, ranging from 0.300 inch to 0.050 inch. The amplitude of the output signal is adjustable; rise and fall times of the output signal are primarily dependent on the rise and decay times of the CRT phosphor.

 A.3 THEORY OF OPERATION

A flexible fiber optic light pipe is combined with a photomultiplier tube to detect points displayed on a cathode ray tube screen. A mechanical shutter in the form of a pen is attached to one end of the light pipe. This shutter prevents unwanted light information from entering the light pipe during pen positioning. To detect displayed points, the pen is positioned and then the shutter is depressed. Light is transmitted through the light pipe to the photo-cathode of the photomultiplier. The amplified signal from the photomultiplier is connected to an emitter follower which acts as an output buffer.

A.3.1 Light Guide

The flexible light guide is constructed of unoriented glass fibers 0.003 inch in diameter. The approximate number of fibers is 1470. The minimum radius of bend is 3/4 inch. For sharper bends, the fibers may be broken. Figure A-2 shows the relative transmission for light of different wave lengths.

A.3.2 Photomultiplier

The photomultiplier operates as follows. Light falling on the light-sensitive photocathode provides sufficient energy to liberate some of the electrons. The freed electrons are attracted towards an electrode with a potential more positive than the photocathode. Each electron striking this secondary electrode (dynode) frees more electrons which are attracted to the next more positive dynode. This process is repeated for a number of stages. The electrons from the final stage are collected at the anode. Drawing D-370-0-2, page A-7, illustrates the circuitry of the photomultiplier (a 931A tube with an S-4 spectral response). Figure A-3 shows the spectral sensitivity characteristics of a phototube exhibiting an S-4 response.

The 100,000-ohm 1-watt resistor in series with the photocathode partially limits the current through the photomultiplier and dynode resistor string.

A.3.3 Overall Spectral Response

The combination of the spectral responses of the photomultiplier and the light pipe is shown in the composite spectral response of Figure A-4. This is the response of the 370 Light Pen.

A.3.4 Output Circuitry

The anode of the photomultiplier is connected to one end of a potentiometer, the other end of whichis grounded. The amplified current collected at the anode passes through the potentiometer to generate a voltage signal which varies in accordance with changes in load resistance. This signal is applied to the input of an emitter follower to provide driving power and a low output impedance. Drawing D-370-0-2 shows some of the logic connections of the 370 Light Pen for operation with some of the DEC displays.

A.4 MAINTENANCE

Because of the simplicity of the light pen, maintenance is at a minimum. In addition to visual inspection, the high voltage power supply should be checked and adjusted as described below:

To measure the high voltage supply, unscrew the red slug located at the top of the supply. This provides access to the voltage test point. The voltage may be varied by means of the screwdriver

slot adjustment. The voltage should not be increased beyond -1250 volts, which is the maximum rating of the photomultiplier. If it is necessary to remove the cover of the supply, disconnect the 7-inch amphenol socket before removing the cover.

Coordinate Transfer Circuit
Clear Pulses - When the computer wants to clear the Buffer, it applies a cIear Display Pulse (CDP) at tp7 to two inverters in a Type 4603 Pulse Amplifier module. The inverters then conduct and activate two pulse ampl ifiers, producing positive ~Iear .b.,orizontal ~uffer (chb) and
~Iear ~ertical ~uffer (cvb) pu Ises which are appl ied to the fl ip-flops in the Hori zonto I and
Vertical Buffers. The cvb pulse is also applied to the flip-flops in the Status and Intensity
Circuit. The clear pulses are divided in order to provide the required driving power for the
large number of flip-flops. Each pulse clears 12 flip-flops, the chb pulse also clearing the
two less-significant flip-flops in the Vertical Buffer. 

Light Pen Status - At the end of eCich display cycle a negative ,Qisplay Qone !uise (DDP) is
applied to an inverter gate in a Type 4603 Pulse Amplifier module. This inverter gate is controlled by another inverter which receives the light pen gate signal. When a Type 32 Light
Pen is used and the pen sees the displayed spot, it produces a -3 volt ~w ~ :pot (sas) level
3-11
duri ng and~sl ightly after the spot's display period. This turns on the inverter, enabl ing the
inverter gate and allowing the DDP pulse to activate the pulse amplifier. The pulse amplifier
turns on a third inverter which complements the light Pen Status Flip-Flop, thereby producing
a negative .!:.ight ~en ~tatus (LPS) level that is returned to the computer.
The LPS level is also applied to another inverter in a Type 4604 module which conducts and
activates a pulse amplifier. This pulse amplifier produces the positive .!:.ight ~en ~Iag (LPF)
which is returned to the computer. 





Sorry, don't have time to do this cleanly as I'm creating a document related to a housing subdivision and I'm running out of time.
My understanding is three instructions are required per point 
  1. Load AC, 
  2. Load IO
  3. dpy
  4. cks
  5. if Light Pen Flag set then save address in Registers
  6. Do next screen location, etc
Regards,
Garry


--
You received this message because you are subscribed to the Google Groups "[PiDP-1]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-1+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pidp-1/9f7df285-764a-4852-9aec-c4d9141af263n%40googlegroups.com.

Kevin McGrath

unread,
Jan 31, 2026, 6:18:27 PM (5 days ago) Jan 31
to [PiDP-1]
  So odd, but yes, I see it in my copy of the 1963 manual too.

  It seems extraneous to me, as you've just given the X,Y coordinates using dpy i, and once that instruction fully executes the Light Pen Status flag from cks should be set or not depending on if the light pen sees a dot of light or not.  The problem is that the cks will destroy the IO register, which was your Y coordinate.

  If we could get one of those light pen test example paper tapes that CHM seems to have, we could reverse engineer how it actually works on real CHM hardware.

-Kevin.

Matthias Barthel

unread,
Feb 1, 2026, 4:09:57 AM (5 days ago) Feb 1
to [PiDP-1]
to connect real hardware, i created an complete working backplane for my pdp1's . you have access to all iot-addresses 0-64, to the complete io-register-bits and to ac-bits 0-11. 

i think the i2c-bus is to slow for the iot-devices, i do some tests and switch to ethernet communication and fast mcp23s17-expanders on the spi-bus.

best matthias

Bill E

unread,
Feb 1, 2026, 8:46:38 AM (5 days ago) Feb 1
to [PiDP-1]
After more digging and semi-deciphering the posted PDP-4 diagnostic code, here's what seems to be the actual case, and what I've implemented:
When a dpy is issued and the light pen sees that dot, the light pen flag is set. When the dpy completes AND a completion pulse is requested AND an ioh is done,, cks bit 0 and pf3 are set.
Neither the AC nor IO are loaded, you already know the last coordinates used. The next dpy (or a symbol generator IOT gcf, reset, 720127) clears the cks bit but apparently not pf3.
So, the code would look like:
lac y
lio x
dpy
.
.
ioh
cks
spi -
jmp hit
.
.
An interesting note, if you want to have dpy points the light pen can see but not a person, dpy 400 sets an intensity 'not visible to the eye' but detectable by the light pen.

Additionally, the real light pen had 6 switchable aperture masks that set the field of view of the pen, ranging from 0.05 to 0.30 inches. This corresponded to a circle ranging from 5 to 30 pixels in diameter. This means that light pen coordinates within that many pixels of the dpy coordinates is considered a hit.
This is also emulated, and since there is no physical aperture mask to change, a NONSTANDARD extension to dpy was added, dpy 3000 takes the value in IO as the new aperture size in pixels. The default setting is 3, an aperture size of 0.054. The addressable pixel size on the Type 30 was 0.009".

I'm writing a cute little demo, I'll post a vid when (if) it actually works and update my repo.

One more unresolved question, how does this interact with the Type 33 Symbol Generator? It writes up to 35 dots in one IOT call. Is the light pen even used? If so, what is a hit? Any dot in the character area? The 'reset cks flag' IOT specific to the symbol generator must be there for some reason. I'm not dealing with this for the moment.

Finally, this was only partially implemented in the main branch. The p7sim code semi-handled it, posting mouse coordinates but not normalized. The pidp1 itself did nothing at all. So, this is a fairly intrusive change to both the pidp1 code and the p7sim code, but there have been others for dynamic IOTs, audio, etc. Since I was modifying p7sim anyway I added a couple of new command line args to make it easier to have a nice display on that wonderful Type 30 replica some of us have built. You can switch between a bordered and borderless window using the 'b' key or via command-line arg and also set window size and scaling factors via command-line args. 
Sorry, not implemented for the web version, I have my limits and I hate javascript.

Bill
Reply all
Reply to author
Forward
0 new messages