Tackling Graceful Shutdowns on the GBZ

Various user-contributed guides for software-related things
User avatar
Popcorn
Trailblazer
Trailblazer
Posts: 354
Joined: Thu May 05, 2016 12:58 am
Location: Berlin
Has thanked: 29 times
Been thanked: 71 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by Popcorn » Thu May 26, 2016 2:00 am

Actually, there is voltage on the LBO pin. And also surprising on the EN pin too! It goes up to VBAT. You certainly can't map that to a GPIO. I came up with a working solution to the last remaining piece of mine.

I replaced the planned "reset button" with an actual latching on/off button. Lol. That will be recessed so it can't be hit unintentionally. This is to allow you to do manual reset but also to be able to disconnect the battery from the Powerboost, if you are putting away the unit for longer periods of time.

So think of the main power slide switch now as ON/STANDBY. Where the latching switch is a physical disconnect of the batteries.

I realized that without the EN pin closed, there will always be a little draw off the batteries, even if it's to power that little blue led of powerboost and nothing else, regardless, it's some draw. And leaving the unit on "STANDBY" for long periods of time will eventually drain the battery. This is the only solution, since any solution using an electronic switch to close EN either is drawing off the batteries too and adding more components.

I'm cool with this. It solves everything and gives us our graceful shutdowns the way we want.

prerunnerseth
Posts: 279
Joined: Fri May 06, 2016 5:36 pm
Has thanked: 16 times
Been thanked: 229 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by prerunnerseth » Thu May 26, 2016 5:33 am

Popcorn wrote:Actually, there is voltage on the LBO pin. And also surprising on the EN pin too! It goes up to VBAT. You certainly can't map that to a GPIO. I came up with a working solution to the last remaining piece of mine.

I replaced the planned "reset button" with an actual latching on/off button. Lol. That will be recessed so it can't be hit unintentionally. This is to allow you to do manual reset but also to be able to disconnect the battery from the Powerboost, if you are putting away the unit for longer periods of time.

So think of the main power slide switch now as ON/STANDBY. Where the latching switch is a physical disconnect of the batteries.

I realized that without the EN pin closed, there will always be a little draw off the batteries, even if it's to power that little blue led of powerboost and nothing else, regardless, it's some draw. And leaving the unit on "STANDBY" for long periods of time will eventually drain the battery. This is the only solution, since any solution using an electronic switch to close EN either is drawing off the batteries too and adding more components.

I'm cool with this. It solves everything and gives us our graceful shutdowns the way we want.
Did you remove the transistor and LED? There shouldnt be any voltage on an open collector output pin unless you put it there with a pull up of some sort. the Transistor used in this that circuit has a pull up built into it. If there is voltage on that pin with nothing connected to it. then it is just leakage internal to the chip and means its a bit of a poorly designed chip. None of our chips would have voltage on an open collector output pin. The EN pin also has a pull up on it that must be removed before the voltage will go away.

R13 and T1 need to be removed or pulled up to 3.3V instead of VBAT.

I still like the way of driving a NMOS or NPN with the LED side of this. This will be a much stronger pull down and keep you from losing the LED.
pullup.jpg
pullup.jpg (126.13 KiB) Viewed 8380 times

User avatar
Popcorn
Trailblazer
Trailblazer
Posts: 354
Joined: Thu May 05, 2016 12:58 am
Location: Berlin
Has thanked: 29 times
Been thanked: 71 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by Popcorn » Thu May 26, 2016 9:53 am

Sadly no. It was all working well, so I soldered and glued it directly onto the Pi. Now, I don't want to remove it at this point. I'll test it out on the second GBZ I build after this one though.

SidSilver
Posts: 263
Joined: Sun May 22, 2016 6:22 am
Location: France
Has thanked: 137 times
Been thanked: 37 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by SidSilver » Thu May 26, 2016 10:49 am

This little things are cheap, that's nice but not easy to find and the shipping fee are 3 time the price of the PCB... :evil:
I need to find this with low shipping to France !

User avatar
Popcorn
Trailblazer
Trailblazer
Posts: 354
Joined: Thu May 05, 2016 12:58 am
Location: Berlin
Has thanked: 29 times
Been thanked: 71 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by Popcorn » Thu May 26, 2016 10:53 am

SidSilver wrote:This little things are cheap, that's nice but not easy to find and the shipping fee are 3 time the price of the PCB... :evil:
I need to find this with low shipping to France !
I bought my pololu switch from exp-tech.de. Shipping is reasonable.

SidSilver
Posts: 263
Joined: Sun May 22, 2016 6:22 am
Location: France
Has thanked: 137 times
Been thanked: 37 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by SidSilver » Thu May 26, 2016 11:08 am

Popcorn wrote:
SidSilver wrote:This little things are cheap, that's nice but not easy to find and the shipping fee are 3 time the price of the PCB... :evil:
I need to find this with low shipping to France !
I bought my pololu switch from exp-tech.de. Shipping is reasonable.
exp-tech.de charges 9€ to France :(

The best i've found is Gotronic with 5,90€ fees to France.
http://www.gotronic.fr/art-module-inter ... -24232.htm
It makes the board to 9,90€ shipping included

User avatar
Synnth3t1k
Posts: 22
Joined: Wed May 11, 2016 9:11 pm
Location: Maryland

Re: Tackling Graceful Shutdowns on the GBZ

Post by Synnth3t1k » Thu May 26, 2016 8:17 pm

A little off topic, but with this way of shutting down, with an electronic switch. Is there a way to be able to have a "spring loaded" switch that you could flick it over and make the GBZ go into a sleep mode or stand by, instead of fully turning off? Kind of like a GameBoy SP.

User avatar
Popcorn
Trailblazer
Trailblazer
Posts: 354
Joined: Thu May 05, 2016 12:58 am
Location: Berlin
Has thanked: 29 times
Been thanked: 71 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by Popcorn » Thu May 26, 2016 9:32 pm

Synnth3t1k wrote:A little off topic, but with this way of shutting down, with an electronic switch. Is there a way to be able to have a "spring loaded" switch that you could flick it over and make the GBZ go into a sleep mode or stand by, instead of fully turning off? Kind of like a GameBoy SP.
I took a cursory look at it before. It wouldn't work like a quick suspend that you are thinking about because the Pi still needs to do the shutdown and dismounting for it to safely shut off

However, it seems that retroarch does support game saving and loading from quit state. But I wasn't able to figure out how to trigger a save from a kill signal yet. If we can figure that out, it is possible that we could make it load some type of config file on the next boot This way it could boot back up to the last game state you were at. I need to explore this more, at least for retroarch. Not sure about the other emus.

I didn't dig into it too far because up until now, I was focused on the low level stuff. Lemme look into it.

prerunnerseth
Posts: 279
Joined: Fri May 06, 2016 5:36 pm
Has thanked: 16 times
Been thanked: 229 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by prerunnerseth » Fri May 27, 2016 5:25 am

My boards will be in today. Hope to find time to build one up and test today. If not I will come in to work tomorrow to do it. I'll post some pictures and video.

prerunnerseth
Posts: 279
Joined: Fri May 06, 2016 5:36 pm
Has thanked: 16 times
Been thanked: 229 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by prerunnerseth » Fri May 27, 2016 4:04 pm

Well my boards came in and I made a mistake :(. I used a different package of mybpushbutton controller than tested with and it seems one of the missing pins was actually needed. I'll have to order more

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest