1

I'm building a circuit with a single on/off switch.
"On" turns on the circuit, which includes a SBC currently running on Windows that runs the GUI (Labview).
"Off" powers of the circuit, including the SBC.
I'd like to keep a single switch that turns everything "Off", without corrupting the computer memory / hard disk to ensure smooth startup each time. Is that possible and what solutions exist?

Seth Shill
  • 71
  • 1
  • 3
  • 9
  • 2
    Your question is unclear. Can you edit to show the sequence of steps you require - one step per line of text. Start with, "The on/off button is switched off ...". – Transistor Mar 19 '20 at 20:11
  • In the title, did you mean `allow me to do a soft powerdown (and graceful system shutdown) instead of abrubtly cutting the power` instead? Because as it is now `cut power instead of powering down?` it means the other way, and in this case pretty any "switch" can be used, a relay, a optoswitch, a transistor.. – quetzalcoatl Mar 19 '20 at 20:28
  • if you run it using a ramdisk then you can cut power at any time and wont corrupt your non-volatile storage (assuming the non-volatile storage is never touched except during boot). somewhat simple to do with linux not sure about windows, labview used to support linux but that was a lot of years ago since I tried... – old_timer Mar 19 '20 at 20:33
  • @old_timer this would require putting the whole operating system on ramdisk? I don't understand...the main advantage here seems to be speed, not corruptibility. What makes using ramdisk less likely to corrupt than a hard disk? – Seth Shill Mar 20 '20 at 14:28
  • if the non volatile storage is in play then a transaction to that storage can be in flight when the power goes out and corrupts that file/directory. running only in ram you cannot corrupt it on a power outage. yes you lose everything that has happened during power on, but the embedded system survives to run again. perhaps I dont understand the question. – old_timer Mar 20 '20 at 14:34
  • looks like you re-wrote the question. – old_timer Mar 20 '20 at 14:35
  • if you want to preserve everything then you have to as answered have additional power, enough for the worst case to copy ram to the hard drive or other non-volatile media, have that complete then power down what is inside that battery/other backed domain. – old_timer Mar 20 '20 at 14:48
  • Just trying to understand. RAM will contain the current state - so by storing it on the hard drive, you mean it would need to shut down like a normal computer would by selecting power down in the menu? – Seth Shill Mar 20 '20 at 14:57

1 Answers1

0

Buffer your board with an accu or an battery. As soon there are no changes anymore save your values. On bootup reload the saved values.

Bill
  • 162
  • 1
  • 1
    In my case I'm not storing values. But I assume the original machine state would need to be stored - so that the OS can start up normally without corruption on power up. Either way, how would the battery be used? Are you thinking using this as the power source instead and then main switch can be used to trigger a proper power down on the SBC? – Seth Shill Mar 20 '20 at 14:47