Power down circuit?

Let's talk about anything related to the 6502 microprocessor.
Post Reply
User avatar
Druzyek
Posts: 367
Joined: 12 May 2014
Contact:

Power down circuit?

Post by Druzyek »

I'm trying to figure out a circuit to power down my 6507-based calculator. The IDT6116 SRAM will retain it's contents down to 2v, so the plan is to back it up with a coin cell battery and cut power to everything else when the device is switched off. The problem is, the 6507 needs some warning that the power is about to be cut so that it can finish its current task and stop writing to RAM. Is there a standard way to accomplish this?

One idea is to have the on/off switch enable power when it's switched on but somehow only pull the interrupt line down when it's switched off so the 6507 can see the request and cut its own power. It seems like this might work if I had a power transistor driven by the power switch when the switch is on but driven by the RIOT when the switch is off with a pull-up so that the transistor stays off when the RIOT loses power and the switch hasn't been turned back on again.

Another idea would be to have a one-shot 555 timer or reset chip that starts the timer on the 555 running and also fires an interrupt when the off button is pressed. The 6507 receives the interrupt and knows how much time it has to finish its work before the 555 controlling the power resistor cuts power to everything.
User avatar
1024MAK
Posts: 155
Joined: 14 May 2015
Location: UK

Re: Power down circuit?

Post by 1024MAK »

What type of power switch are you (intending) on using?

A method that is used on some specialist battery powered equipment that we have is to have two push buttons. One is a push to make power button used to start the system (“ON”). The other is just part of a matrix keyboard and is the “OFF” button.

When pushed, the ON button feeds the battery power to the main system power rail (including a large electrolytic capacitor). The microprocessor then starts up, outputs a signal to a power transistor, which then takes over after the user has removed their finger from the ON button.

When the user wants to power off, or if it detects the battery voltage is low (don’t know how this particular system works, but a simple voltage comparator to a one bit input pin may be enough or use one of the brown out/reset chips that are available), the microprocessor then can finish it’s current task and then turn off the transistor that is in parallel with the ON button.

Modern microcontoller systems instead use a special sleep mode that can be woken up when the interrupt pin sees a change of state, so they never power off completely.

Mark
User avatar
drogon
Posts: 1671
Joined: 14 Feb 2018
Location: Scotland
Contact:

Re: Power down circuit?

Post by drogon »

Potentially a naive solution, but:
Screenshot_2020-07-27_16-36-04.png
Diode is some low drop type or Schottky if powering from batteries..

You could even power the display backlight (if it has one) from the /IRQ connection to give the capacitor more chance to keep powering the rest of the circuit while the 6507 does it's save-state and safe halt thing...

(Or take IRQ through a resistor - say 10x the one connecting it to Gnd if you're not happy connecting it directly to supply)

-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
dwight
Posts: 213
Joined: 08 Jun 2004

Re: Power down circuit?

Post by dwight »

Use a relay on the AC. With a double pole switch you can keep track of when it is off and use an additional path through another relay to drive the mains relay.
As for the 6116, make sure to keep the enables\ pulled high. I've seen a circuit where they didn't do this and it flattened the battery in a day. W\, OE\ and CE\
Dwight
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: Power down circuit?

Post by GARTHWILSON »

See the post at viewtopic.php?p=32004#p32004 for a simple way to do the battery backup. Then have the processor do SEI and then write to a port bit to turn things off, and go into an infinite do-nothing loop while the power is going down.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Post Reply