Verification of ZX81 ROM

Discussions about Sinclair ZX80 and ZX81 Hardware
Post Reply
User avatar
mooredan
Posts: 22
Joined: Sat Nov 18, 2017 4:47 pm
Location: Portland, Oregon, USA
Contact:

Verification of ZX81 ROM

Post by mooredan »

So I'm a verification engineer -- a bane to design engineers. "If it isn't verified, assume that it doesn't work." is one of my mantras.

It's nice that the ZX-81/TS1000 ROM is provided here: https://github.com/pauloscustodio/ZX-81-ROMS

However, does the zx81.rom file really contain a the contents of the D2364C ROM? ...probably so, but let's verify it.

So what's the fastest/simplest way that I can do this with the stuff that I have on hand in my home lab. Here's a solution:

Image

The Arduino Uno only has 13 digital I/O, two of which are needed for the serial com back to the computer. So I'll use the Z80 as a counter to address the ROM and then pick off the 8-bit data from the ROM. Two other control lines are needed: one for the clock and one for reset. The Z80 can be put into "counter mode" by pulling its data lines low. This is a NOP instruction, which does nothing but cause the address pointer to increment and read the data at the next address, which is, guess what? , another NOP. Meanwhile the Ardunio sniffs the ROM's data bus and displays the value to serial out. Capture that data in a file, process and compare to the .rom file from the github source. As expected, they match: bit-for-bit.

Code: Select all

nt romdata;
int val;
int addr = 0;
int do_reset = 1;

void setup() {

  // start serial connection
  Serial.begin(9600);
 
  pinMode(2, INPUT_PULLUP);  // rom data[0]
  pinMode(3, INPUT_PULLUP);
  pinMode(4, INPUT_PULLUP);
  pinMode(5, INPUT_PULLUP);
  pinMode(6, INPUT_PULLUP);
  pinMode(7, INPUT_PULLUP);
  pinMode(8, INPUT_PULLUP);
  pinMode(9, INPUT_PULLUP); // rom data[7]

  pinMode(12, OUTPUT);  // reset

  pinMode(LED_BUILTIN, OUTPUT);  // clock

}

oid loop() {

  // reset the first time through
  if(do_reset == 1) {
    do_reset = 0;
    digitalWrite(LED_BUILTIN, LOW);
    delay(100);
     digitalWrite(12, LOW);

     for(int i = 0; i < 5; i++) {
        delay(100);
        digitalWrite(LED_BUILTIN, HIGH);
        delay(100);
        digitalWrite(LED_BUILTIN, LOW);
     }
     delay(100);
     digitalWrite(12, HIGH);
     delay(100); 
  }

  if (addr < 8192) {
     for(int i = 0; i < 4; i++) {
        digitalWrite(LED_BUILTIN, LOW);   // clock
        delayMicroseconds(100);          // wait for a second
        digitalWrite(LED_BUILTIN, HIGH); 
        delayMicroseconds(100); 
     }
  
     romdata = 0;
     for(int i = 0; i < 8; i++) {
        val = digitalRead(i+2);
        val = val << i;
        romdata = romdata | val; 
     }

     Serial.print("addr: ");
     Serial.print(addr);
     Serial.print("  data: ");
     Serial.println(romdata);
     addr = addr + 1;
  
     delayMicroseconds(100);
  } else {
     addr = 0;
     do_reset=1;
     while(1);
  }
}
Now I am confident in using that .rom file (or I can just use the one that I extracted).

OK, there's more than one way to skin a cat, I could have either built an adapter, or created a new device entry for my Minipro TL866 that I recently acquired, but I had not yet got this working reliably on the CentOS system I'm running as a VM on my Mac Mini.

Image
Dan Moore
Portland, Oregon, USA
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: Verification of ZX81 ROM

Post by sirmorris »

There is an active open source project, compilable to native Mac, for the TL (lovely bit of kit!)

https://github.com/vdudouyt/minipro

It's limited compared to the Win/GUI software but for quick jobs it's spot-on.

C
User avatar
mooredan
Posts: 22
Joined: Sat Nov 18, 2017 4:47 pm
Location: Portland, Oregon, USA
Contact:

Re: Verification of ZX81 ROM

Post by mooredan »

Yes, that's the software I'm using. "Reliably" referred to having the Centos 7 virtual machine automatically detect and connect to it with its access being R/W by a non-privileged user. OK, that's figured out and taken care of now, a permanent setting in VirtualBox to hand off that device to the VM, and a bit of udev rules tweak to have the correct access. The programmer is working just fine now and I'm able to read the 27C256 EPROM, haven't tried writing it yet, first have to erase it with a little UV light box.

The nice GUI shipped with the minipro runs under Wine, but access to the USB hasn't happened. Besides, I'm a command-line sort of guy.

Just looked in the devices.h file for the NEC D2364C ZX81/TS1000 ROM, doesn't appear to be an entry. Should be easy enough to figure out the syntax and add it.
Dan Moore
Portland, Oregon, USA
Post Reply