'soft' power

Topics regarding the Uzebox hardware/AVCore/BaseBoard (i.e: PCB, resistors, connectors, part list, schematics, hardware issues, etc.) should go here.
havok1919
Posts: 474
Joined: Thu Aug 28, 2008 9:44 pm
Location: Vancouver, WA
Contact:

'soft' power

Post by havok1919 »

While I'm waiting for the stamp PCB's to arrive I decided to make up some of the baseboards. One feature I thought would be cool was 'soft' power. (AKA, a momentary pushbutton that you press once to turn power on and press again to turn power off.) I wanted something small and inexpensive, so a little tact switch fit the bill. (Push on/push off toggle switches tend to be big and/or expensive.)

So, I was about half way into a little circuit with a CD4027 driving a MOSFET when I got to thinking... Why not just have that as a build option in the code? We'd just call one pin the "power" pin if the option is enabled. When the UZEBOX boots (immediately when power is applied) if the 'soft power' option is in the code the CPU just gets things set up and waits (without generating video or audio). When it sees that line go low-- the "power" bit can go on, and video and everything starts. Could even just sleep the CPU and use a pin change interrupt to wake and power up.

Then, in the vblank routine just checks the state of the 'power' pin. If it's low again for ~30 consecutive frames, turn video off and go back to sleep. Could use another line as an output for a 'power' LED (which could also double as an SD 'access' LED).

(Along the same lines, we could have two functions on the 'power' button when the system is up and running... If you press and hold the button for, say, ~250ms it goes into 'off' state (video/etc. off), but if you keep it held down for ~1000ms then we do a JMP 0x0000 for a 'cold start'. If we come up in cold start with that GPIO low, then we jump into our non-ISP programming bootloader mode?)

Whatcha think, Uze?

-Clay
CompMan
Posts: 91
Joined: Mon Aug 25, 2008 3:48 am
Location: Kent, WA

Re: 'soft' power

Post by CompMan »

Sounds good to me. I was thinking of just a push button but your way would work also.

Compman
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: 'soft' power

Post by uze6666 »

Whatcha think, Uze?
As always, a good idea ;). Actually, I envisioned it myself when I made my case design. The blue led switch, is actually real (Bulgin MPI002) and is a temp-on. The led and switch could be replicated on the baseboard's header so I could finally build my case! So let's reserve two more pins for that.
case.jpg
case.jpg (8.45 KiB) Viewed 5124 times
Cheers,

Uze
havok1919
Posts: 474
Joined: Thu Aug 28, 2008 9:44 pm
Location: Vancouver, WA
Contact:

Re: 'soft' power

Post by havok1919 »

Holy crap... Just exactly how violent were you planning on being with your power switch? :lol:

Very cool switch. I thought you were just "visualizing" it. Bonus points for actually having something you can buy!

Any preference on pins? It looks like PD3 and PD4 might be the next 'least interesting' ones to use (PD3 could the be the switch and PD4 the LED?)...

-Clay
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: 'soft' power

Post by uze6666 »

Perfect for me as it leaves a least 1 INT pin free.

PD2 (PCINT26/INT0) : free
PD3 (PCINT27/INT1) : Power-on Switch
PD4 (PCINT28/OC1B) : LED (power/SD access)

Uze

ps: The case exists too, it's a Hammond, nice huh?
havok1919
Posts: 474
Joined: Thu Aug 28, 2008 9:44 pm
Location: Vancouver, WA
Contact:

Re: 'soft' power

Post by havok1919 »

uze6666 wrote:Perfect for me as it leaves a least 1 INT pin free.
Yeah, that's what I was thinking too. And if anyone really needed INT1 they could just have a 'hard' power switch and use it instead.
ps: The case exists too, it's a Hammond, nice huh?
That's a nice one alright. I sense case price higher than electronics... ;-)

Any distributors have those in stock yet?

-Clay
CompMan
Posts: 91
Joined: Mon Aug 25, 2008 3:48 am
Location: Kent, WA

Re: 'soft' power

Post by CompMan »

havok1919 wrote:Any distributors have those in stock yet?
Digi-Key sells Hammond cases. Supposedly Hammond will send you free parts if you call them up.

Compman
havok1919
Posts: 474
Joined: Thu Aug 28, 2008 9:44 pm
Location: Vancouver, WA
Contact:

Re: 'soft' power

Post by havok1919 »

CompMan wrote:Digi-Key sells Hammond cases. Supposedly Hammond will send you free parts if you call them up.
Yep-- they've sampled me stuff on a couple of occasions, but they were of the $5-7 plastic variety, not sure if they're as generous with the $30+ metal ones. ;-)

-Clay
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: 'soft' power

Post by uze6666 »

The cases are Digikey:HM894-ND. They have full aluminum and aluminum+plastic caps.

Speaking of sampling, did you guys had any chance with Atmel's samples? I tried getting samples many times for the 1284 and never got any response.

Uze
havok1919
Posts: 474
Joined: Thu Aug 28, 2008 9:44 pm
Location: Vancouver, WA
Contact:

Re: 'soft' power

Post by havok1919 »

uze6666 wrote:The cases are Digikey:HM894-ND. They have full aluminum and aluminum+plastic caps.
Not bad! I guess I was looking at the NEMA rated one for more $$$. ;-)
Speaking of sampling, did you guys had any chance with Atmel's samples? I tried getting samples many times for the 1284 and never got any response.
I usually go through Avnet for samples-- they never seem to have trouble getting me stuff, although for unreleased parts going direct to Atmel is generally best. I'm actually having lunch with the Atmel regional guys tomorrow; I'll ask about the '1284.

-Clay
Post Reply