@database 682ef4e8-1
@master //Distribution/Schaltuhr/Schaltuhr_E.guide
@$VER: 1.0
@remark Created with Heddley v1.1 (c) Edd Dumbill 1994

@node "Main" "No title"
                           @{u}@{fg shine}Schaltuhr-Guide@{uu}@{fg text}

                       (c) 1997 Andreas Boerner
                    English version by Kerstin Matter


 @{"Disclaimer              " link "disclaimer" 0} - Read this first!

 @{"Introduction            " link "introduction" 0} - The idea...
 @{"Hardware                " link "hardware" 0} - The components you need
 @{"Construction            " link "construction" 0} - How to build
 @{"Software                " link "software" 0} - The Schaltuhr program
 @{"Technical Infos/Problems" link "hacks" 0} - URGENT !
 @{"Author                  " link "author" 0} - Proposals, etc.
@endnode

@node "disclaimer" "Disclaimer"
                              @{fg shine}- Disclaimer -@{fg text}

 I HEREBY REJECT ANY LIABILITY OR RESPONSIBILITY FOR THESE OR ANY OTHER
 CONSEQUENCES FROM THE USE OF THE HARDWARE AND SOFTWARE PROVIDED IN THIS
 ARCHIVE WHATSOEVER. THIS INCLUDES, BUT IS NOT LIMITED TO, DAMAGE TO YOUR
 EQUIPMENT OR TO YOUR DATA.

 It`s useful to have some technical skill and comprehension for building
 the circuit, because the timer is connected to high voltage. So, if you
 don`t know where`s the hot side of the soldering iron, you'd better
 take your hands off.

 This description and the "Schaltuhr" program are both freeware.
 The archive must be spread completely and without any changes.

 It`s allowed to distribute the archive through any media, as long as no
 profit is made with it.

 It`s not allowed to distribute the archive for commercial supposes
 without my permission. Fred Fish and Aminet have got my exclusive
 permisson to spread the program on their PD media.
@endnode

@node "introduction" "Introduction"
                           @{fg shine}- Introduction -@{fg text}

 Actually, this circuit is very simply, but it serves its suppose
 excellent. The basic idea is to turn on the computer wiht a timer and
 turn it off immediately, when the computer is ready with his actions
 (e.g. a netcall at night, while your asleep).

 What disturbs me on a regular timer is the fact, that the computer is
 turned on for a fixed period. To prevent the computer from turning off
 while it is still working the on-period has to be very long, possibly
 some hours.

 My circuit ensures, that the computer stays on exactly until the
 signal to turn off is given.

 I'm using the circuit for some years. Originally I wanted to develope the
 circuit further, just to integrate it into the computer that way that
 the second joystick-port isn`t @{"blocked" link "hacks" 0}.

 But I had either time nor idea for realizing that and the restriction
 didn`t bother me yet at all.

 So I publish the hardware just like it is, because I think it`s useful
 even if it`s not perfected yet.
@endnode

@node "hardware" "Hardware"
                             @{fg shine}- The Hardware -@{fg text}

 To @{"build" link "construction" 0} the circuit you need the following components:

 - a weekly timer (see reference)

 - a 9pin sub-D-connector (female) for attachement to the joystick port

 - a 2pin connector assembly (male-female-coupling)

 - an optical coupler type SFH 610, a resistor 2,7 kOhm

 - some wire (a pair of conductors), perhaps a little piece of a gridboard
   (but with some skill you don`t need it)

 - the "Amiga" computer must have a realtime-clock (see @{"software" link "software" 29})


 @{u}@{fg shine}The timer:@{uu}@{fg text}

 Before you buy the timer, you should have a look at it and test it very
 well. Most important: the mode of the timer must be changed with a
 push button. Don`t take a timer with a shift button!

 There should be a little delay before the timer activates the choosen
 mode, when pressing the mode button. To test this, you connect the timer
 to a socket, change the mode to "ON" and try to switch through all other
 modes, without dropping the relais.

 The mode "OFF" is very critically, because in this mode most of the
 timers turn off immediately, without any chance to skip it.

 This document describes the assembly with a weekly timer from a german
 electronic components shipper: 'Weekly Timer HT 456' from Conrad
 electronics (ordernumber 622842).

 I think, this timer is a special Conrad product, but if you find it
 anywhere else...

 Anyway - there should be other usable timers. Just try the tests above
 and if yoy found one, @{"write me" link "author" 0}, so I can recommend it here.


 @{u}@{fg shine}Other components:@{uu}@{fg text}

 The 9pin SUB-D-connector is just a usual joystick-connector.
 An old joystick-cable with intact wires for pin 6 and 7 would be O.K.,
 too.

 The 2-pin connector is used to disconnect the timer more easy if you need
 it otherwise or if you want to prevent the computer from switching the
 timer for some reasons.

 The optical coupler is also from Conrad (ordernumber 184497), but you
 should get it from any other electronic components saler.
@endnode

@node "construction" "Construction"
                             @{fg shine}- Construction -@{fg text}

 In this document I describe the assembly for the timer "HT 456". For
 other timers the procedure might be similar.

 First you open the case. Then you take off the button- and LCD-circuit by
 removing the four screws at the upper and lower edge from the circuit.
 Then you take off the circuit from the timer carefully and remove the
 other screws. After lifting the circuit board you should see the contact
 points for the several buttons.

 Now you solder a wire on every pole of the mode button, but first you
 may have to remove some isolation from the supply tracks carefully.
 You should beware, that the function of the buttons isn`t impared by
 wires or too much solder. Don't solder the wires directly to the contact
 points!

 Ready with soldering the wires, you put the circuit board back into the
 timer. Now you have to connect the following circuit (free or on the
 gridboard):

                  +----------+
                  |          |
                  | SF-610   |                    /
    +-------------|          |-------------------/ --------o PIN 7
    |           3 |          | 2
    \\  MODE-      |          |                2-pin-     Joystick-
     \\ Button     |          |                connector    port
    |             |          |        _______     /
    +-------------|          |-------|______|----/ --------o PIN 6
                4 |    /\\    | 1
                  |   |  |   |        R 2,7 kOhm
                  +----------+


 The polarity of pin 3 and 4 don`t matter. The optical coupler and
 the resistor have to be connected inside the case - just let some wire
 jut from the case.

 Now you can put the timer together, but avoid short circuits! For this
 you may use some insulating tape. @{u}Never let the circuit loom into the@{uu}
 @{u}high voltage area!@{uu}

 On the end of the piece of wire you have to solder the 2-pin connector.
 Then you solder the long wire to the relating 2-pin socket and to PIN 6
 and 7 of the joystick-connector, according to the circuit layout.

 At least you connect the wire to the second gameport.

 That`s all!

 Now you should test the timer: connect it to a socket, plug in the
 joystick wire, but don`t connect the computer through the timer, yet.

 If the timer don't switches by using the Schaltuhr-program, try to
 reverse the wires to PIN 6 and 7. Now it should work.
@endnode

@node "software" "Software"
                               @{fg shine}- Software -@{fg text}

 The Schaltuhr program switches the timer's mode button from your
 computer.

 Syntax: Schaltuhr TIME/A,PATTERN/M

         TIME    : hold delay for the mode button in 1/50 seconds

         PATTERN : S - "push" mode button
                   x - wait for x/50 seconds


 The hold delay means the time, the mode button has to be pushed.
 A value >2 should be enough. The following pattern defines switching and
 waiting. An "S" is equivalent to a switch and a number declaeres, how
 long the program has to wait. Example:

   Schaltuhr TIME 5 PATTERN 50 S 10 S 10 S

 The program waits a second, then it switches (for 1/10 of a second),
 waits for 1/5 of a second, switches, waits for 1/5 of a second and
 switches.

 First you should test the switching function without connecting the
 computer system with the timer.


 @{u}@{fg shine}The principle:@{uu}@{fg text}

 The timer is programmed in the way, that it switches on itself for some
 minutes. When the computer boots up, the time will be checked in the
 startup sequence. You should allow a certain tolerance (maybe 2 minutes),
 because the timer clock and the system clock in your computer don't run
 synchronous.

 If the system time corresponds with the programmed "On"-time, a certain
 program is started, e.g. a netcall-script. The first thing to do now, is
 to switch the timer to mode "ON", just to be sure the timer doesn't turn
 off the computer. Remember: In Prog/Auto-Mode the timer turns off after
 some minutes, relating to the timer program.

 Now you can perform the actions you wanted to do and after all is done,
 the timer will be changed to mode "Prog/Auto" with the Schaltuhr program.
 Now it should turn off, if the timer program is set right (see above).

 Here it will be proven, if you bought the right kind of timer. If you can
 "reach" the "OFF"-mode without turning off the computer, it was the right
 choice.

 From now, you manually turn on and off your computer with the mode button
 of your weekly timer. To turn it on, change the timer to "ON" and if you
 want to turn it off, switch it to "Auto/Prog".

 Be sure to have every component of your system connected through the
 timer. You may turn off certain components (e.g. a printer) manually,
 if not needed. Or think about the monitor - you won't need it in most
 cases for your automatically bootup.

 You may turn off your computer with a little script (maybe with a
 mouseclick or a hotkey), so the timer is programmed to "Prog/Auto"
 without pushing the mode button directly.
@endnode

@node "hacks" "Technical Infos/Problems"
                @{fg shine}- Restrictions and Technical Information -@{fg text}

 - The most important restriction is, that the second joystick port is
   blocked by the circuit. It`s not possible to connect the joystick
   (together) with the circuit, because the timer mode will be changed
   by pushing the fire button of the joystick.

   So if you want to use a joystick you have to pull off the connector
   for the timer.


 - The program is written in AmigaE and pokes directly to the
   CIA-registers. This is not very system friendly but since the CIA chips
   have the same addresses in any amiga computer until today, it should
   work without problems.

   Anyway - if you want to spend two hours for a system friendly version,
   feel free to write one. (see @{"Author" link "author" 0})


   @{u}@{fg shine}Technical information:@{uu}@{fg text}

   The circuit joins the +5V pin of the second joystick port with PIN 6
   (firebutton) through the diode of the optical coupler.

   Actually, the PIN 6 is programmed as input, so there`s a +5V
   TTL-voltage (HIGH) to test the firebutton. This interferes with the 5V
   power supply and no current runs through the diode.

   As soon as PIN 6 is programmed as output, the TTL voltage goes to
   low and the current from PIN 7 passes the diode to PIN 6. This
   activates the optical coupler (the photo transistor switches to
   passage). So the contact for the mode button inside the timer is
   "closed".

   The current, laying on the PIN 6 now, is passed to ground through a
   transistor circuit inside the amiga. For this, I misuse the
   short-circuit-protection of the joystick port, but after two years my
   computer is always working without clouds of smoke or other problems.

   So the Schaltuhr program only sets PIN 6 to output for a short time and
   sets it back again to switch the mode button.
@endnode

@node "author" "Author"
                              @{fg shine}- The Author -@{fg text}

 Ifyou built the timer, it would be nice to send me a reply. If you
 developed a better version for the Schaltuhr program and you send it to
 me, I will distribute it in the archive and my thanks will creep after
 you forever. :->

 My E-mail-adress: A.Boerner@BBrandes.in-brb.de
@endnode

