First hack: a $0.90 temperature/pressure sensor as a PDP-11 device

434 views
Skip to first unread message

oscarv

unread,
May 27, 2018, 10:29:55 AM5/27/18
to [PiDP-11]

Adding interesting hardware to the PiDP-11 gives motivation to actually do something with the machine.
I hope this will spark other hacks...

This page describes how to make a simple 'Arduino style' peripheral into a PDP-11 device on the simulated unibus:

Amazingly, the cost of this was $0.90 including shipping from AliExpress.
And thanks to Gordon Henderson's wiringPi, the programming effort to get it into a PDP-11 peripheral is minimal.

Kind regards,

Oscar.

Paul Birkel

unread,
May 28, 2018, 2:31:46 AM5/28/18
to [PiDP-11]

Neat!  Note that the BMP280 is the successor to the BMP180.  Higher resolution, lower power drain, smaller (for when size matters :->), yada, yada, yada.  Should be a “drop-in replacement” in this application, and widely/cheaply available. $0.86 (free shipping) on eBay – in the U.S. anyway.

 

Speaking of higher resolution, it can tell you when your PiDP-11 moves to another floor in your abode or place-of-business :->.  Take it on trips!

--
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/9bc01f23-abcb-4657-8b6a-75a437c45be4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark Matlock

unread,
Jul 9, 2018, 11:56:08 PM7/9/18
to [PiDP-11]
   If anyone is curious about the temperature of their Raspberry Pi CPU, the following commands work on my RPi3 +

$ cat /sys/class/thermal/thermal_zone0/temp
59072

Divide the integer above by 1000. and that is the temperature is degrees C

or you can use this command:

$ /opt/vc/bin/vcgencmd measure_temp
temp=60.1'C

    I did put a heat sink on my CPU but haven't tried to use any fans etc. I want to install a small
voltmeter such as https://www.adafruit.com/product/460 before adding a fan and possibly switching
to a better power supply.

Best,
Mark


Neil Higgins

unread,
Oct 24, 2018, 4:03:53 AM10/24/18
to [PiDP-11]
This is good, Oscar. Following the discussion in another thread about possibly controlling model trains, I was wondering how GPIOs might be accessed programmatically from the PDP-11 side. Then I remembered this posting, which provides a gentle introduction to I/O modelling in simh. Thanks! For people who want to go further, some of the articles on the following page will allow a deeper dive - http://simh.trailing-edge.com/papers.html

Johnny Billquist

unread,
Oct 24, 2018, 1:09:43 PM10/24/18
to pid...@googlegroups.com
On 2018-10-24 10:03, Neil Higgins wrote:
> This is good, Oscar. Following the discussion in another thread about possibly controlling model trains, I was wondering how GPIOs might be accessed programmatically from the PDP-11 side. Then I remembered this posting, which provides a gentle introduction to I/O modelling in simh. Thanks! For people who want to go further, some of the articles on the following page will allow a deeper dive - http://simh.trailing-edge.com/papers.html

Speaking from a rather narrow PDP-11 perspective, you have essentially
two options.
1) Find some suitable PDP-11 peripherial, and implement that in simh,
with the backend then controlling the GPIOs. You will then (hopefully)
already have a device driver on the PDP-11 side, and you can make use of
existing programs, or write your own that use the GPIOs through the
device driver.
2) Implement a totally new device. That means you need to come up with
how the CSR should look, and what additional registers are needed. Maybe
some kind of interrupt capabilities, and so on. Essentially in one way
similar to option 1, except here you can go wild and implement this in
any way that makes it the "best". The you will need to write your own
device driver on the PDP-11 side to access the device. After that, you
can write your applications using this device, and have access to the
GPIO pins.

Both are rather trivial, or rather difficult, all based on your skills
and experience.

Johnny

--
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

Oscar Vermeulen

unread,
Oct 24, 2018, 1:33:39 PM10/24/18
to Johnny Billquist, pid...@googlegroups.com
Johnny,

For the barometer hack, I chose option (2). In other words, make up a new Unibus device with a fantasy CSR.
This was mostly meant to show how easy it really is.

Something much Cooler, of course, in your Option 1 category, would be a proper D/A A/D laboratory instrument fully compatible with the original DEC ones. But just an Arduino at the rear end of it. This would also be the proper way to drive a scope display for instance.

Ah. So many useless yet important things to do, so little time.

But the hack was meant to show that (using it as a template) it really is not hard to create a device of some sort for the PDP-11, that can control anything with an I2C bus. Including an entire Arduino with all its I/O options, if need be.


Kind regards,

Oscar.

Johnny Billquist

unread,
Oct 24, 2018, 1:53:30 PM10/24/18
to Oscar Vermeulen, pid...@googlegroups.com
Hi, Oscar. :-)

On 2018-10-24 19:33, Oscar Vermeulen wrote:
> Johnny,
>
> For the barometer hack, I chose option (2). In other words, make up a
> new Unibus device with a fantasy CSR.
> This was mostly meant to show how easy it really is.

Like I said, it depends on the persons skills and experience. Also,
adding the device in simh is one thing. And I agree, it should not be
too hard. But then, for this option, you also need to do something a
little bit more complex on the PDP-11 side. Writing a device driver is
fairly straight forward, and well documented in RSX. However, the first
time someone have to do it, it's still a complex task. After a few
drivers, it is much easier. Another option is to just write a program
that have access to the I/O page, and not have a device driver at all.
Also very easily done in RSX, but potentially less efficient, and with
other limitations.

Doing new devices in RT-11 is, I believe, similarly easy. However, in
RSTS/E, I think it's rather complicated, and undocumented, how to add
new device drivers.

> Something much Cooler, of course, in your Option 1 category, would be a
> proper D/A A/D laboratory instrument fully compatible with the original
> DEC ones. But just an Arduino at the rear end of it. This would also be
> the proper way to drive a scope display for instance.

That would be a cool thing, yes. But even simpler devices can still be
useful.

> Ah. So many useless yet important things to do, so little time.

Indeed. My constant problem. :-)
Latest hack on my side was to add TCP/IP functionality in XLISP under
RSX, and add small simple daemon to test it.
Extremely useless in a way, but oh so much fun. Been a while since I
wrote in Lisp, and it's endless amounts of joy every time I get back to it.

> But the hack was meant to show that (using it as a template) it really
> is not hard to create a device of some sort for the PDP-11, that can
> control anything with an I2C bus. Including an entire Arduino with all
> its I/O options, if need be.

Right. And good that you give examples showing this. Something hopefully
others can pick up on, and extend in new, fun ways.

For a moment, I was actually tempted at looking into controlling model
railways through RSX, but I realized I have too many other things to do,
no test setup to play with, and in the end most people would still want
all that graphic stuff anyway, meaning that even with easy interfaces to
a bunch of languages in RSX, people still wouldn't actually use it.

Oscar Vermeulen

unread,
Oct 24, 2018, 2:02:10 PM10/24/18
to Johnny Billquist, pid...@googlegroups.com
Johnny,

On Wed, 24 Oct 2018 at 19:53, Johnny Billquist <b...@softjar.se> wrote:
adding the device in simh is one thing. And I agree, it should not be
too hard. But then, for this option, you also need to do something a
little bit more complex on the PDP-11 side. Writing a device driver is
fairly straight forward, and well documented in RSX.

Er, yes. I didn't even try that. I kept it to just the hardware device that a little stand-alone program could access. Indeed, a template RSX device driver for such things would make it complete. They tell me you need a brain to write device drivers, so I guess I need to find someone with a brain. Are you coming to the VCF Zurich this year? :) 

 
For a moment, I was actually tempted at looking into controlling model
railways through RSX,

Me too. I set up a Märklin track a few years back, just as an application for my homebrew Z80. But I quickly discovered that computers are much more reliable than trains.

In fact, the fancy graphical train software could easily be used with the PDP-11 just being the end controller for it. The thing that translates the instruction stream from those Windows programs into the bitstream onto the tracks. But yes. Time.

Regards,

