News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_SerErris

DiagROM a small MX4 board to attach a diagnostic rom

Started by SerErris, 23:53, 02 March 22

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TotO

Quote from: geraldYes !
Where is the fun without that option ;D
Only to use less parts. ;D
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

SerErris

Thanks for all your input and good catch on the 8NAND gate.

So today I have a break, tomorrow I will restart refreshed.

Regarding the separated enable. If you just would want to use it purely for diagnostic, you can leave out the complete logic snd just pull ROMDIS high with a resistor use just romen to enable the rom.

So I needed logic to correctly handle the upper rom (not to interfere with other roms) and then the additional jumper is not that big of invest.
Proud owner of 2 Schneider CPC 464, 1 Schneider CPC 6128, GT65 and lots of books
Still learning all the details on how things work.

SerErris

Looking at the other thread here about the Diagnostic ROM, I found out, that the Dandanator can activate/deactivate the EPROM lower ROM on demand. 

The method it rather clever, but nothing that can be implemented in simple hardware.

The Dandanatro has a CPLD and is sniffing the M1 cycle (instruction fetch) of the CPU. So it reads the memory bus on activation of M1 and MREQ (and maybe even read, i did not dive into the details yet). However if reacts on a series of &FDFDFDxx commands which is an actual Z80 instruction that does nothing to the CPU itself and then doing a simple load afterwords (the load itself does not matter), it is only indication for the CPLD to act. Based on this activity - the CPLD sets up an internal register to reflect the status of the lower rom and either reacts on ROMEN or not. The Register Part and the AND is not a problem. However checking 3x FD in a row and reacting on you need a state machine for it to do it, and setting this up with simple TTL logic will not work in any decent #of chips.

I am not sure if my bord still makes sense? Yes you could run the diagnostics ROM ... but you will not be able to test your internal ROM, because thise functionality that is required to page out the external lower ROM is missing. 

The only chance would be to change the ROM and the board to work on a different approach. 

As the Diagnostic ROM can only check the first 16 upper roms with its routines, I could use the bit 7 to activate or deactivate the lower EPROM.

0x1000xxxx lower rom 0 disabled
0x0000xxxx lower rom 0 enabled.

That would give me the potential to do a simple thing:

;C holds the ROM selection #(0-15)
;Deactivate Lower ROM
LD B,&DF               ;RomSelectAddress
LD A,&80               ;Set bit 7
OR A,C                  ;of existing C
OUT (C),C              ;output C to &DFxx

;C holds rom configuration number
;Activate Lower ROM
LD B,&DF               ;RomSelectAddress
LD A,&7F               ;deactivate bit 7
AND A,C                ;in C
OUT (C),C              ;Output C to RomSelect Address

Do you think that is a feasible idea?
Proud owner of 2 Schneider CPC 464, 1 Schneider CPC 6128, GT65 and lots of books
Still learning all the details on how things work.

SerErris

Okay, new Version ... now V3.

Schematic attached.

The glue logic now reacts on:
  NOT(A13 OR ~IORQ) => ROMSEL (CLK for the FlipFlops)
  OR(D3:D0) OR SW1 => ~HISEL0
  D7 OR SW0 => ~LOSEL
  ~ROMEN OR A14 OR ~LOSEL => ~LOOE  (low OE)
  ~ROMEN OR NOT(A14) OR ~HISEL => ~HIOE
  ~HIOE OR ~LOOE => ~OE
  NOT(~OE) => ROMDIS

Features:
  - enable both ROMS (Upper0 and Lower) via Software.
  - Lower ROM enable/disable mechanism is compatible with normal Firmware behaviour (default is enabled if present).
  - can permanently enable Lower Rom0 (switch SW0), this overwrites any software flag.
  - can disable Upper ROM0 (SW1).

Considerations:
  - You can only select both parts together, the software enable/disable are not independent of each other. You need to multiplex both into a single upper rom select OUT.
  - Any normal upper rom enablement will also enable the lower ROM, regardless if it was disabled before or not. I am not sure if that is any problem with the Diagnostic ROM. For any other it is no issue, as you will never disable the lower ROM, but use the normal ROMEN flag from Gatearray (which will just select LOWER or RAM).
  - I would love to find another way of disabeling it, so that it could be set independent of the upper rom selection procedure. I need to revisit the Hardware Expansion book on that. I thing there are unused bits ... So I could use one of those perhaps instead of D7. 


 
