Date : Mon, 17 Jun 1996 19:30:34 -0700 (PDT)
From : Frank Lee <rl201@...>
Subject: Re: Hornby Zero-1 again
I've posted this to the whole group for people more expert in these
matters to correct!
On Mon, 17 Jun 1996, steve wrote:
> As no-one replied to my previous query, I assume no-one is familiar with
> the device. I am sure that if I explain a little about it, someone is
> sure to be able to help :-)
Will try.
>
> I have a few technical docs from Hornby, and they suggest that the easiest
> way to interface to a computer would be simply to put reed relays in
> parallel with the switches on the controller. The switches consist of:
>
> 1. A keypad consisting of 17 non-latching push-to-make switches
> 2. A SPST switch to control forward/reverse
> 3. A slider switch for the speed control - it has one 'input' and four
> 'outputs' . It uses 'Gray' code to generate 15 speed values from the 4
> outputs (all 'off' is not used).
>
> So, it seems to me that one approach is to get 22 reed relays, and arrange
> for the first 18 (1 and 2 above) to be activated momentarily so simulate
> key presses, and the remaining 4 for the slider, one or more ofwhich will
> be closed at any one time.
>
> Does all this sound sensible, and if so what other hardware would I need
> to interface it all to the Beeb? One thought that does occur to me is -
> is it OK for reed relays to be closed for long periods of time?
Right. My attempt at an answer to this problems was to find a complete
solution. I suppose that you will have thought of much of this already,
but nonetheless I'm including all of it. You're correct in thinking that
22 reed relays could be used / will be needed, although I think you may be
better off getting a panel of relays fro a redundant / surplus supplier
(Greenweld springs to mind.) Depends on cost, it's your wallet.
Thinking about things logically, you require a Foward / reverse switch:
<Assuming that it is at signal level {low current} rather than power level
{high current for supplying the trains} you could use a reed relay or a BT
type. If you're buying new, I think you may find that cheap BT types are
available even cheaper that reed relays, but again, it's up to you. Since
this relay is kind of one on its own (doesn't fit logically with any
others) I would assign it to a separate i/o channel - let us say IO7
(assuming that you're using a single side of the 6502 user port)
This leaves 7 i/os for controlling a 17 key keyboard and a set of 4 speed
controls. Thinking laterally, if there were 16 keys, one could use a
4-line to 16-line decoder. Two of these with the same address bus input
(from, say I/O 0-3) could be enabled from I/O 4 (one enabled, one disabled
for each logic output). This would allow you to select any one of 32
relays to close according to the 5 bit code present on I/O 0-4.
This gets over the problem of controlling the 17 switch keypad from the
beeb. Controlling the 4-switch speed controller can be done by using the
same address bus (I/O 0-3) as for the keyboard, but alternating its
function according to another output, say I/O 6. When I/O 6 is, say, high,
I/O 0-3 control speed (and can be latched in 4 D-type latches, clocked
from the remaining I/O 5) when I/O 6 is low, I/O 0-3 control the keyboard.
I don't know whether you'll need drivers for the reed relays - I guess it
depends on your chosen IC technology.
Hope this helps: feel free to contact me direct if you want any of this
drivel explaining / schematics to clarify things. Hey, I might even be
generous & draw you a PCB layout!
Frank
(rl201@...)
"A DAT machine is like a little CD player, except it records....
... on magnetic tape."
Trainee Radio Reporter, 'In Touch', BBC Radio 4 28-05-96