Oscar.

Neil Higgins

unread,
Oct 24, 2018, 4:36:08 PM10/24/18
to [PiDP-11]
Under RT-11 and TSX (don’t know about other OSs), it was/is possible to access the CSR and Data registers of I/O cards like the M1710 and DRV11-P directly from userland - no device driver required! I did this for a custom interface to a TEAC data cassette drive that I developed for a seismic survey company. A colleague wrote a PIP-like utility for the cassette drive that he called TEACUP - TEAC Utility Program.

Johnny Billquist

unread,
Oct 24, 2018, 6:15:11 PM10/24/18
to pid...@googlegroups.com
On 2018-10-24 22:36, Neil Higgins wrote:
> Under RT-11 and TSX (don’t know about other OSs), it was/is possible to access the CSR and Data registers of I/O cards like the M1710 and DRV11-P directly from userland - no device driver required! I did this for a custom interface to a TEAC data cassette drive that I developed for a seismic survey company. A colleague wrote a PIP-like utility for the cassette drive that he called TEACUP - TEAC Utility Program.

I was wondering about that, it it might actually have been more common
to directly talk to the hardware under RT-11.

In RSX, you can certainly do it, but it's a bit more complex if you want
to also handle interrupts, but that is also supported. The biggest issue
is probably that you have to share the address space with the kernel,
meaning your program size is more limited.

Writing your own device drivers were certainly encouraged in RSX. There
is a big fat manual on the topic. And you can load and unload device
drivers on running systems as much as you please.

Sytse van Slooten

unread,
Oct 24, 2018, 6:17:06 PM10/24/18
to [PiDP-11], Johnny Billquist, Oscar Vermeulen
The de0nano has an 8-port adc… I’ve been thinking of adding an interface to it since forever… and maybe I should just give that a bit more priority ;-)

Any suggestions on what -11 card it should simulate? It’d have to be a Unibus one, and 8 adc ports max…

Cheers
Sytse

--
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.

Garry Lockyer

unread,
Oct 24, 2018, 6:37:42 PM10/24/18
to Sytse van Slooten, [PiDP-11], Johnny Billquist, Oscar Vermeulen
I’d look at an AD01 or Labratory Peripheral System (LPS11).

oscarv

unread,
Oct 24, 2018, 6:46:25 PM10/24/18
to [PiDP-11]
Sytse,

I'm hardly the expert, but the MINC-11 is something you might want to be compatible with:

Fred-Jan describes all the boards in the machine (a PDP-11/23 with laboratory cards added, essentially).

800px-DEC-MINC-23.jpg


I've been planning for 3 years to add the equivalent panel to the PiDP-8 - but time.

Kind regards,

Oscar.

oscarv

unread,
Oct 24, 2018, 6:55:15 PM10/24/18
to [PiDP-11]


On Thursday, October 25, 2018 at 12:37:42 AM UTC+2, Garry Lockyer wrote:
I’d look at an AD01 or Labratory Peripheral System (LPS11).

Oh right, that's actually a Unibus system.

Regards,

Oscar.

Johnny Billquist

unread,
Oct 24, 2018, 9:34:31 PM10/24/18
to Sytse van Slooten, [PiDP-11], Oscar Vermeulen
On 2018-10-25 00:17, Sytse van Slooten wrote:
> The de0nano has an 8-port adc… I’ve been thinking of adding an interface
> to it since forever… and maybe I should just give that a bit more
> priority ;-)

Why not? Sounds like fun.

> Any suggestions on what -11 card it should simulate? It’d have to be a
> Unibus one, and 8 adc ports max…