Proud owner of 2 Schneider CPC 464, 1 Schneider CPC 6128, GT65 and lots of books
Still learning all the details on how things work.

TotO

When the dips are not set to 5v, the 74*32 inputs are floating?
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

SerErris

Hmm .. you are right ... I need a pulldown... 
Proud owner of 2 Schneider CPC 464, 1 Schneider CPC 6128, GT65 and lots of books
Still learning all the details on how things work.

SerErris

Okay, I decided after reading the "Das Schneider CPC Systembuch" to change the selection of Lower rom to the decoding method of the Expansion port BIT together with Bit4. So it would be a A10 OR A4 => ~SELECTLOWER.

That makes a selection of the Lower ROM completely independent of the Upper ROM and the normal Upper ROM logic applies.

So as soon as Lower ROM is disabled the internal CPC ROM will kick in. I am actually thinking of disabling both, but now I need to study the source code of the Diagnostic ROM to understand how it is used to select deselect the individual parts. 

It is such an interesting topic :-)
Proud owner of 2 Schneider CPC 464, 1 Schneider CPC 6128, GT65 and lots of books
Still learning all the details on how things work.

SerErris

Checking the sourcecode for the ROM the lower rom is only disabled for a single purpose (checking the build in lower ROM). So I wonder if I actually need a separate solution or if that solution I do have in V3 is good enough?

The alternative would require to decode both A10 and A4 and needs more logic.

Decoding A10+IOREQ into CLK + A4 as register value.

It would require two independent D-FlipFlops with independent clocks and also another OR gate ... All that for the purpose that it is most likely only needed for the Diagnostic ROM and I could actually use the other method for that as it is exactly turned off and on a single time (ROM test). 

I am not sure if any other configuration ever wants to turn off the lower ROM and instead use the internal one.

Proud owner of 2 Schneider CPC 464, 1 Schneider CPC 6128, GT65 and lots of books
Still learning all the details on how things work.

TotO

A10 is related to the external peripherals like the FDC and the COM expansions.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

SerErris

A10 is related to external peripherals, that is correct but then the lower 8 bits are getting analyzed.

Really the German book "Schneider CPC Systembuch" is great:
https://k1-spdns-de.translate.goog/Vintage/Schneider%20CPC/Das%20Schneider%20CPC%20Systembuch/z89.htm?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=de&_x_tr_pto=wapp#A

So for accessing the Disk controller for instance you have to check A10 AND A7 are low.

If you look at the table in the book bits A2 to A4 are free and not used by the CPC ROMs or hardware in any way. So a possible way would be to check A10 and A4 both are low.

But as I said, this is a very unique requirement. Who normally wants to be able to disable the external lower ROM completely?

