User avatar
VeryNoob
Posts: 49
Joined: Thu Feb 14, 2013 1:07 pm
Location: Australia

3B+ PEN & RUN Header

Wed Mar 14, 2018 11:58 pm

The 3B+ seems to have a change to the RUN header. RUN I assume has the same functionality, in that it's pulled high to allow the Raspberry Pi to run, and pulled low to reset.

This comment on the announcement blog page seems to indicate that PEN can be used for shutdown. Will pulling it low put it into an off like state? I assume there aren't any smarts that lets it sudo shutdown first.

gregeric
Posts: 1509
Joined: Mon Nov 28, 2011 10:08 am

Re: 3B+ PEN & RUN Header

Thu Mar 15, 2018 8:56 am

The schematic shows PEN by default (nothing connected) is pulled high with 1k8. Pull it low & the PMIC draws < 10uA according to the ds.

But you'll need 2-3mA flowing through that pullup to provide a logic low on that pin. So shutdown/standby to the tune of 2-3mA looks possible. It's a safe shutdown in respect of silicon latchups, but not software.

Zebu
Posts: 29
Joined: Tue Aug 11, 2015 1:57 am
Location: Australia

Re: 3B+ PEN & RUN Header

Thu Mar 15, 2018 9:45 am

gregeric wrote:
Thu Mar 15, 2018 8:56 am
It's a safe shutdown in respect of silicon latchups, but not software.
I'm getting windows 98 flashbacks

Image

User avatar
VeryNoob
Posts: 49
Joined: Thu Feb 14, 2013 1:07 pm
Location: Australia

Re: 3B+ PEN & RUN Header

Thu Mar 15, 2018 9:51 pm

Brilliant. I'm thinking an ATTiny would be perfect to control this. Run it from the 5v line which will still have power, check that the TX line is high, and if it's been low for a minute or so, cut power. Push a button to disconnect from ground and let it boot up.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2030
Joined: Thu Jul 11, 2013 2:37 pm

Re: 3B+ PEN & RUN Header

Thu Mar 15, 2018 9:54 pm

VeryNoob wrote:
Wed Mar 14, 2018 11:58 pm
The 3B+ seems to have a change to the RUN header. RUN I assume has the same functionality, in that it's pulled high to allow the Raspberry Pi to run, and pulled low to reset.

This comment on the announcement blog page seems to indicate that PEN can be used for shutdown. Will pulling it low put it into an off like state? I assume there aren't any smarts that lets it sudo shutdown first.
If PEN is pulled low, then the PMIC shuts down the on-board power supplies in a controlled manner. The current consumption is limited to about 3mA (the PWR LED is still illuminated, and the pull-up on PEN consumes current). It is intended to be used in conjunction with an external board (HAT) that provides a UPS-like or battery-operated function.
Rockets are loud.
https://astro-pi.org

User avatar
VeryNoob
Posts: 49
Joined: Thu Feb 14, 2013 1:07 pm
Location: Australia

Re: 3B+ PEN & RUN Header

Thu Mar 15, 2018 11:04 pm

Thanks guys. This is actually the feature I am most excited about. Not that the speed boost on the CPU and networking isn't nice too.

mikerr
Posts: 2770
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: 3B+ PEN & RUN Header

Fri Mar 16, 2018 4:46 pm

So now I can software halt the pi down to 11mA (instead of the normal 100mA+)

- Wire a 200 ohm resistor (to be safe) from GPIO 26 to PEN
- add this to /boot/config.txt

Code: Select all

dtoverlay=gpio-poweroff,active_low=y
and reboot

Then you can

Code: Select all

sudo halt
which will safely shutdown raspbian, then finally bring GPIO26 / PEN low to shut off power.

Image

:D
Android app - Raspi Card Imager - download and image SD cards - No PC required !

gregeric
Posts: 1509
Joined: Mon Nov 28, 2011 10:08 am

Re: 3B+ PEN & RUN Header

Fri Mar 16, 2018 6:06 pm

Wonder why you are seeing 11mA and not less? Also wondering if the thing will spring into life at some point, as the power has been removed from the gate in the SoC which you are using to pull down PEN.

hippy
Posts: 5583
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: 3B+ PEN & RUN Header

Fri Mar 16, 2018 6:26 pm

jdb wrote:
Thu Mar 15, 2018 9:54 pm
If PEN is pulled low, then the PMIC shuts down the on-board power supplies in a controlled manner.
Am I correct that the PMIC PG2 output will hold the SoC in reset when PEN is then allowed to float high, will release the SoC from reset only when it is safe to do so ?

If so it seems we could use mikerr's suggestion above, plus a button and maybe a few resistors to have a completely passive circuit to allow reboot from the 'nearly off' state.

mikerr
Posts: 2770
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: 3B+ PEN & RUN Header

Fri Mar 16, 2018 7:15 pm

Purely practical results (as we don't have schematics or docs yet):

It stays in that 11 mA state after the PEN-GPIO connection is released,
but will boot up again if PEN-GPIO is then reattached

I.e. an inline normally closed momentary pushbutton functions as a restart button:

Image
Last edited by mikerr on Sat Mar 17, 2018 1:31 pm, edited 2 times in total.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

gregeric
Posts: 1509
Joined: Mon Nov 28, 2011 10:08 am

Re: 3B+ PEN & RUN Header

Fri Mar 16, 2018 8:02 pm

mikerr wrote:
Fri Mar 16, 2018 7:15 pm
It stays in that 11 mA state after the PEN-GPIO connection is released,
but will boot up again if PEN-GPIO is then reattached
Who could've predicted that? I think you might be operating in "undefined behaviour" territory, but don't wish to dissuade you from further experiments. I got the Pi3 down to < 1mA with some minor surgery: viewtopic.php?f=29&t=182267&p=1157045#p1157045

mikerr
Posts: 2770
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: 3B+ PEN & RUN Header

Fri Mar 16, 2018 8:09 pm

Yes, purely empirical, works for me,YMMV etc

We'll have to wait to see if that's the proper way to do it :lol:

As for why as much as 11mA ... the red power LED is solid on.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

gregeric
Posts: 1509
Joined: Mon Nov 28, 2011 10:08 am

Re: 3B+ PEN & RUN Header

Fri Mar 16, 2018 8:25 pm

Don't think that wee power LED will account for the 'excess' current. Pure coincidence (?) but 11mA is what i got on the Pi3 with Vcore & 1V8 turned off, 3V3 still up.

hippy
Posts: 5583
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: 3B+ PEN & RUN Header

Sat Mar 17, 2018 8:54 pm

mikerr wrote:
Fri Mar 16, 2018 7:15 pm
an inline normally closed momentary pushbutton functions as a restart button
Excellent news. Hopefully it wouldn't be too hard to make it work with more commonly available push-to-make buttons, pulling PEN up to 3V3.

PEN/GLOBAL_EN is 5V tolerant so a hard short to 5V should notionally work, but that's risky when GPIO is not 5V tolerant if using that for the 'off', as might be any other user-added PEN monitoring circuit, and we don't know what else connects to that signal.

Your 11mA is good, better than around 100mA. It would be nice to know what is drawing the current. The power LED will probably be consuming about 4mA, the PEN pull-up about 2.5mA, the Transorb over-voltage protector, the PMIC and high-side switch for HDMI 5V should not be drawing much. So there's about 4-5mA unaccounted for.

Without a full circuit diagram it is impossible to say what may be connected to 5V without testing every connection. I guess one could start unsoldering components to see what changes the current.

5V used to go to the BCM2835 but would guess not with the BCM2837B0 or is PMIC switched. That really only leaves WiFi/BT or LAN7515. Maybe there's some Wake-On-LAN supply for the later?

Return to “General discussion”