VP100 replica project started (ZX81 in minitel terminal)

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

Re: VP100 replica project started (ZX81 in minitel terminal)

Post by 1024MAK »

Note: in the following text, the assumption is that the connection is via the ZX81 built in keyboard connections.

Three things:

The ZX81 keyboard lines that are derived from the A8 to A15 address lines will change state whenever the Z80 puts any address out on the address bus. This includes reading the next instruction, the refresh address, and when reading or writing from/to memory or from/to an I/O port. With just these eight address lines, it’s not easy to work out what the Z80 is doing.

Because these lines go via diodes (D1 to D8), the signals may not go to valid logic high (one) levels. The reason for the diodes, is to partly isolate the keyboard matrix from the rest of the devices on the address bus and so that the address lines A8 to A15 can only pull down the ULA input lines. The ULA input lines being normally held high by the five resistors.

Although the ZX81 ROM code only normally takes one of the A8 to A15 address lines low when reading the keyboard, it’s possible that some games written in machine code may take more than one address line (A8 to A15) low. Or maybe all of them if the game only wants to detect any key being pressed.

So to overcome the signal level problem caused by the diodes, use one resistor per line, with each resistor connected to +5V. I suggest using a value of 4.7k for the resistors.

There is no point in trying to work out what the Z80 is doing. Because it does not really matter. The microcontroller just has to use whatever number it reads as a index to a table. In the table it should have stored a value based on its last read of the real keyboard that it is attached to. It just takes the stored value and outputs this to the five lines that go to the ULA. Note that the output value should be latched and maintained until it needs to change state. Because the microcontroller has no way to know when the Z80 has read the value.

The tricky bit is because it is difficult to synchronise between the Z80 and the microcontroller, the microcontroller has to run fast enough that when it sees a change of value on the eight address lines (A8 to A15) it immediately does a table look up, outputs the stored value, then does a scan of the real keyboard, before working out what values to store in the table.

This may sound like it’s doing things the wrong way round, but because of the speed at which the system runs compared to the slow speed of a human finger, even if the key pressed is missed on the first pass, it will be detected on the second pass and a human will not notice any delay at all.

Also, it does not matter if the change of state on the address lines (A8 to A15) is not a keyboard read. Because there is no harm in providing incorrect information when it is not a keyboard read, as the Z80 will not be reading the ULA keyboard input lines.

Of course if you only ever intend to connect to an external keyboard interface, then you can simplify things, as then you can pick up the /IORQ control signal. This goes low whenever the Z80 accesses an input or output port. Hence the microcontroller only has to provide data to the Z80 when /IORQ is low. The rest of the time it can ignore A8 to A15.

I hope this helps.

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: 1910
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: VP100 replica project started (ZX81 in minitel terminal)

Post by mrtinb »

The membrane layout on the Minitel keyboard is SLIGHTLY different than the ZX81 membrane. :lol:

Image
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
User avatar
XavSnap
Posts: 1941
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: VP100 replica project started (ZX81 in minitel terminal)

Post by XavSnap »

:lol:

Right now, you just had to merge the UDG characters in the Zx ROM !
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
mrtinb
Posts: 1910
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: VP100 replica project started (ZX81 in minitel terminal)

Post by mrtinb »

:mrgreen: I’ll take a different approach :D
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
Post Reply