If the purpose is to start an MCU, and if there is a 3.3V regulator from the +5V_PI, and +3V3_PI is derived from it, and the MCU itself is powered from same, or something closely related; then: it might be a minimum on-time for S1, so you have to press and hold for... well about 47 seconds, or less if the MCU forces GPIO4 high sooner (hopefully with a pullup resistor, so it doesn't have to source/sink short-circuit current into that fat bastard 4.7uF!).
Yes, it's intended to provide startup and controlled shutdown of a Raspberry Pi board. The +3V3_PI is generated on board the Pi, derived from the incoming +5V_PI - so, the 3.3V doesn't come up until the Pi is powered on.
As I said previously, yes, I do believe there is supposed to be a minimum 'long press' on-time that S1 needs to be pressed for to initiate a power on. But as you say, 47 seconds would be ridiculous! It's my understanding that it is indeed actually an internal pull-up resistor on GPIO4 that is sourcing the current to charge the 4.7uF of C12. The Raspberry Pi technical documentation says that all GPIOs are inputs by default at reset, some with pull-up, some with pull-down; GPIO4 has a default pull-up (of approx. 50-65k).
So given that, I don't believe R14 is acting in any way to provide this minimum on-time for S1.
Note that D5+R11 acts to turn off Q2, if Q3 hasn't turned on yet. I don't really know why, perhaps they thought it necessary to somewhat decrease turn-off time?
Don't you mean "turn on" Q2? It is a P-channel MOSFET... Unless you meant "turn off" the gate, as in pulling the gate to ground.
Edit: I've just realised while playing around with the simulator that D5 & R11 don't appear to be strictly necessary - if that's why you were questioning them. It seems to work fine without them, although I'm thinking that perhaps they're present to provide plenty of wetting current through S1 - 5mA versus 45uA.
Q4 is also turned off immediately on switch press; presumably GPIO17 is a wake signal, or maybe a confirm-power-off signal. You'd think +3V3_PI going up would be reason enough to wake, but... again, can only go on assumptions here.
GPIO17 is intended to be an input to read the state of the power switch once the Raspberry Pi has booted up. At that point it is used as a shut-down signal. The idea is that you run a software daemon on the Pi that monitors the state of GPIO17, and if it finds the button has been held down (i.e. GPIO17 is high) for >1s, it initiates a controlled shut down of the system. The init system is also configured such that the very last thing the Pi does on shutdown is toggle GPIO4 from a pulled-up input to a low output, which dumps the charge from C12, shuts off Q3, which in turn shuts off Q2, cutting power to the Raspberry Pi.
(As I write this, I realise a series resistor should be added between GPIO4 and C12. IIRC, the GPIOs aren't rated to sink much current - something like 16mA - so dumping 4.7uF of charge through GPIO4 probably isn't a great idea. Will probably add a 1k resistor here.)
Note that Q2 needs to be a pretty big bastard itself, to have any hope of clearing a 2.5A fuse. Not to mention the +5V supply, likewise. This will never open on a typical 5V supply e.g. USB or net rated charger/PSU, which will brown out before opening a fuse. Which may lead to excess power dissipation in Q2 (as it can only pull down to -Vgs(th) plus a bit). It will be useful when the power supply has excess capacity (enough to clear the fuse, say 10A+).
Q2 is going to be a 10A-rated SO-8 MOSFET, so hopefully a big-enough bastard.
Likewise, the supply should be capable of around 5-6A. I would use a fast-blow fuse here too. I only added the fuse because the Raspberry Pi 4 actually ditched the on-board fuse (earlier models include a Bourns 2.5A MF-MSMF250/X), so thought it'd be prudent to have one on the off-board supply instead.
I'd rather the fuse be placed at the inlet, since the purpose of a fuse is almost always to protect the wiring, and there is a potential short-circuit path through Q2 and Q3 (transistors typically fail as three-way short when they do, at least until their bondwires or leads fuse). If for current limiting, I'd much rather just use a USB style load switch with integrated current limiting, ditch the discrete circuit.
I see what you mean about the potential short-circuit path. I'll move the fuse.
Where did you find this circuit?
This is the circuit used (with minor variation) in the
Pimoroni OnOff SHIM. I actually found the circuit schematic first, posted on a forum, and only later found it was from this product.
By looking at the photos of the PCB on that page, I can see that it does indeed actually have a 10M resistor populated. There
must be a reason why they designed it like that.
I've since been simulating the circuit:
link.
If I completely remove the 10M resistor (and its connection to 3.3V), the circuit functions perfectly well without it. So I am still mystified as to the purpose of this resistor.