ATX PSU for 65C02 SBC

For discussing the 65xx hardware itself or electronics projects.
JohanFr
Posts: 88
Joined: 16 Nov 2011
Contact:

ATX PSU for 65C02 SBC

Post by JohanFr »

Hi!

I am in the making of a rev 2 of my 65C02 SBC with onboard graphics and all kinds of peripherals. It's a lot to get working so I am trying to verify all new parts separately. One of the improvements I'd like to make is to have the board on a mini-ITX form factor and mount it in a case. For the ultimate experience I would like to use a standard (modern) ATX PSU, with the power button on the front of the case to turn on/off the computer.

I have "discussed" with ChatGPT a solution using a microcontroller for button debouncing. The idea behind the ATX PSU is simple:

+5VSB is always available from the PSU and powers the MCU. The MCU reads the button press and activates the PS_ON signal to the PSU. The PSU replies with PWR_OK to indicate it has turned on the power rails. The power rails including 5V are turned on.

Now, it all seemed simple to me until ChatGPT started talking about all kinds of protection i should add, thus the MOSFET and a bunch of resistors in the attached schematic.

As I am electronically challenged and pretty uncomfortable outside the digital domain, I want to do reality check with real human beings before risking my life hooking this up.

TL;DR What do you think of the schematic, would it work? Has anyone attempted a full-on integration with an ATX-PSU for their SBC builds?

Edit: J2 would be the power button. J3 the actual VCC and GND for my SBC. In this schematic it's simply a pinsocket.
Attachments
Screenshot_20250819_093901.png
gfoot
Posts: 871
Joined: 09 Jul 2021

Re: ATX PSU for 65C02 SBC

Post by gfoot »

I don't know the details of ATX PSUs but can't you just connect PWR_ON# to ground through a toggle switch, and pull it up to +5VSB through a large resistor?
JohanFr
Posts: 88
Joined: 16 Nov 2011
Contact:

Re: ATX PSU for 65C02 SBC

Post by JohanFr »

gfoot wrote:
I don't know the details of ATX PSUs but can't you just connect PWR_ON# to ground through a toggle switch, and pull it up to +5VSB through a large resistor?
Absolutely possible. But since the power button on a modern case is not a toggle one, but that other kind that is in "active" state only while you press it, just like a reset button, for it to be integrated nicely something needs to store a on/off state. All this is definitely overkill - my thinking is that if it goes in a case, it would be nice to have a conveniently located power button.
GlennSmith
Posts: 162
Joined: 26 Dec 2002
Location: Occitanie, France

Re: ATX PSU for 65C02 SBC

Post by GlennSmith »

Hi,
No need for any of that protection stuff, the PSU is already quite protected. All you need is a standard on/off switch to connect between the P-ON pin and whichever level it needs to start (i.e. 0v in your case). I use several old computer supplies in this way. The best PSUs to use are the ones that also have a mains on/off switch next to the power inlet socket.
PS You can find latching on/off buttons, that's what they used originally on PCs.
Last edited by GlennSmith on Tue Aug 19, 2025 8:49 am, edited 1 time in total.
Glenn-in-France
gfoot
Posts: 871
Joined: 09 Jul 2021

Re: ATX PSU for 65C02 SBC

Post by gfoot »

OK - the MOSFET seems pointless there, you should be able to just connect it to the pin, maybe with a pullup to 5VSB to cover any time after power-on during which the MCU is not driving the pin properly. Given that you're prepared to keep the MCU powered all the time even when the system is off, this shouldn't cause you any issues. On one of my projects I did use a similar setup to implement a one-button on-off mechanism, but with the MCU only powered when the device was in the "on" state. The MCU could then read the button for other purposes later on, and holding the button for several seconds caused the MCU to turn everything off. That was harder though due to dealing with the MCU being powered off.

It'll be easier if you use an ATmega328P or whatever the default Arduinos use, as you can then easily use that software stack to program it. You can also program the ATtiny through that stack but need to configure things more carefully.

Another option is to do it without the microcontroller so you don't need to program it at all - you can debounce the button using an RC filter and Schmitt trigger, and feed that into a D or JK flipflop to toggle it when the button is pressed, and then the flipflop output would drive 5VSB. You might need to experiment with R and C values but it should be quite reliable.

