Jump to content

Recommended Posts

Posted (edited)

Dear All,

motivated by Evan’s 9750 EuroBricks hacking challenge, I tried to get my beloved Amstrad PCW 8512 (named by Amstrad's CEO Alan Sugar “Joyce”, which is the given name of his assistant) along with an SCA Systems parallel/serial interface in touch with the LEGO Interface A (#9750). It appears as if TLG never wondered into Amstrad world; they were more on the professional IBM, Apple, Acorn, Commodore, and Philips side of things. Expensive things that is; not on the el cheapo side, were I was.

Here is the video proof that it works ;) I did not upload that video to YT - it is too crappy :pir-grin:

https://bricksafe.com/files/Toastie/amstrad-8512-and-9750/Amstrad 8512 LEGO 9750.mp4

 

To begin with: Here is my vintage compuing corner in the attic (this room also serves as my home-office) - along with the vintage LEGO stuff, which is controlled by these machines:

1280x651.jpg

(1) is the PBrick section (RCX, Scout, IR serial and USB tower, Sybotics with optical serial connection; the Vision Command camera setup is controlled by the Scout; Cybermaster with the RF tower below. The barely visible TC brick sorter robot is controlled by the RCX. (2) is the LEGO interface A (#9750) section; there is a 4-way switch that allows to use multiple computers for the interface: The IBM XT (A), the Toshiba Satellite 4090 (B), which is on a pull-out shelf, or any modern computer via an Arduino USB28bit parallel interface mounted right to the interface A. The 4.5V motors of the TC robot (3) below are hooked up to the Interface A; additionally, a PUp tacho motor and a Technic hub control the lateral movement - synching and programming reported here on EB. (4) is a second Interface A - this again is on a 4-way switch (located above the (D)) to be controlled either by the Amstrad PCW 8512 (C) or the ZX81 or ZX Spectrum (D) or the Atari 1040 ST or the C64 (E). The second Interface A is intended for testing and trying out things; there are 8x 4.5V lamps and 2x 4.5 motors with 2x light sensors on a 32x32 base plate. Both, the interface as well as the Atari and C64 are on pull-out shelves.

So without further ado: Here we go again ... and yes, my posts in this regard may be annoying, but so are super cars. Or Cada stuff, 2++ m tall cranes, ++$600 sets – >only< to me, that is! And here is to feeling good!

:pir-huzzah2:

The Joyce [(C) in the above photograph] is one of a kind, I can tell … its design is beyond belief – in the absolutely positive sense. Made for the masses, using incredible techniques. IBM just went ballistic with regard to parts and pieces in their original PCs and then XTs (which I am madly in love with). 8000 something German Mark in 1983. And TLG was sailing along – after three more years they introduced Technic Control, and PC’s, XT’s, Apples, and so on were the prime machines targeted for that technology – in schools that is … no way to go cheap there!

Now, the PCW (Personal Computer Word-processor) 8512 was not as cheap as Sinclair’s ZX computers; it cost about one quarter of what IBM charged for their PC. But: It was a fully blown word and database processing system. No built-in graphical stuff, just pure text and number crunching. The OS was CP/M 3.0 (“CP/M Plus”) – which was “the basis” of (or better copied by) Microsoft’s early versions of MSDOS. CP/M is so cool … and of course programming languages also work on the Joyce; as I wrote many times, I am a total BASIC person. Joyce came bundled with the “LocoScript” word processor and with “Mallard BASIC” for CP/M Plus, both made by Locomotive Software in the early 1980’s. The following citation is what I really like about the name of that BASIC dialect (copied from the referenced Wikipedia article):

“It was also optimised for speed — it is named after the LNER Class A4 4468 Mallard locomotive, the fastest steam locomotive in the world, once again displaying the company's fondness for railway-oriented nomenclature. In fact, the Locomotive Software name came from the phrase "to run like a train" and it was this theme that was used to name Mallard BASIC — no other Locomotive Software product was named after anything railway-oriented.” And behold, Mallard BASIC is fast!

Joyce came also bundled with a 9-needle dot-matrix printer, which mechanically attached seamlessly to the keyboard mimicking a type writer; there are recesses for 2 brackets in both devices. I believe though, virtually >no one< actually used that feature, as it consumes considerable space in front of the screen.

Spoiler

In 1986, my wife Maike wrote her bachelor thesis on that system. We lived very close to Kiel in Northern Germany in a sub terrain apartment. Maike worked to the last minute for actual “physical submission” of the real (printed) document to the college – and then, about 8 pm we actually realized, how slow a dot matrix printer prints … I had set up the PCW system in my “workshop” – which essentially was the entrance to our apartment – and then we watched. 4 am next day it was done – no glitch, Joyce just was going on and on and on. 5 am we had assembled the document in presentable form – 6 am it was put into the college overnight mail box. Maike got top grades on her work – of course not because Joyce was doing her work, but because she really excelled. But: Should have Joyce failed … It was this experience, why I decided to write my diploma thesis on the Joyce as well. It was a very good decision.

Joyce’s brain is a Z80A CPU – my all-time favorite microprocessor. Why? Because back in the 1980’s, I must have referenced the German edition of Rodnay Zack’s book “Programming the Z80” a thousand times as I was fascinated by the performance boost when programming in Z80 assembly code, as compared to e.g. BASIC. All my computers I had back then (and still have today) had Z80 CPUs: Sinclair’s ZX81 and ZX Spectrum, and Amstrad’s PCW 8512 “Joyce”.

On the Joyce, almost all Z80 CPU signals are exposed on the back connector along with some other lines. But there is more (there always is): Joyce features a printer port, which is (exclusively) connecting with the Amstrad/Joyce 9-needle dot matrix printer. One can of course connect custom devices to that port, but that needs intimate knowledge of the innards of the hardware. Which is not that straight forward, as Joyce features some rather powerful chips, among them an 80 pin flat pack gate array which does a lot of housekeeping tasks, the well-known NEC µPD765AC-2 floppy disc controller, and even a second microcontroller, the NEC µPD8041AH, which is a programmable peripheral interface controller. The latter features an 8bit CPU, 1kbyte ROM, 64 byte RAM, 8bit timer/counter, and 18 I/O lines, which all go to the 9-needle dot matrix printer! Nothing really easy to hack for the interfacing of Joyce with LEGO interface A, particularly with access from BASIC. Mallard BASIC does provide the command “OUT address, data byte” and the “INP(address)” function for direct Z80 I/O port access, but I would not know how to dig through the PPI controller to read and write to #9750 through the built-in printer port.

Fortunately, I got hold of the SCA Systems serial/parallel extension interface for the Joyce. There are at least four such interfaces from different vendors I am aware of. Two of these are the Amstrad CPS 8256 and the SCA Systems interface. At first glance, both their PCBs look identical, but closer inspection revealed that there are differences, particularly in the address decoding section. The circuit diagram and photographs for the CPS 8256 are available on the internet, similar stuff for the SCA interface is not, as far as I know. So I had to do some PCB track tracing, at least for the address decoding. After a lot of beeping through the tracks, I came up with the partial circuit diagram below. I was very happy to learn that the TTL 74LS373 chip (8 transparent D-flip flop latches, as TLG used in their #9771 ISA card for IBM PCs) directly connected to the 8 data out lines of the Centronics port of the SCA interface! From there it went straight downhill.

1280x677.jpg

Above: Circuit diagram of the address decoding section and the 8-bit 74LS373 output latch interfacing to #9750. The blue box contains my additions, i.e., a second 74LS373 and a 4x NOR gate 74LS02 TTL chip.

Address decoding and data read/write procedure

I wanted this interface to act in exactly the same way as TLGs #9771 card behaves: Upon emitting 1) the correct address, 2) the 6 data bits for the 6 output channels of the interface A, 3) IORQ# (# = active low), and finally 4) WR#, the C line of the “output 74LS373” goes H and thus it mirrors the content on the 6 D lines connected directly to the Z80 data bus transparently to the corresponding 6 Q outputs. As there is no change on the data bus as long as WR# = L, all emitted data are securely latched, when WR# goes H again (i.e., the C input of 74LS373 goes L). No more changes of the output lines are possible until the next complete write cycle. OC# is connected to GND and thus the chip has always activated outputs, see below. Well, this is how it is done on the #9771 card. But to my surprise, I did not find any WR# line connecting to the address decoder, I found only address lines and IORQ#. At first, I was puzzled but then realized: The 74LS373 in the SCA interface is for writing only. No data are read from the 8 Centronics data lines; the two Centronics flow control lines BUSY and STROBE# are routed to the Z80DART in the SCA interface. In other words, no WR# decoding is necessary in this scenario. SCA used the 3-to-8 demultiplexer 74LS138 for Centronics port address decoding in the following manner:

The output Q7# of 74LS138 goes L (= is selected) when its data input lines A(=A3), B(=A5), and C(=A6) are all H, the enable line FE1(=A7) = H, and the enable lines FE2A#(=IORQ) and FE2B#(=A4) = L. In all other cases Q7# = H. This signal needs to be inverted, and SCA used the second 2-to-4 demultiplexer in the 74LS139 TTL chip to do just that: When Q7#(74LS373) = L, Q2#(74LS139) = H. The decoded Centronics port write address is thus:

A7 A6 A5 A4 A3 A2 A1 A0
H  H  H  L  H  X  X  X    ; = 0xE8 to 0xEF, as A0  A2 are not decoded

The Q2# line of 74LS139 used as simple inverter is routed to the C input of the 74LS373 8-bit latch: When the address is within 0xE8 to 0xEF, the data bus content is latched upon IORQ# = L. However: This approach does work with a Centronics printer but not for bidirectional operation of LEGO interface A: Using TLG’s TC Logo and other programming languages, you can write to the 6 outputs and read back the status of the outputs as well as the status of the two sensor inputs of #9750 at the same address.

So this calls for a (very) little tinkering with the SCA circuit board and the addition of a second 74LS373 (read latch) and a 4x NOR gate 74LS02 TTL chip, see circuit diagram above. In addition, pin 6 of 74LS139 in the SCA interface needs to be bent up – there is no use for this inverter after pimping the board. Next the WR# and RD# lines (connectors 39 and 41 on the Joyce expansion port) are wired to the inputs of two NOR gates; Q7# is wired to both other inputs: When WR# and Q7# = L, the NOR gate for reading = H; when RD# and Q7# = L, the NOR gate for writing = H. The latter means that this signal can be directly connected to the C input of the 74LS373 latch for storing write data.

For reading back all 8 bits with the additional 74LS373, the corresponding NOR gate output signal needs to be inverted: This signal goes to both, the C input as well as the OC# chip enable input. When OC# = L; the chip is enabled; when it is H, the outputs are in “tristate”, i.e. not visible on the data bus. All inputs remain active though. When C and OC# = H (wrong address, IORQ# is not = L, RD# is not = L) the outputs of the second 74LS373 are in tristate but the D-inputs follow (transparently) the data bus content. When C and OC# = L, data on the D inputs are immediately latched (no more changes recognized) and the outputs are activated, mirroring the D lines content very shortly before C became L for the time of the RD# signal = L (i.e., the Z80 CPU fetches the data bus content). The moment RD# goes back to H (= data are in the corresponding register of the Z80 CPU), the second 74LS373 goes again into tristate.

This is in principle how it is done on the IBM XT #9771 ISA card as well. I also used a similar approach for my ZX81 and ZX Spectrum interface for #9750. It is a bit different on my Atari 1040 ST, as the printer port is handled differently on these machines.

Here are some pictures of hacking the SCA Systems interface for operating LEGO Interface A with an Amstrad PCW 8512:

640x700.jpg  640x526.jpg

Left: I had to cut into the SCA interface enclosure to access the built-in 74LS373 - this "channels" all 8 data bus lines as well as +5V and GND to the outside. Also the 6 Q outputs going to #9750 are available.
Right: I simply soldered two 1x10 Dupont type connectors to the solder pads of the 74LS373. The wires seen are RD# and WR# from the control bus, Q7# and the new line replacing the Q2# line going to the C input of 74LS373.

640x469.jpg  640x502.jpg

Left: The TTL chip on the lower right is the 74LS373 output latch I am tapping into (or better onto ;)
Right: The add-on board attached to the RCA interface; the front connectors are compatible with the orginal LEGO 20 ribbon wire for the Interface A.

640x462.jpg

As always: Tried to match an enclosure - the golden 1x6 tile is from the stand of my MK Flying Dutchman. 3 windshields make the side walls. Left port: Centronics - still works. Right port: RS232 - still works. Top port: LEGO Interface A - works.

And finally, we can add another computer system from the 1980’s, which was not endorsed by TLG, to @evank #9750 challenge list. The chippies used are all from way before 1990.

I feel good :pir-laugh:.

All the best,
Thorsten

Edited by Toastie
Posted (edited)

Wait, I'm way more interested in your four-way interface to use a single 9750 on multiple computers! :) Tell us how you built THAT please. I could use one of those! (I figure it could easily be done by just routing the power wire of four cables into a simple four-way selector switch. But you know waaaaaaay more about electronics than I ever will.)

PS. You already have bragging rights, but nobody else entered the contest. :laugh_hard:

Edited by evank
Posted (edited)
27 minutes ago, evank said:

But you know waaaaaaay more about electronics than I ever will

Says the guy, who is running a ton of 9767 cards in his Apple ][ :pir-love:

I am using dead cheap DE9 four-way switches (serial port switches) for that purpose; I searched (a lot) for alternatives but did not find anything reasonably priced. 9 wires leaves you with the 8 data lines, 9750 services + GND. You also need +5V though, otherwise the opto-couplers in 9750 won't work. So what I do is adding a 5V/GND jack to the switch, and, as I like lights, an LED indicating power is applied. The computers are attached through 20 -> 9 ribbon cables (you have to make) and only provide their data lines + GND. The 5V needed to drive the couplers in 9750 is provided by the "extra" power supply (any USB power supply would do).

Can make photographs and wiring drawings - just let me know.

Best,
Thorsten

Edited by Toastie

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...