The obvious answer would be the AD01. You can find information about it
in the peripherials handbook
(http://www.bitsavers.org/pdf/dec/pdp11/handbooks/PDP11_PeripheralsHbk_1976.pdf)

13 or 14 bits of data, A/D converter. Maximum is 64 channels, but that
requires additional hardware. But just give 8 channels of data, and just
fake 0 on the other channels if needed.

Mark Matlock

unread,
Oct 26, 2018, 6:06:12 PM10/26/18
to [PiDP-11]
Another Unibus A/D that has 8 differential inputs or 16 single ended (common ground) is the AD11-K. It is also known as A009 and I think it is slightly newer than the AD01 or the LPS11 box. A manual for it can be found at:

http://www.bitsavers.org/www.computer.museum.uq.edu.au/pdf/EK-AD11K-OP-002%20AD11-K%20Analog%20To%20Digital%20Converter%20User%20Manual.pdf

I have a AD11-K in my collection but have not tested it yet as I don’t have any.of my Unibus PDP-11s running yet.

I do have a MINC-11 running complete with a UC07 and two SCSI2SD cards and a KDJ11-A with either RT11 or RSX11M.

Best,
Mark

Johnny Billquist

unread,
Oct 26, 2018, 9:20:03 PM10/26/18
to pid...@googlegroups.com
On 2018-10-27 00:06, Mark Matlock wrote:
> Another Unibus A/D that has 8 differential inputs or 16 single ended (common ground) is the AD11-K. It is also known as A009 and I think it is slightly newer than the AD01 or the LPS11 box. A manual for it can be found at:
>
> http://www.bitsavers.org/www.computer.museum.uq.edu.au/pdf/EK-AD11K-OP-002%20AD11-K%20Analog%20To%20Digital%20Converter%20User%20Manual.pdf

Cool. I was wondering if there wasn't something newer around.

> I have a AD11-K in my collection but have not tested it yet as I don’t have any.of my Unibus PDP-11s running yet.
>
> I do have a MINC-11 running complete with a UC07 and two SCSI2SD cards and a KDJ11-A with either RT11 or RSX11M.

Speaking of which, all of these devices will require RT11 or RSX-11M I
suspect. I checked what device drivers were available in RSX-11M-PLUS,
and the only thing that seems to be any kind of A/D that there is a
device driver for would be the LPA11. But I do remember that RSX-11M
have support for a lot more peripherals like this than M-PLUS do.

Mark Matlock

unread,
Oct 26, 2018, 10:06:47 PM10/26/18
to [PiDP-11]

The AD11-K is pretty similar to the ADV11-A or ADV11-C, as all are 8 differential 12 bit A/Ds or 16 Single Ended, but the
AD11-K also has an 8 bit D/A which can be utilized either to test the A/D or be utilized via an extra write only CSR by the
user. The ADV11-A is for the 18 bit Qbus and the ADV11-C is for a 22-bit Qbus but I converted my ADV11-A to 22 bits by
cutting an extra ground trace that otherwise would have grounded one of the upper 4 bits. That one I have in an 11/73
and have done simple non-interrupt programs in RSX11M+ (not all of us find RSX11M+ driver writing "trivial") as well
as RT11 programs where interrupt processing is easy.

Cool. I was wondering if there wasn't something newer around.

> I have a AD11-K in my collection but have not tested it yet as I don’t have any.of my Unibus PDP-11s running yet.
>
> I do have a MINC-11 running complete with a UC07 and two SCSI2SD cards and a KDJ11-A with either RT11 or RSX11M.

Speaking of which, all of these devices will require RT11 or RSX-11M I
suspect. I checked what device drivers were available in RSX-11M-PLUS,
and the only thing that seems to be any kind of A/D that there is a
device driver for would be the LPA11. But I do remember that RSX-11M
have support for a lot more peripherals like this than M-PLUS do.

You are right that there is somewhere some RSX11M drivers for A/D. In the MINC-23
brochure that I scanned and sent to Fred-Jan for his MINC web site Oscar mentioned
on page 5, a MINC/DECLAB23 is described as running RSX11M with FEP/RSX (Fortran callable
driver routines) for which the documentation does exist, and DECnet RSX. The FEP/RSX
software is at this point is lost as is the DECnet-RT which would also be quite useful.
I've used one port of a DLV11-J as an asynchronous DECnet line between RSX11M PDP-11s over
dedicated lease lines and although they were not that fast they were quite reliable.


Best,
Mark
Reply all
Reply to author
Forward
0 new messages