Page 1 of 1

Testing VIC 20 ROMs

Posted: Mon Jul 10, 2023 6:07 pm
by USA_Joe
How can I test the VIC 20 ROMs to see if they are working (good) or not? I have a logic probe, and an oscilloscope (which I'm trying to learn how to use).

I'm working on a VIC 20 that has a black screen. Every chip is soldered except for the ones I replaced. When I turn on the unit, I get a NTSC signal on the TV (not using RF). I've replaced all three of the 74LS245 chips (UE8, UD8, and UF8), and one memory chip (U15) so far. Even though I'm planning on making this my "chip swap" VIC, I'd like to see it working soon. The 74LS245 chips were tested before installation. I don't have a way (yet) to test RAM.

Using the oscilloscope, and a YouTube video where a CPU is looked at via the scope as reference, I've determined that the CPU is good. The clock signal is present at the VIC (although it seems kind of weak), and at the CPU. Of course, the voltages all check out as well. Blind keyboard commands to access a floppy drive didn't work. All traces are good, and I've checked continuity on numerous chip pins.

Dead Test / Diag cartridge doesn't work. Unlike the C64, the Dead Test / Diag cartridge doesn't work with problem ROMs (at least the KERNAL as far as I know). I plan on replacing the KERNAL tomorrow with a modern replacement. If that doesn't work, at least 8 other chips are still a possible source of the problem (including the VIC, but it appears to be putting out a signal). There still could be a hidden short somewhere as well.

Any suggestions on how to check the ROMs is appreciated!

Thank you!

Joe

Re: Testing VIC 20 ROMs

Posted: Fri Jul 14, 2023 5:00 am
by JonBrawn
The ROMs have chip select and output enable inputs - look at the schematics to see which is used to enable the device when it is being accessed, then hang one scope probe on that, and set up the scope to trigger on that signal going active. Use the other probe to see what is happening on each of the data out pins when the chip is accessed. There should be a delay, less than 400ns, before the output goes high or low, a good, solid, high or low. Check each pin, that each is sometimes high and sometimes low. That should give you some level of confidence that the ROMs contain something other than all 0s or all 1s. It won't tell if the 1s and 0s are right though, but it's a start.

Re: Testing VIC 20 ROMs

Posted: Fri Jul 14, 2023 10:55 am
by USA_Joe
Thank you!

Joe

Re: Testing VIC 20 ROMs

Posted: Wed Jul 19, 2023 2:36 pm
by JonBrawn
Were you VICtorious?

Re: Testing VIC 20 ROMs

Posted: Thu Jul 20, 2023 11:51 am
by USA_Joe
The ROM's are fine. But I'm still working on the VICtim.

Joe

Re: Testing VIC 20 ROMs

Posted: Thu Jul 20, 2023 3:37 pm
by USA_Joe
VICtory! I found a missing connection, installed a bodge wire, and it booted up!

Joe

Re: Testing VIC 20 ROMs

Posted: Thu Jul 20, 2023 8:40 pm
by JonBrawn
We live VICariously through your repair exploits...

[OK, I'll stop now]

Re: Testing VIC 20 ROMs

Posted: Thu Jul 20, 2023 9:44 pm
by USA_Joe
No problem! You're not being VICious.

Re: Testing VIC 20 ROMs

Posted: Sat Jul 22, 2023 5:21 pm
by kickstand
I hope no one minds, but I'd like to keep this thread going to a solution. I have 4 more boards to go, and lots of spare parts. I wired up an AVR128DA64 (an Arduino Mega would also work - at minimum, this needs lots of digital lines). I also used this circuit to test out my static RAMS. Yup, I know....there are several retro chip testers out there, but I have lots of spare AVRs. I'll post the completed code on my website.

There is also a 2114 static RAM tester by Carsten Skjerk from June 2021 that I modified to work on a Nano that works pretty good.

Now that I now what that I have good ROMs, I could probably store them in flash and make an exact comparison. I'd rather just come up with the checksum known by the community, but my research has not vetted something that matches.

The code here is modified from @kanapapa:

Code: Select all

//
// 2364 Mask ROM Reader PROGRAM
//
// 2019.01.13 @kanpapa
//
//                2364
#define D0 6     // 9
#define D1 7     // 10
#define D2 8     // 11
#define D3 9     // 13
#define D4 10     // 14
#define D5 11     // 15
#define D6 12     // 16
#define D7 13     // 17

#define AD0 5    // 8
#define AD1 4    // 7
#define AD2 3    // 6
#define AD3 2    // 5
#define AD4 20    // 4
#define AD5 21    // 3
#define AD6 22    // 2
#define AD7 23    // 1
#define AD8 19    // 23
#define AD9 18    // 22
#define AD10 15   // 19
#define AD11 14   // 18
#define AD12 17   // 21

#define CE 16  // 20 Chip Enable
               // 24 Vcc
               // 12 GND
#define CE1 24               


int DATA[]={D0,D1,D2,D3,D4,D5,D6,D7};
int ADDR[]={AD0,AD1,AD2,AD3, AD4,AD5,AD6,AD7, AD8,AD9,AD10,AD11, AD12};

void setAddress(int addr) {
  for (int bitno = 0 ; bitno < 16 ; bitno++){
    if (bitRead(addr, bitno) == 1) {
      digitalWrite(ADDR[bitno], HIGH);
    } else {
      digitalWrite(ADDR[bitno], LOW);
    }
  }
  return;
}

byte memRead(int addr) {
  digitalWrite(CE, HIGH);  // CE = High
  digitalWrite(CE1, HIGH);
  byte data = 0;
  setAddress(addr);
  
  digitalWrite(CE, HIGH);  // Block 6
  digitalWrite(CE1,LOW); //Block 7
  
  delayMicroseconds(100); // Wait 1micro sec
  for (int bitno = 0; bitno < 8; bitno++) {
    if (digitalRead(DATA[bitno]) == HIGH) {
      bitSet(data, bitno);
    }
  }
  digitalWrite(CE, HIGH);  // CE = High
  digitalWrite(CE1,HIGH);  
  return data;
}

void hexprint2(byte val){
  if (val < 16){
    Serial.print("0");
  }
  Serial.print(val, HEX);
}

void hexprint4(int val){
   hexprint2(highByte(val));
   hexprint2(lowByte(val));
}

void setup() {
  // Initalize serial
  Serial.begin(115200);
  while (!Serial) {
    ;
  }
    
  // set PINMMODE
  pinMode(CE, OUTPUT);
  pinMode(CE1, OUTPUT);

  digitalWrite(CE, HIGH);
  digitalWrite(CE1,HIGH);

  
  for (int i=0; i<13; i++) pinMode(ADDR[i], OUTPUT); // address
  for (int i=0; i<8; i++)  pinMode(DATA[i], INPUT);  // data

  // Output startup message
  Serial.println("2364 Mask ROM Reader PROGRAM");

  // Read memory 0x0000-0x1FFF (8KByte*8bit=64Kbit)
  int start_adrs = 0x0000;
  //Change to 0x1000 for 2332 (Such as Character ROM)
  int end_adrs = 0x2000;
  int max_count = 16;
  int total_count = end_adrs - start_adrs;
  Serial.print(total_count);
  Serial.println("Bytes");

  delay(1000);

  // Output Intel HEX Format
  int read_adrs = start_adrs;
  int tchksum = 0;


  while(total_count > 0){
    int lchksum = 0;
    int count = 0;

    // RECORD MARK
    Serial.print(":");
    
    // LOAD REDLEN
    if (total_count >= 16){
      count = max_count;
    } else {
      count = total_count;
    }    
    hexprint2(count);
    lchksum += count;

    // OFFSET
    hexprint4(read_adrs);
    lchksum += highByte(read_adrs);
    lchksum += lowByte(read_adrs);

    // RECTYP
    Serial.print("00");

    // DATA
    for (int i = 0 ; i < count ; i++){
      // Read data
      byte read_data = memRead(read_adrs + i);
      hexprint2(read_data);
      lchksum += read_data;
      // Add to the overall checksum (dumps carry)
      tchksum += read_data;
    }
   
    // CHKSUM
    lchksum = lowByte(~lchksum + 1 );
    hexprint2(lchksum);
    Serial.print("\n");

    //
    read_adrs += count;
    total_count = total_count - count;
  }

  // EOF
  Serial.println(":00000001FF");

  Serial.printf("Sum: %06x \n",tchksum);
  byte tmod = tchksum % 256;
  Serial.printf("Mod: %02x \n",tmod);
  tmod = ~tmod+1;
  Serial.printf("\n %02x 2's Comp \n",tmod);

}

void loop() {
}

Re: Testing VIC 20 ROMs

Posted: Sun Jul 23, 2023 2:05 pm
by JonBrawn
ROM images can be found at zimmers.net, if you need them.

Re: Testing VIC 20 ROMs

Posted: Sun Jul 23, 2023 2:08 pm
by JonBrawn
Also, the time for memory access (RAM or ROM) on the VIC-20 is a smidge less than 500ns, so if you can arrange for <set address> <wait 500ns> <read data>, then you'll be closer to what's going to happen in real life.

Re: Testing VIC 20 ROMs

Posted: Mon Jul 24, 2023 2:56 pm
by USA_Joe
I'd enjoy seeing the posts. I'm out of commission for working on computers for a while. I tore my right shoulder rotator cuff. Hopefully all I'll need is therapy, and not surgery. I'll find out in a few days.

The Arduino chip tester looks interesting.

Joe