Modular Shutdown Controller with USB Interface
First off, I am primarily documenting this project on my website at:
http://eegeek.net/content/view/40/32/
So, there may be better (or at least more concise) information there.
This project is the next revision of my original shutdown controller. It's been in the works for quite a few months now, primarily due to the very long, steep learning curve associated with interfacing USB on a PIC microcontroller.
The central premise of this project is that the SDC has all of the 'traditional' SDC features, but adds two important factors: USB interface, and a modular architecture.
USB Interface: This serves several important purposes.
-The most important purpose is that it gives the SDC an unprecedented level of control over the power state of the PC. 'Regular' SDC's use the PC's power button only and as such have limited control over power states. With the USB interface, the SDC can order the PC into any power state through software(standby, hibernate, shutdown). The most interesting application (IMHO) is that the PC can be placed into standby, and if left alone for too long, booted back up, and then put into hibernate.
-The USB interface also provides interface opportunities - allowing settings to be viewed and changed through a software interface, as well as monitoring voltages/temperatures, perhaps controlling some auxiliary outputs, etc. All my interfacing has been in C# .NET 2.0 and in the end should be compatible with other languages via a DLL or similar.
-The USB interface also allows a bootloader to be used, allowing firmware to be easily updated through software without a programmer or any other hardware required.
Of course, as a failsafe, the SDC is designed to operate just fine as a traditional SDC when the USB interface is not available (cable unplugged, software crashes, etc)
Modular Architecture:
The main idea here is that although it would be convenient to have some simple hardware control over the SDC (LCD display/LEDs, buttons, etc), shutdown controllers are typically hidden away in the trunk, under a seat, or other inaccessible areas, and having to run a bunch of wires to mount these remotely would not be ideal. By using a second board with another microcontroller, which communicates with the main SDC board with a type of serial interface (I2C), all of the user-interface functionality can easily be mounted in a convenient location, while keeping the SDC itself in the PC where it belongs - and it only means running a small cable of 3-4 conductors (such as cheap telephone cable)
This also means that different user-interface boards could be used depending on the desired level of control - from complex, to simple, or none at all.
General Features - (This is a list adapted from my website, from the above link)
In addition to the features afforded by the USB interface, a list of the general features I am planning on:
* Configurable modes, from basic timed power-down, to multi-step sequenced shutdown involving multiple power modes
* Configurable delay times, allowing flexible control of power use
* Voltage monitoring, including configurable warning/alarm thresholds where the system can be automatically powered down for safety
* Temperature monitoring, on-board and optionally remote sensors, also including similar protection modes as for voltage
* Auxiliary output(s), configurable with certain delays to control additional devices during startup/shutdown, such as amplifiers for anti-thump
* Status LEDs on-board, providing basic status information, particularly for debugging purposes during setup
* Fused Input, reverse-voltage, and over-voltage protection
* Connector to allow manual use of existing PC power button as well
Additional features which I plan to implement (most likely on the auxiliary board):
* Stay-On button, for those instances where you just need to shut off your car for a couple of minutes and would rather your PC stayed on, such as while pumping gas or visiting a convenience store. Configurable timeout as a backup.
* Stay-Off (Valet) switch, for when you want your PC to remain off even with the car running, such as when it's with a valet, or in the shop, or being borrowed by a friend. This switch could be in a hidden location, or use a switch requiring a key, for security.
* Emergency-Off button, just in case. This would be to immediately kill the power, no shutdown procedure involved.
* Reset button (to reset the PC), just in case.
* Status LEDs
* LCD display
http://eegeek.net/images/stories/PIC...dc_diagram.png
A basic, preliminary block diagram.
http://eegeek.net/images/stories/PIC/dscf0468.jpg
A picture of the current state of the project. A bit of a mess, with the in-circuit debugger and logic analyzer in there...
Currently, quite a large chunk of the important functionality is working - USB (plus software interface), I2C, LCD, state-machine cycling through power states, etc.
I've got printed circuit board layouts designed for both boards, and will be etching and building cleaner prototypes once I finish adding the most important circuitry.
Since all the foundational functionality is operational, my primary focus at the moment is the real grunt work - setting up menu systems on the LCD, cleaning up the software to a more useful state, streamlining the interface between PC, SDC, and auxiliary board for viewing and changing settings, etc... In other words, getting it out of the "purely developmental" stage and into the "useful prototype" stage.
Down the road, I do fully intend to streamline the whole PC-side SDC interface to a DLL that can be implemented in other applications - but that will have to wait until the interface is in a more finalized state.
Anyway - any questions/feedback/etc appreciated - I'll keep adding info as I make more progress (and find time)