Differentuating a different logic states/pulses on oscilloscope

Discussions about Sinclair ZX80 and ZX81 Hardware
willinliv
Posts: 46
Joined: Sun Jun 28, 2020 9:07 pm

Re: Differentuating a different logic states/pulses on oscilloscope

Post by willinliv »

Awesome Mark! Thank you once again - adding this to my notebook, and it's something I need to go over again to start to understand. But the system descriptions are fantastic and it was about this that I am truely amazed, not to mention the fact it does what it does whilst juggling display etc. I was reading the article on Tynemouth Software (How the ZX80 works) this morning and your description of how the system works is bringing it all together.

A bit of progress on my part in the electronics department. I have a working Issue 3 that I'd been intending to use for reference, and two issue 1's (1 of which looks nice and is an early-ish(?) one and although broken has been in my possession for sometime, and reading this post viewtopic.php?f=7&t=3506 gave me a few pointers, trying to save to tape blind (no cursor), and trying with a known-good 16k RAM pack. Still no dice. I had used my scope to look at the ULA and no clock/pulse on pin 14. It is unsocketed and have a VLA81 that I ordered. Was going through process of unsoldering as best I could to prevent damage to PCB, but with just wire braid and a manual solder sucker I just could not do it and was scared to damage the tracks, so was preparing to cut the pins to remove, gave it one last look through the oscilloscope and suddenly the clock was there and displaying at 3Mhz. Still no cursor/video signal, but put this down to practically all solder removed. Resoldered, grey screen, clock (pin 14 and 6 on MPU) and pulses on some lines but not the address ones. Maybe I hadn't checked the clock properly or first time. Contemplating what to do next, also looking at that post above, took out carefully the socketed Z80 and replaced with a different one and bingo! Very clear image through RF, works nicely from my simple testing, outputs to tape, takes 16k, loaded from a wav file of 3D Monster Maze from my audio recorder. Very happy about this because it's a nice unit and now fully working. I'm wondering if I should put in the composite video mod or not (the small one that fits in the modulator from TFW8b), or just leave it as is. But very happy - 2/3 working, and getting time to actually take it for a spin and try out it's implementation of basic. Some pics attached. I wasn't going to do it, but time I think for a cycle ride to the local hostelry to celebrate!

Thanks Mark and colleagues for your help, here and in your past work with other punters which is invaluable, and it's clear that it's you guys who help make this the friendly community that it obviously is!
Attachments
IMG_20200704_181427.jpg
IMG_20200704_174919.jpg
User avatar
1024MAK
Posts: 5118
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Differentuating a different logic states/pulses on oscilloscope

Post by 1024MAK »

In a Z80 based system, the control lines are essential. They are like the command structure in a military operation. They control and keep order and keep everything in step.

The main control lines are:
  • /MREQ - (memory request) used by the Z80 to signal that the current cycle is a memory cycle and that it requires the memory chips to be ready to communicate. The address on the address bus is a memory address.
  • /IORQ - (I/O request) used by the Z80 to signal that the current cycle is an I/O operation and that it requires the I/O chips to be ready to communicate. The address on the address bus is a I/O device address.
  • /RD (read) - The Z80 is signalling that it wants to read data from either a memory chip or an I/O chip. It sets it’s data bus pins to input mode.
  • /WR (write) - The Z80 is signalling that it wants to write data to either a memory chip or an I/O chip. It sets it’s data bus pins to output mode.
In the following notes, please note that I am not going into full details and will not be describing every detail of the operation. This is for clarity in order to describe only the basic principles.

Now, most memory and I/O chips will be general purpose chips and not be designed specifically for use with any particular MPU. And different computer manufacturers will want different set-ups. For example different amounts of memory and different I/O devices.

So we need some extra circuitry to ‘glue’ all the different chips and the control circuits together. Hence the term ‘glue logic’.

In the ZX81, the custom chip, the ULA does all this. Compare a ZX81 to a ZX80 and you will see a mass of small chips. Okay some of these do the I/O functions, but the rest are the ‘glue logic’. In a ZX81, the ULA does all the ‘glue logic’ functions and nearly all the ‘I/O’ functions.

The ‘glue logic’ does the address decoding. This is where the upper address lines are used to select if the address on the address bus is for the ROM chip or the RAM chip(s). The ‘glue logic’ combines some of the various control signals together, as, for example, the ROM chip only has one control input pin.

When the /RESET pulse ends, the Z80, having cleared it’s program counter (PC) register (which is 16 bits wide) to zero, then proceeds to take /MREQ and /RD low (to their active states) and puts the value from the PC onto the address bus. The ULA acting as the address decoder then decodes this address, works out that it maps to the ROM, combines the control signals and then signals to the ROM chip via it’s control line (/ROMCS).

When the ROM sees it’s control line go to the active state (low), it grabs a copy of the address on the address bus. Then uses this address to index to the correct memory location. It then puts the relevant data byte on the data bus. All this has to happen really quickly, as the Z80 only allows a very short time before it will raise /RD to a high level. At this point it reads the data byte from the data bus.

Being as this is the first fetch from memory after reset, this will be a byte of data for an instruction. The Z80 will then decode the instruction. Once the instruction has been decoded, the Z80 will perform the action required (if no further memory access is needed) otherwise it will either fetch another data byte, or write a byte to memory. Once it has finished with the current instruction, it will read another instruction. Each time it accesses the memory, the PC is incremented so that the value on the address bus counts up to the next address of the next memory location.

In this way the Z80 will read the program from the ROM, working it’s way through each instruction one 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.
willinliv
Posts: 46
Joined: Sun Jun 28, 2020 9:07 pm

Re: Differentuating a different logic states/pulses on oscilloscope

Post by willinliv »

Mark, that's amazing! I asked in the Welcome section of the forum if anybody had any pointers for understanding how the system worked from a bunch of generic off the shelf chips, who issues instructions etc. and you have definately answered that, thank you so much! I feel like the last message here is the final piece in the jigsaw! I need to go again over the earlier posts now but this is now making sense. It is unbelievable how things work, at such pace, infinately creative and yet logical at the same time. What an amazing machine almost 40 years later (same age as me) it's still able to lift the lid of computer science :D
Moggy
Posts: 3267
Joined: Wed Jun 18, 2008 2:00 pm

Re: Differentuating a different logic states/pulses on oscilloscope

Post by Moggy »

Can I add my personal thanks too Mark for this most enlightening,informative series of posts?
This should definitely be placed somewhere prominently for people new to the zeddy to use as a go-to and for those like myself who are less technically minded to refer to now and then.

Excellent just excellent.
User avatar
1024MAK
Posts: 5118
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Differentuating a different logic states/pulses on oscilloscope

Post by 1024MAK »

At some point, I’ll split out the relevant posts into a new topic.

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.
Post Reply