Inverting the deposit switch in software

77 views
Skip to first unread message

Sven Moritz Hallberg

unread,
Jul 31, 2025, 2:29:42 PMJul 31
to PiDP-8
Hi all,

I made a post to the fossil forum on tangentsoft.com some months ago, but it has been stuck "awaiting moderator approval"...

I don't normally use this gmail account - is there any way to participate in this group with a regular email address?

Anyhow, below is a copy of my post:

I recently got the PiDP-8 kit and it's awesome!

However, I did not realize during the build that the Deposit switch is mounted in the opposite orientation on the real thing. Of course I had to turn it around! A stressful (but successful) bit of desoldering ensued...

Anyway, I patched the software to invert the signal, selected with a configure flag (--invert-dep).

I chose to introduce the inversion in the function report_ss() because it forms a bottleneck between the lower-level GPIO handling and its higher-level "user" code, so both sides can remain otherwise oblivious to this. The function is only called when the switch state actually changes (after debounce) so the extra code does not run on every scan.

Patch against Fossil trunk [3fee766e68] below. Tested with pidp8i-test.

Regards, pesco

PS: With this (not requiring a hardware mod), maybe a note could be placed in the build instructions about the possibility. It would have saved me some rework. ;)

invdep.patch

William Cattey

unread,
Oct 25, 2025, 5:49:37 PMOct 25
to PiDP-8
Hello Sven,

My profuse apologies for taking so long to respond usefully to your contribution.

I've looked at your patch, and it is clear that you put in the extra work to understand how to add an option through auto.def and that you did it correctly.  I also like where you placed the code to perform the inversion.

I have just checked in your patched version to a branch called "invert-deposit".

I'm now pondering what kind of additional testing might be needed to feel totally safe pulling this change into trunk.

I agree that additional documentation should be made. I'll start with adding a description of this new option to the top level README.md in the branch.

Would you please do a build of the invert-deposit branch and confirm that your changes work. (I.E. that I've correctly taken them.)

-Bill 

William Cattey

unread,
Nov 9, 2025, 2:14:00 PM (12 hours ago) Nov 9
to PiDP-8
I see I should have addressed my reply to Pesco. Sorry.

I've done a build with the invert deposit logic enabled on my PiDP-8.  I wondered, "What would happen if that option were chosen on a machine that did not have the hardware mod?"

Alas, I encountered what I believe is a show-stopper.

At first things seemed fine.  The Deposit switch remained inactive when I depressed it, and then when I released it, the deposit was successful. I did that a couple times to confirm all was well. Indeed all seemed well.

I then restarted OS/8 with the traditional, Load Address 7600 / Start.  I saw the monitor dot prompt and figured, "We're good."  Alas, the system was now hung.  Both my terminal windows into my Pi went unresponsive, and then timed out.  I had to power-cycle the machine to get it back.

So there's something toxic going on here that requires further investigation.

I'm quite hesitant to dig into this because I believe that every non-graceful power off is a non-zero chance of corrupting my system image.

Pesco, Oscar, we need to collaborate on this if we're gong to make a go of this for the next release.

-Bill
Reply all
Reply to author
Forward
0 new messages