Edit: Just to add, including the fuse (or some other current limiting mechanism) is sensible as these power supplies are able to deliver a large amount of current, so faults in your circuit will have more severe consequences than with less capable power supplies.
User avatar
drogon
Posts: 1671
Joined: 14 Feb 2018
Location: Scotland
Contact:

Re: ATX PSU for 65C02 SBC

Post by drogon »

While nice and "industrial", and unless you're making something with a raft of DRAM and TTL ICs, an ATX PSU is very much overkill for a little 65C02 system. Even my 65C816 system with 2 GALs big AVR and an SD card takes under 200mA.

To make my life simple, I use USB from my desktop/laptop or a little "wall wart" USB PSU to power it.

-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
barnacle
Posts: 1831
Joined: 19 Jan 2004
Location: Potsdam, DE
Contact:

Re: ATX PSU for 65C02 SBC

Post by barnacle »

Beat me to it, Gordon. USB at five volts and up to a couple of amps is easily available from any number of 'USB' power supplies.

A point on protection: rather than a dual dip pin header connector with volts up one side and ground down the other, some arrangement that won't hurt if it gets plugged in backwards might be a good idea: I've used a three-pin pin header with power on the centre pin and grounds on either side. It can't be plugged in backwards... or some other polarised connector?

Neil
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: ATX PSU for 65C02 SBC

Post by BigEd »

(Just a note: many small USB chargers put out a rather low-quality 5V, which might cause the powered project some reliability problems. So if you go this way, and have trouble, be sure to try other USB sources - a computer or laptop as USB source should be very solid. Also be sure to avoid cables with inadequately thick wires. At minimum, try different cables. Finally, note that some USB chargers specifically put out a bit more than 5V. Check the label!)
gfoot
Posts: 871
Joined: 09 Jul 2021

Re: ATX PSU for 65C02 SBC

Post by gfoot »

I assumed the reason for doing this was just that this is what the case is designed to house.

Another option to consider is maybe you could just run your whole circuit from the 5VSB supply, and not bother powering up the whole PSU - it looks like it should be rated to provide plenty of current (at least hundreds of milliamps) and this also means the fan won't spin up, keeping the noise down. You can still use the front panel power switch to turn most of your device on and off in the same sort of way.
JohanFr
Posts: 88
Joined: 16 Nov 2011
Contact:

Re: ATX PSU for 65C02 SBC

Post by JohanFr »

Well currently I am just powering my SBC off the FTDI-cable, or using an Apple Charger through the USB-port, as I have very few components on the SBC. My next design involves dual port RAM (either a 7134 or a 7007, haven't decided if i should go small or big yet, a few 100 mA according to the spec), an ATF22V10, multiple SST39SF010s (one for VGA-sync and one for the 6502), a few more 65C22 and of course all the 74HC's for the VGA circuit. I definitely agree that an ATX powersupply is overkill even for this, but it will also draw more power. The idea of using an ATX PSU was merely because it would conveniently give me both more power and easy integration with the soft power on button located on all modern cases.

I could happily go the Apple Charger route again, but add my own soft power on circuit (don't really know how that would work, as I suspect using an output as a power output would be a bad idea). Or just skip the soft button and have a regular power switch.

Edit: but back to my original question and the relevant answers to it, should i decide to go the ATX route it seems i could simplify and remove most of the AI induced seatbelts on the PSU logic.
GlennSmith
Posts: 162
Joined: 26 Dec 2002
Location: Occitanie, France

Re: ATX PSU for 65C02 SBC

Post by GlennSmith »

JohanFr wrote:
...but back to my original question and the relevant answers to it, should i decide to go the ATX route it seems i could simplify and remove most of the AI induced seatbelts on the PSU logic.
Correct.
Yet again proof that AI doesn't have a clue about real-life electronics. I get more work nowadays helping people 'undo' what GPT has told them to do (Arduino code, ESP32 code, interfacing between IOT devices, etc), than actual design work!
I suppose it's a good spin-off for me, anyways :D
Glenn-in-France
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: ATX PSU for 65C02 SBC

Post by BigDumbDinosaur »

BigEd wrote:
Just a note: many small USB chargers put out a rather low-quality 5V, which might cause the powered project some reliability problems.

I second that.  USB chargers are not always well-regulated, especially with fluctuating loads, and might even subject your gadget to overvoltage.

I use a small ATX power supply to run my POC units.  The computer itself doesn’t draw a lot of current (<100 mA), but not having to worry about regulation, as well as having the “crowbar” feature as protection, justifies the power supply’s usage.  Also, it has the capacity to power peripherals, such as the two SCSI disks and SCSI CD drive I have connected.

As for controlling the PS_ON# input of your power supply, you can use an ordinary D-type flip-flop, e.g., a 74HC74, for that purpose.  Wire the flop’s D input to the /Q output, and wire the push button to the C (clock) input, using a debouncer of some sort—a MAX6816 is good for this application. 

You would wire the PS_ON# input to the Q output on the flop through a Schottky diode, e.g., a BAT-85, so the flop can pull PS_ON# low, but can’t drive it high.  Each time you push and release the push button, the flop will toggle state, thus either driving PS_ON# low (power supply on) or allowing it to return high (power supply off).

So as to assure the unit starts up in the power-off state when line voltage is initially applied to the power supply, connect the flop’s /CLR input directly to VCC, and connect the /PRE input to VCC through a resistor, with a capacitor wired from /PRE to ground so as to slightly delay the rise of /PRE after line power is applied to the power supply—I suggest a 500 millisecond delay as a minimum, easily obtained with reasonably-size parts.  The delay on /PRE’s rise will cause the flop to always come up with Q high and /Q low at initial power application, corresponding to the power-off state.

The flop’s VCC pin should be wired to the power supply’s 5VSB output.  That output will always have 5 volts available when the power supply is connected to the line.

74ahc74_d_dual_ti.pdf
74AHC74 C-D Flip-FLop
(1.92 MiB) Downloaded 94 times
atx_specs.pdf
ATX Power Supply Specifications
(421.92 KiB) Downloaded 89 times
debouncer_max6816-18.pdf
Dalla Semi MAX6816 Debouncer
(1.25 MiB) Downloaded 90 times
Last edited by BigDumbDinosaur on Tue Aug 19, 2025 4:35 pm, edited 1 time in total.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: ATX PSU for 65C02 SBC

Post by BigDumbDinosaur »

JohanFr wrote:
Edit: but back to my original question and the relevant answers to it, should i decide to go the ATX route it seems i could simplify and remove most of the AI induced seatbelts on the PSU logic.

My general impression of a lot of what AI services, e.g., ChatGPT, offer falls into the “mostly malarkey” category.  A human expert on the subject matter will trump AI every time.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
Yuri
Posts: 371
Joined: 28 Feb 2023
Location: Texas

Re: ATX PSU for 65C02 SBC

Post by Yuri »

Seems overly complicated, even if all you need is a soft switch you can use a 74x74 with denounced push button; no need for a whole complicated ATMega on there.
gfoot wrote:
OK - the MOSFET seems pointless there, you should be able to just connect it to the pin, maybe with a pullup to 5VSB to cover any time after power-on during which the MCU is not driving the pin properly.
I think the only reason for the MOSFET that I can think of is that I don't think I've ever found anything that definitively says how much current ends up flowing from the PS_ON# pin to the GND rail. I would presume it's TTL/CMOS level logic? *shrug*

But yea, the AI here seems like it got hung up on someone's design where they decided to throw a kitchen sink at a problem that doesn't need it. (I see that a lot) As someone else who I was looking at puts it, AI is basically a really fancy pattern matching system, gotta watch what you get back out of it.
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: ATX PSU for 65C02 SBC

Post by BigDumbDinosaur »

Yuri wrote:
Seems overly complicated, even if all you need is a soft switch you can use a 74x74 with denounced push button; no need for a whole complicated ATMega on there.
I guess you didn’t read all the posts before replying.  :D  I said as much a few posts ago.
Quote:
gfoot wrote:
OK - the MOSFET seems pointless there, you should be able to just connect it to the pin, maybe with a pullup to 5VSB to cover any time after power-on during which the MCU is not driving the pin properly.
I think the only reason for the MOSFET that I can think of is that I don't think I've ever found anything that definitively says how much current ends up flowing from the PS_ON# pin to the GND rail. I would presume it's TTL/CMOS level logic? *shrug*
PS_ON# is a CMOS input that is internally pulled up to 5VSB through a resistor.  The ATX spec says that whatever is connected to it should be open-collector when deasserted.  Some testing I did eons ago indicated that when grounded, 2-3 mA flows from PS_ON#.  Hence the MOSFET is totally unnecessary.  The circuit I earlier described will easily handle it.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
Post Reply