Can someone write me a PIC program 4 a awesome s/down controller please?
I know you dont know me, and this is completely out of the blue, i have a favout to ask , reguarding PIC programming, specifically the design of a shutdown controller.
Firstly an introduction, I have built a in-car MP3 player, it has the following features:
- Runs win 95 = winamp
- a LCD display connected to the parallel port
- UIR IR remote, connected to the serial port.
- lorty LCD plugin for the LCD display, and keypad control,
- I am also using a program called uICE to recieve data from the UIR, and send the required keystrokes to the Lorty plugin, this allows me to fully control the plugin from the IR remote.
- I also have a hacked keypad in the head unit in the dash with 5 keys, play, pause, stop, nxt track, and prev track, and shutdown/power up. these keys are the same ones emulated by uICE, so i can control basic functions of LORTYS plugin from the head unit, aswell as the IR remote, the IR Remote is also able to take advantage of the full search functions of lortys plugin, aswell as the other functions.
- A homemade power supply supplying the required power for the motherboard.
Its a Pretty standard setup really.
What i need now is a shutdown controller, and this is where i need you help, i have designed the electronics, and i would like you to write a quick PIC program for them, sorry for having the cheek to ask you this but i am only a studing studying/ training to be a Electrical Engineer at university, and i havent learnt how to prog PICs yet, also, there is not a device like i wish to build available on the market yet, and i think there is a need for one, for the good of the MP3 community.
Here is what i would want the device to do:
I would like to make the device from a 12C509 or 16F84 PIC, because i can get these cheap from University.
The circuit would have to monitor 4 inputs, one from the accessory line of the car, a "startup" button, a "shutdown" button, and the other from the LCD display, The program would also have to drive 2 output, one is to turn on and off the powersupply (output 1), and the other is to close one contact on a hacked keypad (this causes the lorty plugin to shutdown the computer.0(output 2)
When the start button is pushed, OR the acessory line goes on (i.e. the car is started) set output 1 high indefinately (this would turn on the powersupply)
When the line connected to the LCD display goes High (i habe designed a missing pulse detector circuit which goes high when the pc stops sending data to the lcd on its E line)(i.e. the pc has shut down, and is ready to be turned off), then a 2 minute timer should start, after the 2 minutes has elapsed, then output 1 should go low indefinately (turn off the pc),
When the accessory line goes low (i.e. the car is turned off), a 10 minute timer shoud start, after that time, output 2 should go high for half a second or so. (issuing a command to the PC to shut down (emulating a key, which uns a shutdown command to anpther plugin))
when the shutdown button is held down for 1 sec or more, then output 2 should go high for 1/2 a sec (i.e. this issues the command to the plugin to shut down the PC)
if the start button is pushed while output 1 is high, this should not affect anything, likewise, if shutdown button is pushed while output 1 is low, this should not affect anything.
to eliminate false triggering, the input from the LCD must remain high for 2-5 seconds, before starting the 2 min timer.
the program should be on indefinately (i.e. run forever, the shutdown controller is always got power)
the input button must be held on for 1 sec, this acts as a debouncer, and means you can accidentally turn on the 'puter, like wise for the shutdown button, it must be held down for 1 sec, to prevent accidentally shutting down the 'puter.
The LCD input is via a missing pulse detector, the ouput of this detector goes high when data is stopped being sent to the LCD (i.e. the computer is showing the "now ready to turn of you pc screen")
this device is in charge of starting or shutting down the PC
I think this is well worth building, as no such device currently exists on the market, and this shutdown controller is entirely hardware orientated, so it needs no software to be running on the PC at the time.
I'm sorry for pestering you, please think about the project, and get back to me reguarding your response.
Thanks for your time