Guide Soft Shutdown / Power-on Via Bluetooth

loopj

.
.
Joined
Feb 24, 2020
Messages
60
Likes
244
Location
Bay Area, CA
When we trim a Wii motherboard for a portable or miniature build, we trim off the stock power regulator circuits and replace them with our own. Most builds replace these power rails with something like the 4Layer Technologies RVL-PMS or CrazyGadget’s PSU-Plus.

Almost all regulator circuits used in portables use a simple yet effective approach to power switching - toggle a switch to immediately turn on all the power rails, toggle it again to turn off all the power rails. In reality, rather than using clunky toggle switches, most builds will use a momentary tact switch with some latching and debouncing logic implemented by a microcontroller (like the RVL-PMS), or a standalone on/off IC (like the MAX16054 in a GC Nano).

A stock, untrimmed Wii offers a couple of extra power features which we typically lose in portable builds, namely soft shutdown and power-on via Bluetooth. This guide discusses how these features work, and how you can implement these in your own builds.

Soft Shutdown
What is a soft shutdown?
When you press the power button on your Wii, it does not shut down the console immediately, it instead “asks” the running software to initiate a shutdown - a process known as a “soft shutdown”. Soft shutdowns are also initiated when you power off the console from a paired Wiimote, and in some cases purely through software.

So why is soft shutdown useful? Aside from enabling the “couch potato” convenience of power off from Wiimote, it also allows games/apps/homebrew to do a clean state-save before shutting down. In fact, some NES/SNES VC titles only save when you soft power off, which is the reason the Dolphin emulator implemented soft shutdown in 2017!

How does it work on a stock Wii?
On a stock Wii, soft shutdown is a conversation between the MX chip and Hollywood that goes something like this:
MX: “Hey dude please can you shut down now?”
Hollywood: “Sure give me a second to clean up”
Hollywood: “Ok, I’m done, shut off the power”
MX: “I got you bro”
In reality there are two GPIOs on the Hollywood chip that handle soft shutdown, the POWER GPIO output, and the SHUTDOWN GPIO input. Both GPIOs operate at a 3.3V logic level.

Sending a short (~30ms) HIGH pulse to the POWER GPIO initiates the software shutdown process. This pulse generates an event in software-land and is used to trigger a clean shutdown. In homebrew apps, for example, sending a pulse to the POWER GPIO will trigger the callback set by libogc’s SYS_SetPowerCallback(...).

Once apps/games have done their pre-shutdown housekeeping, they will then indicate to the system they are now ready to really shut down. In homebrew apps, you would typically call SYS_ResetSystem(SYS_POWEROFF_STANDBY, 0, 0) to initiate this.

Once the system has done all its internal shutdown handling, a short (~120ms) HIGH pulse is sent back to Hollywood’s SHUTDOWN GPIO.

How can I implement this myself?
On a stock Wii, the sending and receiving of these pulses is handled by the MX chip, but if you are implementing your own power supply with a microcontroller, you can do this yourself with a couple of magnet wires and a few lines of code.

The POWER and SHUTDOWN GPIOs are available on the following vias:
Screenshot 2024-03-24 at 5.13.58 PM.png


If you want to just respond to a “software initiated shutdown” then you’ll need to wire your microcontroller to the SHUTDOWN GPIO via, and detect when the pin goes high.

If you want to initiate a soft shutdown yourself, (eg. triggered by a power button press) you will additionally need to wire your microcontroller to the POWER GPIO via, and send a ~30ms HIGH pulse when your power button is pressed.

Something like the following Arduino pseudo-code should work, but you may want to consider using interrupts and timers instead.

C++:
// Check if the power button is pressed
if (digitalRead(POWER_BUTTON_PIN) == LOW) {
  if (!regulatorsEnabled) {
    // Enable the regulators if they are not already enabled
    enableRegulators();
  } else {
    // Otherwise, send the "soft shutdown" signal to the Wii
    digitalWrite(WII_POWER_GPIO_PIN, HIGH);
    delay(POWER_PULSE_LENGTH);
    digitalWrite(WII_POWER_GPIO_PIN, LOW);
  }
}

// Check for the "soft shutdown complete" signal from the Wii
if (digitalRead(WII_SHUTDOWN_GPIO_PIN) == HIGH) {
  // Disable the regulators
  disableRegulators();
}

Power-on via Bluetooth
So now we can turn off our console using a Wiimote, but wouldn’t it also be cool if you could turn on your console from the couch?

For a fully portable build where you are holding the console in your hands, power-on via Bluetooth is almost certainly not worth implementing. The additional ~40mA of power draw required to keep the Bluetooth module powered has a meaningful impact on battery life. However, if you are building a dockable portable, or a miniaturized console like the GC Nano, implementing this feature enables the ultimate couch potato experience.

How does it work on a stock Wii?
A stock Wii has 6 “main” power rails (1V, 1.15V, 1.8V, 3.3V, 5V, 12V), and a single “standby” 3.3V power rail. The standby power rail is mainly used to power the Bluetooth module and the MX chip.

When the power button on a paired Bluetooth device (such as a Wiimote) is pressed for more than 1 second, the Bluetooth module will detect this and send a ~110ms HIGH pulse to the MX chip. The MX chip detects this pulse, and subsequently enables the main regulators.

How can I implement this myself?
If you are implementing your own power supply with a microcontroller, you can again implement this yourself with a couple of lines of code and a single GPIO.

Your Bluetooth module and microcontroller must be powered by an “always on” standby power rail for this to work. On my non-portable builds powered by USB, I’ve used a 500mA linear regulator to step down to a 3.3V standby rail from the 5V USB power input. On portables, you’ll need a regulator to step down to 3.3V from your battery voltage. You may wish to consider a buck/boost regulator in this case, to continue powering your standby rail even when the battery drops below 3.3V.

Wire your microcontroller to pin 5 of the Bluetooth module, and write some code to detect the HIGH pulse from this pin. Something like this Arduino pseudo-code should work, but you might want to consider using interrupts.

C++:
// Check for the "Bluetooth power request" signal
if (digitalRead(BT_PWR_REQ_PIN) == HIGH) {
  // Enable the regulators if they are disabled
  if(!regulatorsEnabled) {
    enableRegulators();
  }
}
It is worth noting that this pulse is sent by the Bluetooth module any time the power button on a paired remote is pressed and held for more than a second, even if the console is already on. If you aren’t implementing full soft shutdown functionality, you could also use this pulse to power off your regulators as well as powering them on.

One more thing…
While I was researching this project, I took some time to further document the pinout of the Bluetooth module.

Screenshot 2024-03-06 at 8.46.29 PM.png


One tangential discovery was that, contrary to the Wii trimming guide, you don’t have to provide 3.3V to pin 13 of the Bluetooth module. This pin seems to act like a “reset” for the Bluetooth module, and is internally pulled-up to 3.3V. So that’s one less wire you’ll need on portable builds with Bluetooth!

Fin
Hopefully this is helpful! Let me know if you implement any of these features on your own builds. Thank you to @YveltalGriffin and @Y2K for taking a look at this before I posted, and to @Aurelio for pointing me in the right direction for exploring the Hollywood GPIOs.
 
Last edited:
Joined
Jan 27, 2023
Messages
85
Likes
44
Location
MX
Portables
3 Trims, 1 Portable, 2 Tabletop
Thanks a lot for sharing your knowledge about little forgotten things like this, great work!!

This is useful for ones like me that are searching alternatives for the custom pcb boards and do everything by your own

I have a little question… If you wire a button (or send a signal by a microcontroller) to POWER and you hold that button, the console turns off like the stock wii?
 
Last edited:

loopj

.
.
Joined
Feb 24, 2020
Messages
60
Likes
244
Location
Bay Area, CA
If you wire a button (or send a signal by a microcontroller) to POWER and you hold that button, the console turns off like the stock wii?
On an untrimmed wii, yes pulsing POWER high will turn off the Wii. On a trimmed Wii with custom regs, you will need to wait for the "reply" pulse on the SHUTDOWN gpio, and then disable the regulators yourself.
 
Joined
Jan 27, 2023
Messages
85
Likes
44
Location
MX
Portables
3 Trims, 1 Portable, 2 Tabletop
On an untrimmed wii, yes pulsing POWER high will turn off the Wii. On a trimmed Wii with custom regs, you will need to wait for the "reply" pulse on the SHUTDOWN gpio, and then disable the regulators yourself.
Ok, thanks again!
 
Top