I did now however enabled the board to select the Upper Rom as 0 or 1. I had one spare NOR gate I could use to invert D0 and with a switch I can now select either 0 or 1 to be evaluated for the ROM address.I also added the missing pulldowns (Thanks @TotO@TotO
Proud owner of 2 Schneider CPC 464, 1 Schneider CPC 6128, GT65 and lots of books
Still learning all the details on how things work.

SerErris

Okay, now after deep diving the source code of the Diagnostic Rom I figured out, that I do not need the upper ROM at all ...  :picard2: and I revalidated this with my breadboard version. Indeed it runs perfect without the upper ROM. Just seeing two ROMs actually made me think that I would need both, but that is actually two different incarnations of the same thing. You can run it as a lower ROM and then do deep dive diagnostics in case Basic does not even start. And you can run as upper ROM with |DIAG command to get it going after Basic has been loaded.

So I am now back to the lower rom and to have a way to switch it on and of via software. This will be simple now and much cheaper ... Ouch. :o

Okay. ... reverting back to version 1 and implementing a way to disable it. Anyhow I learned alot and that was the main goal for this project.

Me beeing stupid sometimes learning out of it, made my day  :laugh:
Proud owner of 2 Schneider CPC 464, 1 Schneider CPC 6128, GT65 and lots of books
Still learning all the details on how things work.

Bryce

Quote from: SerErris on 16:53, 06 March 22Hmm .. you are right ... I need a pulldown...
Just for info (I know you've gone back to V1): It's better practice to do the reverse the logic, ie: connect the jumpers to GND and add pull-ups.

Bryce.

SerErris


Quote from: Bryce on 08:24, 07 March 22Bryce.

Good opportunity to improve my electrotech knowledge:

Can you please give me a quick summary on what the benefits are from one ore the other?
Proud owner of 2 Schneider CPC 464, 1 Schneider CPC 6128, GT65 and lots of books
Still learning all the details on how things work.

Bryce

One of the main reasons is that you don't want to have the 5V rail on a jumper pin. It oxidises over time and gives a bad connection. This doesn't happen to a pin with GND on it.

Bryce.

SerErris

Quote from: Bryce on 14:38, 07 March 22One of the main reasons is that you don't want to have the 5V rail on a jumper pin. It oxidises over time and gives a bad connection. This doesn't happen to a pin with GND on it.

Bryce.
Thanks, that makes sense. Will consider that in the future.
Proud owner of 2 Schneider CPC 464, 1 Schneider CPC 6128, GT65 and lots of books
Still learning all the details on how things work.

SerErris

Hi all,

I have now build on of the simplified DiagRoms with V1.01 - this is now tested and works as designed.

If anyone wants to build one, here is the schematic and the gerber files.

Also the components list is attached

I do have some of the PCBs here at home, so if you need any, I can ship it for €3+shipping.

Regards
SerErris
Proud owner of 2 Schneider CPC 464, 1 Schneider CPC 6128, GT65 and lots of books
Still learning all the details on how things work.

TotO

Nice done. :)

Ironically, I will be not surprise if it cost less to use the gerber file to order 5 pcs from JLC PCB than asking you to ship one.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

zhulien

If you add a reset button and an enable/disable switch - then you basically have a hackit cartridge - that can be very useful

eto

Quote from: zhulien on 07:25, 13 January 23If you add a reset button and an enable/disable switch - then you basically have a hackit cartridge - that can be very useful
Funny enough: I started exactly the same project last weekend: An alternative LowerRom can be selected with a DIP switch, it can be disabled, has a reset switch and has the option to solder either an MX4 connector or an edge connector.

However I hadn't thought about the solution how to deal with ROM 0 and ROM 7 which I wanted to remain active.

Quote from: SerErris on 16:45, 12 January 23this is now tested and works as designed
The 74HCT02 seems to be brilliant and if I may, I will apply that to my own design. Great work!




SerErris

Actually V2 should have (never finished it yet) a way to disable the rom also via Software. This is needed by the DiagRom to allow to scan the internal lower rom. This Rom board does not allow to scan the internal lower ROM, as it will be either online or offline.

The issue is, that beeing able to disable it via software it will need a lot more glue logic, including a Flipflop and some other parts to decode the address for activating/deactivating the flipflop.

I think I will reconsider my plans here to make it simplified, but actually not a universal lower rom board, but more like a simplified DiagRom Board.

So the sole purpose is not to be anoter M4 or any other Rom Board, but to be a simple as it could get rom board for the DIAG rom. 

Maybe we want to collect some features?

Currently on the backlog:
1. Reset button
2. Exchange the pin header jumper select with a switch for hardware enable/disable of the ROM
3. make it possible to enable/disable via software for the diag rom.

@eto please use it for anything you like
@TotO yes, that looks like it - however it is faster and who needs 5 of those?

Proud owner of 2 Schneider CPC 464, 1 Schneider CPC 6128, GT65 and lots of books
Still learning all the details on how things work.

TotO

Quote from: SerErris on 12:05, 13 January 23however it is faster and who needs 5 of those?
It can be to share PCB into his own city/country or to save shipping fees on parts order to provid assembled boards to friends.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

SerErris

That is true and makes a lot of sense. 

In that ballpark - the only reasonable shipping of mine would be within germany via good old letter ... anything else would not be economically wise :-) The shipment alone would have more cost then PCBway or JLCPCB
Proud owner of 2 Schneider CPC 464, 1 Schneider CPC 6128, GT65 and lots of books
Still learning all the details on how things work.

Richard_Lloyd

@SerErris 
Thank you for this.
Just built one and it is very useful.
Tested on CPC464, CPC6128 and 6128Plus.You cannot view this attachment.
Richard
CPC464, CPC6128, PCW8512, PCW10, BSA & NSP

Powered by SMFPacks Menu Editor Mod