Page 22 of 24

Re: ZX81 ULA-in-a-CPLD

Posted: Sat Nov 10, 2018 1:37 pm
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.

Re: ZX81 ULA-in-a-CPLD

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

Mark

Re: ZX81 ULA-in-a-CPLD

Posted: Sat Nov 10, 2018 1:41 pm
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

Re: ZX81 ULA-in-a-CPLD

Posted: Sat Nov 10, 2018 1:45 pm
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

Re: ZX81 ULA-in-a-CPLD

Posted: Sat Nov 10, 2018 1:48 pm
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

Re: ZX81 ULA-in-a-CPLD

Posted: Sat Nov 10, 2018 2:56 pm
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.

Re: ZX81 ULA-in-a-CPLD

Posted: Sat Nov 10, 2018 2:57 pm
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.

Re: ZX81 ULA-in-a-CPLD

Posted: Sat Nov 10, 2018 3:31 pm
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

Re: ZX81 ULA-in-a-CPLD

Posted: Sat Nov 10, 2018 4:05 pm
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.

Re: ZX81 ULA-in-a-CPLD

Posted: Sat Nov 10, 2018 4:23 pm
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