New to Group - Want Help Reading Front Panel Switches and Lighting LEDS

109 views
Skip to first unread message

Steven Fraser

unread,
Jan 18, 2026, 3:10:14 AMJan 18
to [PiDP-11]
Hi There Just go my PiDP11 and want to know if there a simple way to read the front panel switch and write to the LED outputs

Thanks for any pointer.

Regards
Steven

Nick M

unread,
Jan 18, 2026, 1:37:49 PM (14 days ago) Jan 18
to [PiDP-11]
Hi,

Congrats on getting a PiDP11 :)

> want to know if there a simple way to read...

It depends on from where/in what way you wish to read and write.

If you go into the simulator (hit ctrl-E and get the sim> prompt), you can deposit and examine:

  d 17777570 123456
will send (octal) 123456 to the LEDs. And

  e 17777570

will display (again in octal) the value of the bank of switches (sw 15-sw 0)

From a Macro-11 program running bare metal (without an operating system), you can write and read address 177570 and get the same effect.
I just wrote a device driver for doing this from Macro-11 in RSX-11, and am pushing out a video on that later today.

 Cheers, -Nick

Nick M

unread,
Jan 19, 2026, 12:18:18 AM (13 days ago) Jan 19
to [PiDP-11]
Here's a long rambling video about controlling the front panel LEDs and reading the switches (and making the whole thing interrupt dirven) through an RSX-11M device driver for a custom SimH device (called "pan," as in "Front Panel"): https://www.youtube.com/watch?v=XzMIB3uWePA There are a bunch of links in the description, and the READMEs link to other goodies. Probably overkill for your question, but I was releasing this today anyway, so trhought I'd post it here.

 -Nick

Johnny Billquist

unread,
Jan 19, 2026, 3:22:59 AM (13 days ago) Jan 19
to pid...@googlegroups.com
Not sure how you could make that interrupt driven. There are no
interrupts related to the switch register or display register.
Also, reading the switch register you already have a system call for.
Writing to the display register on the other hand you need to do on your
own. But it's trivial in RSX. Just link the task privileged, and you
have access to the I/O page.
Also, the device can't possibly be called PAN:. Device names are only
two letters. But maybe that was what it's called on the simh side? Not
sure why you'd do anything on the simh side though.

Johnny
> --
> 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 visit https://groups.google.com/d/msgid/
> pidp-11/4a3f0535-1eb0-4bb4-aaeb-5f75c19b208cn%40googlegroups.com
> <https://groups.google.com/d/msgid/pidp-11/4a3f0535-1eb0-4bb4-
> aaeb-5f75c19b208cn%40googlegroups.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

Johnny Billquist

unread,
Jan 19, 2026, 11:06:15 AM (13 days ago) Jan 19
to pid...@googlegroups.com
A late comment or two...
It would be helpful to know if you mean from the RPi, under Linux, or if
you are talking about doing this from any PDP-11 environment.

I can tell you that basically, from the PDP-11 point of view, the
display register is at address 17777570. That's the 22-bit address. If
MMU is off, you'll have that at 177570 in your 16-bit address space. If
the MMU is enabled, you'll need to make sure the I/O page is mapped, and
access that address through there.

And basically, if you read that address, you'll see the 16 low bits of
the switches. And if you write to that address, it will show up on the
data LEDs, if your selector is set to show the display register.

If you are running any OS with memory protection, you are normally not
allowed to access the I/O page yourself. However, there are ways around
this, which are different depending on which OS we're talking about.

For RSX, you can read the switch register with a system call; GSSW$ -
which gives you the 16 low switches. However, there is no way to set the
display register without having a privileged program. But a privileged
program by default already have the I/O page mapped, so then it again
becomes just a question of writing to 177570.

In 2.11BSD, you'd probably want to open /dev/kmem, and write/read
through there.

Other PDP-11 OSes I'll leave to others to comment on.

Johnny

Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Nick M

unread,
Jan 20, 2026, 10:18:46 AM (12 days ago) Jan 20
to [PiDP-11]
Hi,

> Not sure why you'd do anything on the simh side though.

This was all just experimentation for my own learning.

> Also, the device can't possibly be called PAN:. Device names are only two letters. But maybe that was what it's called on the simh side?

Correct: "pan" is on the simh side (pidp11_pan.c, pdp11_defs.h etc.) The RSX device is QF:

