Inverting the deposit switch in software

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

Sven M. Hallberg

unread,
Dec 3, 2025, 12:24:16 PMDec 3
to William Cattey, PiDP-8
William Cattey on Sun, Nov 09 2025:
> 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?"

I think the answer should be "the same as in the following scenario:"

- original software (no invert-dep)
- unmodified circuit board
- switch soldered in the "authentic" orientation

I.e. the switch looks permanently engaged, unless you press it which
momentarily disengages it. Is that the behavior you were seeing?

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

I'm not sure I follow. The config option is only meant for the situation
where someone has soldered the switch in "inverted" orientation
(relative to Oscar's instructions).

So one wouldn't enable this by default. It's for tinkerers who don't
mind compiling their own software but would rather not cut a trace on
the board.

Or am I misunderstanding?

An obvious improvement would be a run-time (rather than compile-time)
switch, I guess. However, I wanted to start with something simpler to
implement that's already useful. I judged the trade-off that one needs
to rebuild the software acceptable.

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

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

I was thinking of a careful hint in the build instructions that this
option exists. It would have saved me a round of resoldering.

-pesco

PS: I tried the invert-deposit branch and the build worked fine. I
booted into TSS/8, logged in and started BASIC without issue. My
blinkenlights go blink.
Reply all
Reply to author
Forward
0 new messages