Modifying PowerSwitch to act as a USB PC Watchdog
Posted: Mon Feb 21, 2011 10:42 pm
Goal would be to make a device that attaches to a PC motherboards USB and Reset headers. After getting power it would wait until it receives an Ascii string like "Hello 120" after which it would wait 120 seconds for another string like that and if there is no other string it would latch the Reset pin of the motherboard to GND for 1 second and then the device would reset itself also.
The example project called 'PowerSwitch' http://www.obdev.at/products/vusb/powerswitch.html seems to be really close to what I want. It even has a feature where you can switch the relays to a certain state for a duration of time and the delay is implemented on the microcontroller. However there are few things that would need to be done before PowerSwitch could be used as a watchdog timer:
Let's say you wire the reset header to relay output #2 and the state of the relay is 'off' in the eeprom. And if you did './PowerSwitch off 2 120' the output #2 would switch to state 'on' after 120 seconds. Also it would only have to be in state 'on' for 1 second. Then the firmware should reset itself. So then you could just keep executing the command './PowerSwitch off 2 120' to keep the output #2 off, and when your computer crashes it would stop refreshing the 'off' state and that would cause a reset of your computer.
After spending few hours trying to understand how PowerSwitch firmware works I gave up because I have no idea what all the bitwise operations do. But I realized that the modifications I need are probably only few lines of code. Can someone familiar with the project help me out?
The example project called 'PowerSwitch' http://www.obdev.at/products/vusb/powerswitch.html seems to be really close to what I want. It even has a feature where you can switch the relays to a certain state for a duration of time and the delay is implemented on the microcontroller. However there are few things that would need to be done before PowerSwitch could be used as a watchdog timer:
Let's say you wire the reset header to relay output #2 and the state of the relay is 'off' in the eeprom. And if you did './PowerSwitch off 2 120' the output #2 would switch to state 'on' after 120 seconds. Also it would only have to be in state 'on' for 1 second. Then the firmware should reset itself. So then you could just keep executing the command './PowerSwitch off 2 120' to keep the output #2 off, and when your computer crashes it would stop refreshing the 'off' state and that would cause a reset of your computer.
After spending few hours trying to understand how PowerSwitch firmware works I gave up because I have no idea what all the bitwise operations do. But I realized that the modifications I need are probably only few lines of code. Can someone familiar with the project help me out?