> Not sure how you could make that interrupt driven.

Inside simh :) pan_svc is called every 10 mSec (using sim_activate_after), which compares the switch settings to their prior value. If they've changed and ints are enabled (CSR<6>=1), it calls SET_INT(PAN). This was just to play with using the $QFInt:: entry point in the QFDRV.MAC code for this device.

As I said, probably overkill for the initial question of reading/writing the switches/LEDs, but thought I'd share it anyway.

 -Nick

Nick M

unread,
Jan 20, 2026, 10:18:49 AM (12 days ago) Jan 20
to [PiDP-11]
Hi,

(2nd try here, my previous msg seems to have vanished)

> Also, reading the switch register you already have a system call for.
> ...
> Not sure why you'd do anything on the simh side though.

I was just doing this as a learning exercise. I wanted to make a (different) device interrupt-enabled, and having finished that, thought this might be a simple example of what I did.

> Not sure how you could make that interrupt driven.

I made a device in simh (pan, which you're right, that's the name on the simh side; it's "QF:" in RSX). Every 10 mSec, pan_svc is called, and if interrupts are enabled (CSR<6>=1), it calls SET_INT(PAN). The RSX driver picks that up at the QFINT entry point.

Again, likely overkill for the original question, but I figured no harm in sharing it, for whoever else might be playing with implementing devices and writing drivers.

 -Nick


On Monday, January 19, 2026 at 12:22:59 AM UTC-8 b...@softjar.se wrote:

Nick M

unread,
Jan 20, 2026, 10:18:54 AM (12 days ago) Jan 20
to [PiDP-11]
Hi,

(3rd try here, my previous msgs seem to have vanished - trying replying to a different post)

> Also, reading the switch register you already have a system call for.
> ...
> Not sure why you'd do anything on the simh side though.

I was just doing this as a learning exercise. I wanted to make a (different) device interrupt-enabled, and hav
ing finished that, thought this might be a simple example of what I did.

> Not sure how you could make that interrupt driven.

I made a device in simh (pan, which you're right, that's the name on the simh side; it's "QF:" in RSX). Every  
10 mSec pan_svc is called, and if interrupts are enabled (CSR<6>=1), it calls SET_INT(PAN). The RSX driver pic
ks that up at the QFINT entry point.

Again, likely overkill for the original question, but I figured no harm in sharing it, for whoever else might  
be playing with implementing devices and writing drivers.

-Nick

R Clark

unread,
Jan 20, 2026, 10:19:00 AM (12 days ago) Jan 20
to [PiDP-11]
On that note. Is there any document that explains the LED write access, and switch read access out side of the simulator and not having to dig through the source code, chip data sheets, drawings?  Or point to the source code file for what RPI pins are used and such... For those that would like to write their own application in C or Python application and access the LEDs/Switchs for fun?  I might have missed it (or forgot it which is entirely possible)....

Johnny Billquist

unread,
Jan 20, 2026, 11:29:32 AM (12 days ago) Jan 20
to pid...@googlegroups.com
Ah. Gotcha.

Johnny
> <https://groups.google.com/d/msgid/>
> > pidp-11/4a3f0535-1eb0-4bb4-aaeb-5f75c19b208cn%40googlegroups.com
> <http://40googlegroups.com>
> > <https://groups.google.com/d/msgid/pidp-11/4a3f0535-1eb0-4bb4-
> <https://groups.google.com/d/msgid/pidp-11/4a3f0535-1eb0-4bb4->
> > aaeb-5f75c19b208cn%40googlegroups.com?
> utm_medium=email&utm_source=footer <http://40googlegroups.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
>
> --
> 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 visit https://groups.google.com/d/msgid/
> pidp-11/1b814740-6df3-4464-bed9-104ab86a4260n%40googlegroups.com
> <https://groups.google.com/d/msgid/pidp-11/1b814740-6df3-4464-
> bed9-104ab86a4260n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Glenn Babecki

unread,
Jan 20, 2026, 1:10:29 PM (12 days ago) Jan 20
to Johnny Billquist, [PiDP-11]
Nick,
For what it's worth, all three copies of your last post came through.

To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pidp-11/577fd10b-3d6c-48fb-b820-06437b283bf9%40softjar.se.
Reply all
Reply to author
Forward
0 new messages