Re: joystick ports (was: Early TED/Plus4/C116 Schematics)

From: HÁRSFALVI Levente <publicmailbox_at_harsfalvi.net>
Date: Sun, 08 Sep 2013 09:12:10 +0200
Message-ID: <522C234A.8090208@harsfalvi.net>
Hi Julian,


On 2013-09-08 01:55, Julian Perry wrote:
> ...
> 
> In several presentations, Bil has explained that this exposed the data
> bus more generally to electrical interference, and had an I/O port
> interposed, to isolate the data buss from such interference. In
> production, a 6529 (single port I/O port) was used on both the C116 and
> plus4. The plus4 has two 6529's, the second one drives the user port.
>  How USEFUL it is there is debatable, as the DDR in the 6529 is only
> 1bit wide. (IE ALL output, or ALL input).

Actually, the 6529 provides an 8-bit "quasi-bidirectional" I/O port
(similarly to those found on the Intel 8051 series microcontrollers),
with no DDR at all. The port pins are pulled up by internal pull-up
resistors. The output drivers (controlled by the internal output latch)
are open drain drivers, that is, they can only sink but not source
current. The internal input "latch" is in fact a simple bus driver which
reads from the I/O port lines directly, and passes on this data to the
data bus. All in all: any of the portbits can potentially be an input
portbit anytime, provided that the respective output bit is set to "1",
and there's an external device capable of sinking "enough" current
against the weak internal pull-up of the 6529B portpin (which is usually
the case if thing are set up so).

(Personally, I find this little device a pretty brilliant one,
with/despite its simplicity, especially whenever I make an attempt to
build some of its functionality from TTLs ;-). Probably not much more
complicated in itself than a usual TTL bidirectional bus driver, yet
very efficient to use in practice. The only thing I'm missing is a reset
input (which probably wouldn't fit the DIP20 package)).

BTW, speaking of the keyboard scan schema of the early "TED" series,
IMHO it's interesting that both the Sinclair ZX80 and ZX81, and AFAIR
even the Spectrum did make it into production with this "address lines
directly used in the keyboard scan process" method |-) .

> Looking at the (correct) C116 schematic on Zimmers, it appears that
> whilst the keyboard scanning now is assisted by a 6529, the joystick
> exclusively uses the TED (and both ports are connected to the same
> lines!!).  

Yes.

> There is an interesting article on zimmers
> - http://www.zimmers.net/anonftp/pub/cbm/documents/projects/interfaces/plus4joy/plus4joy.html .
> This article seems to imply that the scanning relies on data left behind
> on the data buss from the previous 1/2 cycle of the 7501 processor,
> which sounds rather hair-raising to me, tbh. IE: a WRITE to TED register
> $FF08 (Keyboard latch) instructs the TED to poll IT's keyboard row lines
> on it's 1/2 cycle, the column being asserted by whatever data was left
> lying on the data buss from the previous 1/2 cycle of the processor. 

Well, almost. It's done in a pretty special way, but at least it doesn't
rely on data left floating on the data bus. The "process" is done in a
single bus cycle (that is, half a single clock cycle). CPU puts $ff08 to
the address bus, "x" to the data bus, pulls R/W'. Bit n of the data "x"
(can't remember which one) is reflected to the respective Select' output
all the time by the 74ls125. Select' is a common point for all momentary
switches inside the joystick. If some switch is activated, AND the
common point is currently 0, the respective joystick direction lines are
pulled 0 against the pull-up resistors inside the computer. Some time
later, which is probably a matter of some few 100 nanoseconds ie. around
the end of the memory cycle, the TED samples its 8-bit input port (which
currently reflects the joystick direction lines), due to $ff08 addressed
+ R/W' low. During the whole process, the data bus is stable, because of
the cpu driving it (it's all done in a single memory cycle). (There is
no constraint of using the data bus on alternative half cycles for the
TED here, like there is at TED memory accesses.)

> Of course, this all went out the window when the 6529 was interposed -
> the column was written to the 6529, then a write was performed to $ff08,
> and the keyboard scanned that way.
> 
> As to what bearing this has on your joystick problem - I'd be looking at
> the 74LS125 - it's a darn sight easier to find these days than a working
> TED.

Yeah. Probably worth a look. (Though, replacing the TED for a first test
might just be simpler, the 'ls125 isn't socketed).

> Are there any smarts in a C264 series joystick, to implement the select
> as a full "inhibit"??

AFAIK not. Simple, passive construct, conducting rubber contacts, etc...

> and if so, what are the implications of using a
> standard Atari/C64 joystick, and adapter??

IMHO not many, other than TED sensitivity (TED broken input latch
phenomenon, not really investigated yet) and active electronics in
joysticks not really working, if there are some.


Best regards,


Levente


       Message was sent through the cbm-hackers mailing list
Received on 2013-09-08 08:00:12

Archive generated by hypermail 2.2.0.