avatar_eto

Reliable source for NMOS Z80? Z0840004PSC really/alwways supports out(c),0?

Started by eto, 01:48, 14 January 25

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

eto

I just went through a couple of hours of bug tracking just to recognize  that my Z0840004PSC is not an NMOS CPU - or at least it does not behave like Arkos Tracker expects it (undocumented opcodes).

I could test 3 different Z0840004PSC CPUs, all from the same seller, and only one of them behaved correctly. The others produced white noise when I played back music with Arkos Tracker.

Basically I have two questions: Do we know for sure that all Z0840004PSC should be NMOS and should all behave identically? Or is there the possibility that they changed the  behaviour but not the name?



If they should behave identically: Can someone recommend a reliable source where I can be sure to get NMOS CPUs and not relabelled ones? The last batch I bought was from a seller (adeleparts) who was recommended here as being trustworthy, but obviously something went wrong...


McArti0

It would be better if someone started producing miniature hardware patches and forgot about power-hungry NMOS.

CPC 6128, Whole 6128 and Only 6128, with .....
NewPAL v3 for use all 128kB RAM by CRTC as VRAM
One chip drver for 512kB extRAM 6128
TYPICAL :) TV Funai 22FL532/10 with VGA-RGB-in.

pelrun


eto

additional question: Can I also use a Z80B CPU? Or is there any reason not to do it?

I found some Zilog Z8400BPS from a source in Europe (I already bought other ICs in the past from them) and they are cheaper than Z80A from China.

Prodatron


GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

eto

Quote from: Prodatron on 20:16, 14 January 25Maybe you remember this thread:

https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/replacement-z80a-cpu/msg220201/#msg220201

It seems: Yes, you can.
Now I do... ;)

there is actually also the link to the seller which was recommended - but at least 2 of the CPUs I bought from this seller behave differently than the NMOS Z80.

McArti0

CPC 6128, Whole 6128 and Only 6128, with .....
NewPAL v3 for use all 128kB RAM by CRTC as VRAM
One chip drver for 512kB extRAM 6128
TYPICAL :) TV Funai 22FL532/10 with VGA-RGB-in.

Brocky

what about the other z80 derivatives? the mostek, sharp or toshiba branded z80s?... 
im sure the mostek chips are identical internals so have the undocumented opcodes.. not sure about the others tho..

Egg Master

Quote from: McArti0 on 02:36, 14 January 25It would be better if someone started producing miniature hardware patches and forgot about power-hungry NMOS.
It seems to be the same for the CRTC. 200mA to 100mA depending on the circuit version.
Is it really a CPC power consumption issue now? And CTM vs LCD?

- PSC is "standard" temperature range (0°C to 70°C)
- PEC is "extended" temperature range (-40°C to 100°C)

- Z84xx is expected to be NMOS
- Z84Cxx is expected to be CMOS

If you would like to know if a Z84xx PSC/PEC is a real NMOS or a relabeled CMOS circuit, test its power consumption.
May be the Zilog "bug fix" was applied to the CPU design was already existing on the last produced NMOS circuits?

Anyway, can the Z80 really fail often, or is it just because the tests are focused on it?
Sometime, someone search for a problem for witch he has already found a solution.



Prodatron

Quote from: Egg Master on 07:10, 15 January 25May be the Zilog "bug fix" was applied to the CPU design was already existing on the last produced NMOS circuits?

Anyway, can the Z80 really fail often, or is it just because the tests are focused on it?
It's not a bug, it's an illegal opcode, for which the CPU wasn't designed for.
This opcode "works" both on the NMOS and CMOS version somehow in the same way, but because of the different characteristics it outs #00 on NMOS and #FF on CMOS:
https://www.cpcwiki.eu/forum/software-related/what-software-requires-c3-ram-banking/msg246687/#msg246687

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Egg Master

Quote from: Prodatron on 09:23, 15 January 25It's not a bug, it's an illegal opcode, for which the CPU wasn't designed for.
OK. Another change between that can be tested:

LD A,R
LD A,I

- NMOS: P/V flag cleared if interrupt received during the execution
- CMOS: No "bug"


eto

Quote from: Egg Master on 11:17, 15 January 25Another change between that can be tested:
interesting. Could you provide a simple source that would test this behaviour? Not sure how I can force an interrupt in between those commands. 

Quote from: Egg Master on 07:10, 15 January 25Anyway, can the Z80 really fail often, or is it just because the tests are focused on it?
Depends on what you experience as often. The Z80 in the CPC can fail and we see it every now and then that it needs to be replaced. It's also needed for replica CPCs. So definitely there is a demand. The problem now seems to be to be sure to get a NMOS CPU when ordering a replacement as otherwise you will hear a lot of noise in many productions. 

Egg Master

I read this from @arnoldemu many years ago. I don't have any code on this.

The only problem I've had with sound is related to the arkos tracker player. 
Many programs use it, but maybe it can be patched? And fixed from AT3? 
There's no good in getting optimizations from known compatibility issues.

McArti0

Next theory ...

https://www.speccy.pl/forum/index.php?topic=7536.0

Two Z80 Sharp LH5080(A) and LH5080(A)L
"I speculate that the implicit instruction OUT (C),0 was used to detect the low-power mode, and only Sharp produced both versions - those with L had this mode)"

