ZX81 ULA-in-a-CPLD

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
overCLK
Posts: 18
Joined: Wed Nov 07, 2018 10:12 pm
Location: Spain

Re: ZX81 ULA-in-a-CPLD

Post by overCLK »

McKlaud wrote: Sat Nov 10, 2018 12:51 pm Looking at your snapshots, the NMI generation was re-entered successfully a few times and then stopped The is something weird going on. I think the same is going on in my case.
Exactly. But I'm not able to find the condition that produces that. It is really interesting to know that something similar is happening to you.

I've spent some time this morning looking again at some captures and at the firmware sources. I've seen that:
- The CPLD seems to properly run the NMI detection check in $207. I can see how the NMI generator is turned on, then off, and a NMI pulse comes in between.
- Then I see how the NMI pulses for the upper blank lines are generated.
- Afterwards I can see the HALT pulses for the screen rendering.
- Then the bottom blank lines.
- Then back again the upper blank lines.
- Then the HALT (I assume the one in NMI-CONT)
- Then... silence. :-)

But there's something weird here, for whatever reason, the pulse-train length of the bottom blank lines is quite different to the length of the upper blank lines. I've put some markers to find that from first NMI pulse to HALT (in NMI-CONT) they spend 3.2 ms and 2.1 ms respectively.
Looking at the period of the NMI pulses in both trains, they are also pretty different: 39,3 us versus 63,7 us (with the original ULA I measure 62,2 us). The NMI pulse width itself seems to be consistent (around 5.125 us). Take into account that I'm sampling at 16Mhz, so I assume that an error of ~ 0,06 us should be considered. I haven't found difference in the CPU clock frequency or duty cycle in these zones, so there should be another reason for this weird behaviour.
nmi-pulse-train.png
Sadly it seems that this is not consistent in all captures. I have another one where the period of the NMI pulses stays around 63,7 us and the NMI generation also get stopped suddenly. The weird thing in this case is that I can see the IOREQ/WR operation to disable the NMI, but I cannot see the previous HALT, even worse in this case I can only count 52 pulses in the pulse train. :?:
no-halt.png
Probably two different problems, no idea if related or not.
Last edited by overCLK on Sat Nov 10, 2018 1:39 pm, edited 1 time in total.
User avatar
1024MAK
Posts: 5103
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: ZX81 ULA-in-a-CPLD

Post by 1024MAK »

Are you both using original Sinclair ROM chips?
If yes, which make / type?

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.
overCLK
Posts: 18
Joined: Wed Nov 07, 2018 10:12 pm
Location: Spain

Re: ZX81 ULA-in-a-CPLD

Post by overCLK »

1024MAK wrote: Sat Nov 10, 2018 1:38 pm Are you both using original Sinclair ROM chips?
If yes, which make / type?

Mark
I am. Marked as:
Sinclair Research 860 3PD.
D2364C 649
(C) 1981
User avatar
1024MAK
Posts: 5103
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: ZX81 ULA-in-a-CPLD

Post by 1024MAK »

The only thing that releases the CPU from a HALT condition is an interrupt ( /NMI or /INT or indeed/RESET), so if the interrupt generation is switched off...

The ROM code produces all OUT commands...

But you probably know all this.

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
1024MAK
Posts: 5103
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: ZX81 ULA-in-a-CPLD

Post by 1024MAK »

overCLK wrote: Sat Nov 10, 2018 1:41 pm
1024MAK wrote: Sat Nov 10, 2018 1:38 pm Are you both using original Sinclair ROM chips?
If yes, which make / type?

Mark
I am. Marked as:
Sinclair Research 860 3PD.
D2364C 649
(C) 1981
Why I ask is the comments made in this post by Andy.

Could the accesses to the ROM be marginal?

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.
McKlaud
Posts: 337
Joined: Tue Dec 19, 2017 10:02 pm
Location: St Albans, UK

Re: ZX81 ULA-in-a-CPLD

Post by McKlaud »

Mark,

Thanks for ideas, but I've tried my ULA it two different board. One was fitted with newer 27C64 chip with programmed the latest ROM. The same issues on both PCBs.
Claudius
----------
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: ZX81 ULA-in-a-CPLD

Post by Moggy »

Whilst knowing nothing about the original problem I can concur with Mark re the ROM.

I have a Hunter EPROM board fitted with 4x 2716 EPROMS and all kinds of weird stuff would happen if I used it in conjunction with the Sinclair ROM described above(three all behaved the same).

One example would be the call to break not being recognised in M/C programs and I had to use Mostek ROMS for this board to work with external EPROM boards.
User avatar
1024MAK
Posts: 5103
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: ZX81 ULA-in-a-CPLD

Post by 1024MAK »

McKlaud wrote: Sat Nov 10, 2018 2:56 pm Mark,

Thanks for ideas, but I've tried my ULA it two different board. One was fitted with newer 27C64 chip with programmed the latest ROM. The same issues on both PCBs.
Well then, at least that may be something that’s eliminated.

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.
overCLK
Posts: 18
Joined: Wed Nov 07, 2018 10:12 pm
Location: Spain

Re: ZX81 ULA-in-a-CPLD

Post by overCLK »

Thank you all a lot for suggestions and brainstorming.
I think I've already tried with an W27c512 EEPROM with the ZX81 ROM in. I'm not sure though. I will give it a try again just to be sure.
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: ZX81 ULA-in-a-CPLD

Post by Andy Rea »

if you have the ability to program eeprom, then you could write some test code, simple loops repeatedly turning on and off the nmi, see if that turns up anything useful on the logic analyser.

also.. the zx80 / 81 link... has a pullup resistor right ?

also try turning of bit-keeper ( i think thats whats its called ) and select float in the fitter options for the cpld iirc aint at that computer right now

regards andy
what's that Smell.... smells like fresh flux and solder fumes...
Post Reply