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.