6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Sep 27, 2024 3:34 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Power down circuit?
PostPosted: Mon Jul 27, 2020 2:07 pm 
Offline
User avatar

Joined: Mon May 12, 2014 6:18 pm
Posts: 365
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Power down circuit?
PostPosted: Mon Jul 27, 2020 2:56 pm 
Offline
User avatar

Joined: Thu May 14, 2015 9:20 pm
Posts: 155
Location: UK
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Power down circuit?
PostPosted: Mon Jul 27, 2020 3:56 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1467
Location: Scotland
Potentially a naive solution, but:

Attachment:
Screenshot_2020-07-27_16-36-04.png
Screenshot_2020-07-27_16-36-04.png [ 23.9 KiB | Viewed 645 times ]


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/


Top
 Profile  
Reply with quote  
 Post subject: Re: Power down circuit?
PostPosted: Mon Jul 27, 2020 9:39 pm 
Offline

Joined: Tue Jun 08, 2004 11:51 pm
Posts: 213
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Power down circuit?
PostPosted: Tue Jul 28, 2020 4:03 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8520
Location: Southern California
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?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 30 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: