Power Button Uzebox v1.2

What is a Uzebox? How can I get one? Check here!
Post Reply
ccm_1052_tacks
Posts: 2
Joined: Mon Feb 01, 2016 5:06 am

Power Button Uzebox v1.2

Post by ccm_1052_tacks » Mon Feb 01, 2016 5:11 am

I just finished assembly on my uzebox v1.2 and everything works as expected except for the power button. This seems to have no function as the unit starts automatically on being plugged in and does not seem to turn the unit off once powered either. Is this normal?

User avatar
D3thAdd3r
Posts: 2392
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Power Button Uzebox v1.2

Post by D3thAdd3r » Mon Feb 01, 2016 5:34 am

Yes it is normal as the kernel doesn't yet do anything with the power button. It is funny after all these years that detail only had attention a couple times.

I'd assume it would be rather small and trivial to add something that runs around the time game pads are read(where it checks for the button combination for softreset). A bit too lazy to check which pins to write the real code and all that, should probably be in assembly anyway. So as pseudocode I would say

Code: Select all

    if(PowerButtonDown()){
        while(PowerButtonDown());//wait for release
        SetLedOff();//turn off LED
        TurnAD725Off();//turn off display
        TurnSDOff();//don't let SD drain too much power
        TurnESP8266Off();//this module drinks the power
        TurnSPIRamOff();//low power the expansion ram

        //essentially the machine is as low power as can be and looks turned off now
        while(!PowerButtonDown());//pushed again
        while(PowerButtonDown());//released
        SoftReset();//reset the machine to appear as a cold boot
    }
gives us power button functionality as we would expect.

User avatar
D3thAdd3r
Posts: 2392
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Power Button Uzebox v1.2

Post by D3thAdd3r » Mon Feb 01, 2016 5:57 am

Eh, naturally throw in some debounce delay in there since it is a physical contact button.

ccm_1052_tacks
Posts: 2
Joined: Mon Feb 01, 2016 5:06 am

Re: Power Button Uzebox v1.2

Post by ccm_1052_tacks » Tue Feb 02, 2016 6:16 am

Thanks D3thAdd3r!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest