My first wire wrap: Wilf's AT keyboard interface

Discussions about Sinclair ZX80 and ZX81 Hardware
User avatar
1024MAK
Posts: 5101
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: My first wire wrap: Wilf's AT keyboard interface

Post by 1024MAK »

For the I/O, Sinclair treated address lines A0 to A7 as I/O select lines, and in doing so saved money on the logic required for full address decoding.
A0 low (with A1 to A7 all high) then selects one I/O device.
A1 low then selects the next I/O device.
Etc..

So the ZX80, ZX81 and the ZX Spectrum all only use A0 for selecting the keyboard input sense lines. A8 to A15 are used in the keyboard matrix. Again, there is no further decoding, so to scan for an individual key, only one line of the address lines A8 to A15 should be taken low at a time.

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: My first wire wrap: Wilf's AT keyboard interface

Post by mrtinb »

Wouldn't that limit to only 8 external devices?
$FE, $FD, $FB, $F7, $EF, $DF, $BF, $7F
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
User avatar
1024MAK
Posts: 5101
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: My first wire wrap: Wilf's AT keyboard interface

Post by 1024MAK »

Yes, a total of eight I/O devices (assuming all are read and write devices).

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: My first wire wrap: Wilf's AT keyboard interface

Post by PokeMon »

mrtinb wrote: Tue Jan 16, 2018 8:11 pm Wouldn't that limit to only 8 external devices?
$FE, $FD, $FB, $F7, $EF, $DF, $BF, $7F
In general Sinclair only used 3 bits (A0=keyboard, A1=NMI, A2=printer) while the other 5 bits can be used freely and in combination and many 3rd party interfaces did use more than 1 address line. So the 5 bits would allow up to 32 additional i/o devices while in practice it is quite less.

A while ago I made a summary list with most well known interfaces to see if they work together or not.
ZX81ioaddresslist.pdf
(5.62 KiB) Downloaded 339 times
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: My first wire wrap: Wilf's AT keyboard interface

Post by mrtinb »

Now I've connected it to a ZX81, but it gives me only white screen.

It is a simplified version, that only has dip switches to select a button. (The PS/2 will be connected later when I program the microcontroller.)

How can I debug this? I can read all pins on the EEPROM with a digital probe.

The current hardware will just hold down a key all the time. But would this freeze the ZX81?
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: My first wire wrap: Wilf's AT keyboard interface

Post by mrtinb »

Image
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
User avatar
1024MAK
Posts: 5101
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: My first wire wrap: Wilf's AT keyboard interface

Post by 1024MAK »

Is the value of R2 (1m) correct?
Also, I would have thought that you would want to be pulling pin 20 (/CS) of U1 (28C256) to a logic low, not a logic high. Or am I missing something?

Are diodes D1, D2 and D3 type 1N4448? Or is this a typo and they are a actually 1N4148 type? Not that it matters, as they are both silicon signal diodes. It's just that 1N4148 are far more common.

I'm not sure about the diode logic gate formed by D1, D2, D3 and R1. You can use diode-resistor gates when you want an active logic low output (with a pull-up resistor to Vcc +5V), these often work fine (as most logic chips are good at pulling their outputs close to 0V/GND). But diode-resistor gates to give an active high (with a pull-down resistor) are not as reliable. This is due to 5V TTL logic only being specified as having to give a 2.7V logic high output. By the time this has gone through a diode, and been loaded down by a resistor, the logic level may no longer be high enough for the 28C256 to see the input (pin 22) as a logic high.

So you may want to use a real OR gate chip such as a 74LS32 or 74HCT32. Or use a triple input NOR gate chip (74LS27, 74HCT27) and use a second gate to invert the output of the first gate.

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: My first wire wrap: Wilf's AT keyboard interface

Post by mrtinb »

I'm trying to implement Wilf's circuit as mentioned in the first post.

I hope I have not made any mistakes.

I for the time being I have replaced the PICAXE18X with a few DIP switches just to see if it's working. After this circuit is working I will program an Arduino in place of the PICAXE18X.

Code: Select all

                  THE ZX-ATKEY CIRCUIT

                                    5V                    5V  5V
ZX81 PCB REAR        ZX/ASCII ROM    |                     |   |     AT KBD
EDGE CONNECTOR         27C256       1M        PICAXE18X  4.7K 4.7K    PLUG
                   ______________    | 0.1    _________    |   |
+5V  ---> 5V      |           CE |20-+-||--13|OUT7     |   |   |      DATA
D0   -----------11| D0        A8 |25--------6|OUT0  IN7|16-+---|--------o
D1   -----------12| D1        A9 |24--------7|OUT1  IN6|15_    |   0V-o   o-5V
D2   -----------13| D2       A10 |21--------8|OUT2     |   `---+------o   o
D3   -----------15| D3       A11 |23--------9|OUT3     |            CLOCK
D4   -----------16| D4       A12 |2--------10|OUT4     |
A8   -----------10| A0       A13 |26-------11|OUT5     | 
A9   ------------9| A1       A14 |27-------12|OUT6     |
A10  ------------8| A2           |           |         | 
A11  ------------7| A3        D5 |17-------17|IN0      | 
A12  ------------6| A4        D6 |18-------18|IN1      | 
A13  ------------5| A5        D7 |19--------3|IN2      |
A14  ------------4| A6           |           |     SOUT|2--180---- SERIAL OUT     
A15  ------------3| A7           |    5V     |      SIN|3--22K--+- SERIAL IN
A0   -->|--+----22|OE         Vdd|28---|---14|Vdd      |        |
    1N4448 |      |           Vpp|1____|     |    RESET|4 __   10K
RD   -->|--+      |_____Vss______|     |     |___Vss___|    |   |
           |             |14           |          |5        |  0V
IORQ -->|--+---[4.7K]----|            === 0.1     |         |
0V   ____________________|_____________|__________|         |
RST  _______________________________________________________|
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: My first wire wrap: Wilf's AT keyboard interface

Post by mrtinb »

1024MAK wrote: Mon Jan 22, 2018 6:10 pm Is the value of R2 (1m) correct?
Looking at Wilf's schematic that seems right.
1024MAK wrote: Mon Jan 22, 2018 6:10 pm Also, I would have thought that you would want to be pulling pin 20 (/CS) of U1 (28C256) to a logic low, not a logic high. Or am I missing something?
Wilf's schematic is for 27C256. I've used a 28C256 in my design (actually a 28C64 to start with). Maybe the chips act differently?
1024MAK wrote: Mon Jan 22, 2018 6:10 pm Are diodes D1, D2 and D3 type 1N4448? Or is this a typo and they are a actually 1N4148 type? Not that it matters, as they are both silicon signal diodes. It's just that 1N4148 are far more common.
Again Wilf's schematics have 1N4448. I've got little experience in eletronics but trying to create a newer version of Wilf's design with an Arduino that is easily obtainable today and easy to program.
1024MAK wrote: Mon Jan 22, 2018 6:10 pm I'm not sure about the diode logic gate formed by D1, D2, D3 and R1. You can use diode-resistor gates when you want an active logic low output (with a pull-up resistor to Vcc +5V), these often work fine (as most logic chips are good at pulling their outputs close to 0V/GND). But diode-resistor gates to give an active high (with a pull-down resistor) are not as reliable. This is due to 5V TTL logic only being specified as having to give a 2.7V logic high output. By the time this has gone through a diode, and been loaded down by a resistor, the logic level may no longer be high enough for the 28C256 to see the input (pin 22) as a logic high.
So you may want to use a real OR gate chip such as a 74LS32 or 74HCT32. Or use a triple input NOR gate chip (74LS27, 74HCT27) and use a second gate to invert the output of the first gate.
I don't understand that part of the schematic. I just copied it. :)
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: My first wire wrap: Wilf's AT keyboard interface

Post by mrtinb »

mrtinb wrote: Sun Jan 21, 2018 10:28 pmNow I've connected it to a ZX81, but it gives me only white screen.
mrtinb wrote: Sun Jan 21, 2018 10:28 pmHow can I debug this? I can read all pins on the EEPROM with a digital probe.
I've had time to sit down with the probe and voltmeter.

DoH!!!

The connections for edge connector top were connected to bottom and visa versa. Luckily nothing was connected to 9V.

Back to wiring again ;-)
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
Post Reply