Creation date: 21.07.2001
Chapter of
Author(s): hpbaby
Navigator: previous main next
Version:     EN

Best in:1024*768

THE PAINLESS TRAINING

Controlling the PC from A to Z with HP

As I do not drink cofee, I will not expose how to control the cofee machine. It is more interesting to be able wake up a PC as some actions may be launched at the start. 
Let suppose now that the PC is in standby mode. If we wish to trigger something on the pc, we must wake up the pc either through the serial port or by the real time clock (RTC). 

We will see then that with an  astucious trick we will be able to do anything with the pc (Keboard simulation, mouse click and so on). I have bought a new PC, whatever I do in the bios for power management I never manage to wakr up by the serial line nor by the RTC. Some of my friends, don't mange to switch the pc off , thind that is working fine for me.

Here the HP comes to rescue us .. Let's have  some wake up of the PC by HP48 thanks to alarms.

1) Wake up of the controlled by the HP

WakeUpPCbyHP.gif (30435 bytes)

In fact, with this circuit, we simulate the action on the pushbutton power (during 1/2 second with an delay of about one second). This is triggered by onpening/closing the serila port of the hp. There is a part I have called "silly bridge" on the schematic because the analogic levels are not well adapted.
For the moment, the circuit is powered by an external power 5V 300mA regulated with a chip 7805 because I don't want to use power of the pc.(I could do that as it only requires 25mA when the relay switches). I use a DC5V from OMRON (G5CE-1, contact 15A at 125V) available at radiospares for 25F. 


The two nands gates U1B and U1D are set to build an flip-flop (memory of one byte , used here against bouncing effects) SET (force 1 level on the pin 
 6 of U1B when the pin 4  has been at 0  once) RESET (force 1 level of the pin 11 of U1B when pin 13 is low) active on low levels. There is a forbidden case (SET=RESET=0) which is avoided as the C3 condensator gives  RESET on power ( thus the pin 11 is hight ).

If the serial  port of  the  hp is closed, the voltage is not the ground  so the lock done by diodes 1N4148 on condensators is removed so C1 and C2 load exponentaly to +5V. On the input 9 of  U1C, the level will be 1 after a delay  proportionnal to R2*C2, activating the relay. After the time R1*C1*ln(2) , the circuit U1A see also 1 level on its input and 0 on the output.pin 3 (inverter),. This immediatly  triggers the  SET of the flip-flope RS: lthe output 6 of U1B toggle to 1 whereas the pin 11 fall to 0.  The nand circuit U1C see then a 0 level on one of his two inputs (pin 10) and its output set to1, opens the relais.

Conclusion: the pc light on without pressing the pushbutton  if this montage is powered after the pc or  if we forget tu put jumpers between 1 & 4 and 2 & 3 on the socket SW DIP-2. If we ommit to put a jumper between 2 and 3 , the  system  is furthemore not retriggerable (pc can't be switched off by the same meaning). As there is no voltage adaptor (silly bridge), for the moment put the jumper between 2-3. For those who want the light on / light off the pc this circuit works fine  and  requires a tiny program in  Rpl that I launch inside an alarm: «openio 1 wait closeio » . 

hpcontrolpc-card.jpg (28715 bytes) hpcontrolpc-typon.jpg (31155 bytes)

Here is exposed my test board where you can see a free wheel diode on the copper side.
Lets talk about the connectors : the output of the relay (green connector on the left high corner) should be connected to the motherbord at the place of the two wires of the PC pushbutton.  (power SW) - see the Motherboard documentation for determining were connecting it.
The middle connector is the 5V power suppler whereas the bottom connector should be wired to the hp48 serial port.

2) Triggering PC programs  with the HP

You must have an HP (of course), a wire PC/HP , a PC with a serial port free and download the wonderful Irassistant program (see instructions below). 
I have a story to told to you. As I like a lot  linux (see my web only in French sorry), I discover the program Irassistant  through one of  LIRC project:  
 UIR (Universal Infrared Receiver alias Irman brother) from Ties Bos and  decided to make some reverse engineering on the protocol (ouh the bad guy, he has done it). It took me a long time to have the idea to replace the UIR module (I have build 5 for my friends - so I will push the French documentation if Ties Bos agrees) by an  HP.

Are you ready , let's go..
  
    1) Download  Irassistant  (free for non commercial purpose) from the official website (about 5mo) 

    2) Install the software  (click twice on setup.exe) ,, don't reboot yet, and copy irman.dll in the 'installation folder.
    of irassistant (C:\Program files \ Irassistant ) . Reboot now the PC.

    3) While the PC is rebooting, type on HP the following   RPL programs:
   

File INIT (bytes #42549d taille 55.5 ) File XRC5 (bytes #26374d taille 76 )
« 2 SRECV DROP DROP 
1 10 FOR P
          "XOK" XMIT DROP
      NEXT
» 
« -> RC5 
  « "" RC5 SIZE 1 SWAP   FOR  I   RC5 I GET
  CHR + NEXT XMIT DROP
  »
» 


4) Link the  hp to pc with the serial wire and set link to Wire, binary, 9600 bauds, no parity

5) Execute  the program INIT on the  hp and  lauch immediately Irassistant

I bet you will get an error message such as"device not detected"  because the serial port of irassistant does not correpond to
whose you connect the HP. For changing this type simultanously CTRL-S. A windows appears:

This is the  settings window. In the section drivers,  select Irman UIR, PCCommander (if you don't see it you have forgotten to copy irman.dll- see step 2 click on it to download). Change then the port to agrees with those HP (for example COM2 if COM1 is used by your mouse). Validate by ok / apply your change.

6) Close Irassistant.

7) Repeat steps 5 and 6 while the error message remains. Do not close Irassistant if it is okay.

8) A learn phase of the keys of your remote control (here the hp replaces it) should be done and the actions linked to the keys defined. For each key 
of your remote ( a key = will be a program on your hp which simulates the key pressed ) proceed as below:
 

    a) Add a new button (CTRL-A : add Bouton Group)

    In the area (1) give a name of the button 

    b) Link the action to do  (2) by clicking on New and define the sub actions

    The button  called "Son+" :
     -will have an action labelled "augmenter le volume" 
    - the press of the button will triggers the command volume up (choose one or more sub action(s) in the left  macro list then for each action press
    on add to add this into the action. As we got only one sub-action, this will have for effect to increase volume by one step.

    c) Click now on  Learn, to make Irassitant learn the Ir signal simulated by the hp through the wire. This can be done
    by creating a specific program on  hp (the best is to give the name of the button SONPLUS ) whose content is:

    SONPLUS
    « { 254 224 0  0  0  0 } XRC5 »

      and executing several times  one after the other.(4 times at least).


     
    We  notice that Irassistant reads FD E0 00 00 00 00 which is in fact the hexadecimal conversion of each value the liste inside the program SONPLUS (FD=254d, E0=224d,...). This value list should normally correspond to an unique  RC5 séquence (invented by phillips). Take care then not to use the same sequence for two buttons.

9) You can now increase the sound by running SONPLUS on HP . The possiblities are infinite as you only need to make a new list for each action and only the memory of the hp can limit you. The actions on the PC triggered can we very sophisticated too. If it happens to you to see the error message back (mistake from your part, bad manipulation),   don't worry use the INIT program to restablish the link (this silly PC will believe that an UIR module is present . Have fun !!!!!!!!

 For those who want to learn more, there is a well made FAQ HP48  

Establishing the serial link
1) Serial link HP/PC, pinouts
2) The transfert programs
The power programs for PC :
1) Development tools
2) Graphical tools
Controlling the PC from A to Z with HP
1) Wake up of the PC by the HP
2) Triggering programs with HP