Bare Metal Diagnostic ROM: Now good enough to use.

Anything QL Software or Programming Related.
stephen_usher
Super Gold Card
Posts: 562
Joined: Tue Mar 11, 2014 8:00 pm
Location: Oxford, UK.
Contact:

Bare Metal Diagnostic ROM: Now good enough to use.

Post by stephen_usher »

My bare metal diagnostic ROM is now good enough to be declared version 0.10.

The ROM image can be downloaded from the Github repository ( https://github.com/stephen-usher/Sincla ... l-Diag-ROM ) as the file "diagrom.bin".

This replaces the system ROMs in the same way as you would with an adapter for Minerva. Alternatively, you can hack a ROM cartridge so it selects the ROM for the whole of the ROM address range and use a Winbond W27C512 EEPROM as this has line drivers strong enough to override the system masked ROMs.

What the ROM can do.

The ROM will output to ser2 at 4800 baud and try to output to the screen at the same time. This means that if the video output part of the machine is non-functional you can still see if the rest of the machine is working.

The first thing the ROM will do will be to write a banner to both the screen and serial port before running a March and 'Own address' memory test on the main 128K of memory. It does this without requiring any working memory in the system. (Of course, if there's no RAM then nothing will appear on the screen.)

If the memory test fails then a message with address and error bits will be printed to the serial port and a set of coloured bars will be put into screen memory. The first is black or white depending upon which bank of memory failed, followed by red or green strips for each of the 8 bits.

If the memory test passes then the main initial tests are run. i.e. testing for and testing RAM expansions, testing the IPC, reading the keyboard and finally reading the serial port (ser2).

If this much of the machine is running using this ROM then it *should* boot QDOS or Minerva. If the tests fail you should be able to know where to look to fix the machine.


stephen_usher
Super Gold Card
Posts: 562
Joined: Tue Mar 11, 2014 8:00 pm
Location: Oxford, UK.
Contact:

Re: Bare Metal Diagnostic ROM: Now good enough to use.

Post by stephen_usher »

Here's how to make a ROM adapter:

What you will need:
  • A 28 pin socket, not turned pin.
  • A 74LS04
  • Some bodge wire, something like 28AWG or wirewrap wire.
  • A little patience and simple soldering skills.
Bend out pins 1, 20 and 22 on the 28 pin socket.

Bend all the pins except pin 7 of the 74LS04 so that they are straight out from the sides of the chip

Solder wires onto pins 1, 2 and 14 on the 74LS04. Clip off the other legs (NOT pin 7!) close to the body of the chip and save the pins for later.

Strip a wire and solder it between the bent out pins 20 and 22 on the 28 pin socket, leaving bare wire between them.

Solder a wire long enough to stretch between the top left of the left QL ROM to the far side of the right QL socket. Solder one of the cut chip pins onto one end and solder the other end to pin 1 on the socket.

Solder the wire connected to pin 2 of the 74LS04 to the middle of the wire joining pins 20 and 22 on the 40 pin socket.

Solder cut off chip pins onto the other wires on the 74LS04.

You can now start plugging things into the QL ROM sockets. The 28 pin socket pushes into the left ROM socket and pin 7 of the 74LS04 plugs into the bottom left hole in the right ROM socket.

The wire from pin 14 of the 74LS04 plugs into the top left hole in the right QL ROM socket (power).

The wire from pin 1 of the 74LS04 plugs into the hole for pin 22 on the right QL ROM socket.

The wire from pin 1 of the 40 pin socket plugs into the hole for pin 20 on the right QL ROM socket.

You can now plug a 27C512 (or 27C256) EPROM into the 28 pin socket.

Note that pin numbers on chips and sockets start in the top left, work their way down to the bottom, then across to the right side and continue from the bottom to the top.

I hope that this helps.

This is an early prototype of this "hack" with a few wires that you won't need:

IMG_3585.jpeg


javier2112
ROM Dongle
Posts: 46
Joined: Thu Jan 27, 2022 6:02 pm

Re: Bare Metal Diagnostic ROM: Now good enough to use.

Post by javier2112 »

I've known your diagnostic ROM by means the screen fault thread. Congratulations for your work, it' may be a fantastic help to fix our faulty QL.

How should wire the SER 2 to RS232 PC cable?


stephen_usher
Super Gold Card
Posts: 562
Joined: Tue Mar 11, 2014 8:00 pm
Location: Oxford, UK.
Contact:

Re: Bare Metal Diagnostic ROM: Now good enough to use.

Post by stephen_usher »

javier2112 wrote: Mon Jun 30, 2025 12:56 pm How should wire the SER 2 to RS232 PC cable?
It only really needs the three wire connection, RX, TX and ground. I believe that for a PC serial port you swap the RX and TX lines as a "null modem".

The output is 4800 baud 8 bits data, no parity, 1 stop bit, no flow control.


User avatar
Popopo
Super Gold Card
Posts: 504
Joined: Wed Apr 07, 2021 10:37 am

Re: Bare Metal Diagnostic ROM: Now good enough to use.

Post by Popopo »

I love your work!
Thank you.


User avatar
Chr$
QL Wafer Drive
Posts: 1399
Joined: Mon May 27, 2019 10:03 am
Location: Sachsen, Germany
Contact:

Re: Bare Metal Diagnostic ROM: Now good enough to use.

Post by Chr$ »

I padded the .bin file to 48k and tried it with Qemulator, just for fun.

It starts with a white screen, then black, then white again, then black. Then this pattern appears:
diagROMpattern.png
After that a black screen with text appears and tells you what it's testing and when finished it looks like this (in 128k configuration):
diagROM128.png
Or like this with 640k RAM:
diagROM640.png
I do also have a faulty QL in a box downstairs with suspected RAM issue. It was a while ago, but I think Minerva was able to tell me which RAM chip was suspect. I'll dig it out and will try it with the diagnostic ROM to see if it points to the same bit and/or tells me anything else.

Excellent work Stephen, thanks.


https://QXL.WIN
Collector of QL related computers, accessories and QL games/software.
Ask me about felt pads - I can cut them to size and they have proven excellent for mdv data recovery.
User avatar
Chr$
QL Wafer Drive
Posts: 1399
Joined: Mon May 27, 2019 10:03 am
Location: Sachsen, Germany
Contact:

Re: Bare Metal Diagnostic ROM: Now good enough to use.

Post by Chr$ »

I dug out the QL with the known IC3 RAM chip issue. This machine simply stops on a green screen after the tweed pattern. It does this with the standard pair of ROMs (FP and MGI - it's an Italian QL with Iss6 MB) and it does the same with Minerva fitted.

I know with absolute certainty that there is an issue with IC3 because with a known working 4164 pickabacked on top of it, it works fine (not extensively tested, but it presents the F1/F2 screen and then goes to the normal QDOS screen where I was able to type and do the usual stuff).

Unfortunately, with just the dodgy IC3 in place on its own, the Diagrom completed its tests and reported no issue. I'm not complaining of course, because as you say, the diagrom is just one tool is the diagnostic arsenal and whatever issue there is with IC3, it seems an unusual one.
20250705_225120.jpg


https://QXL.WIN
Collector of QL related computers, accessories and QL games/software.
Ask me about felt pads - I can cut them to size and they have proven excellent for mdv data recovery.
User avatar
Popopo
Super Gold Card
Posts: 504
Joined: Wed Apr 07, 2021 10:37 am

Re: Bare Metal Diagnostic ROM: Now good enough to use.

Post by Popopo »

Chr$ wrote: Sat Jul 05, 2025 9:58 pm ...
Unfortunately, with just the dodgy IC3 in place on its own, the Diagrom completed its tests and reported no issue. I'm not complaining of course, because as you say, the diagrom is just one tool is the diagnostic arsenal and whatever issue there is with IC3, it seems an unusual one.
It's a pretty good feedback in order to find bugs, improve algorithms and so on.

A RAM IC may fail in different ways.
If yours "get ignored" placing another IC in piggyback, it may be cause it faulty has not an inner short.

Sometimes I provoke fails putting a leg of an IC up, in a way it is not connected. Emulating shorts (a power or signal pin to GND or another place) is highly dangerous for any machine.

A full memory test requires to:
1. Detect shorts
2. Fill the whole memory with at least 4 different basic patterns and read them are the same after it. "00", "11", "01", "10" and random. What takes some time.
3. In case of DRAM ICs, also check after a while the data remains (refresh).
4. If there are Logic ICs (multiplexers mainly) involved in RAM structure, also check those "somehow".

I am following this thread with great interest cause I want to develop also my own and test ROM cartridge.
So thank both for testing, feedback and of course this great work.


User avatar
Chr$
QL Wafer Drive
Posts: 1399
Joined: Mon May 27, 2019 10:03 am
Location: Sachsen, Germany
Contact:

Re: Bare Metal Diagnostic ROM: Now good enough to use.

Post by Chr$ »

Another little update:

I removed the soldered IC3 and replaced it with a socket. The chip tests as OK in my Retro chiptester pro! But it clearly isn't, or it's at least marginal in some respect.

With IC3 completely missing I get just this screen using the diagrom:
20250706_182900(1).jpg
Sorry it's not in colour!

And with a known working 4164 in the IC3 socket everything is fine.


https://QXL.WIN
Collector of QL related computers, accessories and QL games/software.
Ask me about felt pads - I can cut them to size and they have proven excellent for mdv data recovery.
User avatar
Popopo
Super Gold Card
Posts: 504
Joined: Wed Apr 07, 2021 10:37 am

Re: Bare Metal Diagnostic ROM: Now good enough to use.

Post by Popopo »

Chr$ wrote: Sun Jul 06, 2025 5:52 pm I removed the soldered IC3 and replaced it with a socket. The chip tests as OK in my Retro chiptester pro! But it clearly isn't, or it's at least marginal in some respect.

And with a known working 4164 in the IC3 socket everything is fine.
Have you considered the idea that perhaps the problems is related to propagation time? I mean latency.

Also, depending on how to each tester do its work, some ICs could get false positive (or negative).
Yours is the slabbi one (if I am not wrong) and this seems to be good (by some comments), so maybe it pass the test but at some working freqs start to fail,
and I must assure to you, that this point is something not tested by the 98% of testers.

Or some legs of the IC are dirty.


Post Reply