CP/M soft to detect z80 CPU.
https://github.com/skiselev/z80-tests
CPC 6128, Whole 6128 and Only 6128, with .....
NewPAL v3 for use all 128kB RAM by CRTC as VRAM
One chip drver for 512kB extRAM 6128
TYPICAL :) TV Funai 22FL532/10 with VGA-RGB-in.

arnoldemu

Quote from: eto on 12:18, 15 January 25
Quote from: Egg Master on 11:17, 15 January 25Another change between that can be tested:
interesting. Could you provide a simple source that would test this behaviour? Not sure how I can force an interrupt in between those commands.
I've got a test program that will do it. I will find it. 
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

arnoldemu

Quote from: Egg Master on 11:17, 15 January 25
Quote from: Prodatron on 09:23, 15 January 25It's not a bug, it's an illegal opcode, for which the CPU wasn't designed for.
OK. Another change between that can be tested:
LD A,R
LD A,I
- NMOS: P/V flag cleared if interrupt received during the execution
- CMOS: No "bug"
https://bitsavers.org/components/zilog/z80/1989_Zilog_Z80_Family_Data_Book.pdf page 412 has a question related to it. 
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Prodatron

Quote from: Egg Master on 12:41, 15 January 25The only problem I've had with sound is related to the arkos tracker player.
I am pretty sure, that OUT (C),0 wasn't introduced by Arkos Tracker for accessing the PSG. IIRC I saw this already before, so it should affect more players. But it's true that e.g. the original Sound Trakker player doesn't use this optimization, and should work with CMOS CPUs as well.


Quote from: Egg Master on 12:41, 15 January 25Many programs use it, but maybe it can be patched? And fixed from AT3?
There's no good in getting optimizations from known compatibility issues.
Erm, this sounds like it would be a software bug in Arkos, which isn't. Original CPCs never used CMOS Z80, so the Arkos player is 100% compatible ;) 

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

GUNHED

Quote from: eto on 19:45, 14 January 25additional question: Can I also use a Z80B CPU? Or is there any reason not to do it?

I found some Zilog Z8400BPS from a source in Europe (I already bought other ICs in the past from them) and they are cheaper than Z80A from China.
Sure, Z80B works without a problem. One of my CPCs runs well at 6 MHz.  :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2024.10.27)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

eto

Quote from: GUNHED on 14:46, 15 January 25Sure, Z80B works without a problem. One of my CPCs runs well at 6 MHz.  :)
and it also runs properly at 4MHz and plays Arkos Tracker music (at 4MHz)? I guess it does and would be surprised if not but just to make sure...

Egg Master

Quote from: Prodatron on 14:36, 15 January 25Erm, this sounds like it would be a software bug in Arkos, which isn't. Original CPCs never used CMOS Z80, so the Arkos player is 100% compatible ;)
I'm not saying it's a software bug, but that I've noticed this problem on games using this audio player on CPC when exchanging the Z80 to fix one of my computers. Arkos Tracker is a fairly recent software written when the CMOS compatibility issue was already known. So, I can imagine the players for other Z80 computers are more safe. :)


andycadley

Quote from: Egg Master on 19:46, 15 January 25
Quote from: Prodatron on 14:36, 15 January 25Erm, this sounds like it would be a software bug in Arkos, which isn't. Original CPCs never used CMOS Z80, so the Arkos player is 100% compatible ;)
I'm not saying it's a software bug, but that I've noticed this problem on games using this audio player on CPC when exchanging the Z80 to fix one of my computers. Arkos Tracker is a fairly recent software written when the CMOS compatibility issue was already known. So, I can imagine the players for other Z80 computers are more safe. :)


The trick of using OUT (C), 0 was widely known and used back in the day across most 8-bit Z80 machines, so I wouldn't be surprised to find that using a CMOS chip in any of them will lead to some odd issues (whether it's music or other stuff).

Prodatron

Quote from: Egg Master on 19:46, 15 January 25So, I can imagine the players for other Z80 computers are more safe. :)
Yes, because they have no PPI between the Z80 and the PSG.
On a Spectrum or an MSX you can access the PSG directly with two dedicated ports, so there is no need for OUT (C),0 to it speed up.

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

eto

Quote from: eto on 01:48, 14 January 25I could test 3 different Z0840004PSC CPUs, all from the same seller, and only one of them behaved correctly. The others produced white noise when I played back music with Arkos Tracker.

I finally checked the power consumption and it was clearly different. The Z0840004PSC which plays sound correctly consumed about the same power as other NMOS Z80s. The other two CPUs (with noise instead of sound) consumed around 170mA less.

So... probably fake NMOS CPUs.

Brocky

i wonder if this could be checked for and fixed in software....like stuff already detects 6128 vs 464 and calls different routines...

just to futureproof ourselves with z80s not being made anymore...and NMOS starting to get a little hard to find already....
is it possible to detect the difference in that out(c),0 instruction...and then compensate in the (future) code..(eg new Arkos player).. it looks like its simply inverted

McArti0

But this is a retro forum and most of it contains past code  ;)

here you need a hardware patch for CMOS. 
CPC 6128, Whole 6128 and Only 6128, with .....
NewPAL v3 for use all 128kB RAM by CRTC as VRAM
One chip drver for 512kB extRAM 6128
TYPICAL :) TV Funai 22FL532/10 with VGA-RGB-in.

Powered by SMFPacks Menu Editor Mod