Yard Hardware Description |
Refer to the Yard Schematic.
This program utilizes the Basic Stamp 2 micro controller which has 16 I/O bit positions. External interface chips (74C922) are used to encode and debounce the keypads. Output multiplexors (74154) are used for interfacing to the turnouts. Two output bit positions are assigned to control each turnout. The cross over turnouts Y5/Y6 and Y7/Y8 are wired for controlled by a single pair of bit positions since both turnouts must always be changed together.
Basic Stamp I/O bit p7 is connected to a speaker and used to sound warning tones. Basic Stamp I/O bit p4 is connected to a Led and used to indicate operation (heartbeat). Flashing indicates that the code is cycling in the main program loop. Basic Stamp I/O bits p5 and p6 are connected to an Led on each of the keypads to serve as a "first track number entered" indication.Basic Stamp I/O bits p3 through p0 are used for addressing the 74C922's and 74154's. Basic Stamp I/O bits p8 and p10 are connected to the "data available" pin on each 74C922. A high indicates that a button has been pressed. Basic Stamp I/O bits p9 and p11 are connected to the "output enable" pin on each 74C922. A low causes the 74C922 to drive Basic Stamp I/O bits p3 through p0 with the number (0 through 15) of the pressed key. The 74C922 then sets its "data available" pin low.
The capacitors connected to each 74C922 establish the button scan rate (.1uf, ~600 hz) and button debounce time (1 uf, ~10 ms).
Switch machine operational power requires that a driver circuit be used for each coil. Each 74154 output is connected to the base circuit of a TIP127 five amp Darlington transistor. When a turnout is to be positioned, the Basic Stamp program pulses the appropriate 74154 output for a nominal 200 ms. This causes the driver circuit to energize the switch machine coil.
One area of risk in the present design involves the Basic Stamp I/O bits p12 and p13 that control the enable inputs of the 74154's. A low causes the switch machine coil addressed by I/O bits p3 through p0 to be powered. The switch machine coil will be heat damaged if the I/O bit is low too long; greater than 2 seconds. Various coding safeguards are in place to minimize this possibility.
The current design will not support Tortoise switch machines without some major modifications to both hardware and software. Perhaps a future design enhancement.
Navigation: D&B Home Buczynski.com Index
Copyright © 2006 Don Buczynski
San Diego, California