memtest prg?

Basic and Machine Language

Moderator: Moderators

User avatar
srowe
Vic 20 Scientist
Posts: 1325
Joined: Mon Jun 16, 2014 3:19 pm

Re: memtest prg?

Post by srowe »

I made a bit of a mess replacing the wirewrap socket with something smaller. The PCB tracks were very thin and I ripped quite a few. Took some time to repair it and I still have problems.

I've replaced the char ROM socket and basically restored the machine back to standard for now. I still have intermittent system instability which I'm investigating.

Symptoms are lockups or warm restarts when running even a simple BASIC program. I'm using a loop setting the border colour 0 to 7. It tends to fail within an hour, sometimes listing the program shows junk after a failure.

The following run for many hours without failing
  • Memory test of $1000 to $1E00 (from EPROM)
  • Forth version of border loop
My current guess is that the BASIC ROM is faulty. I'm planning to write a program to repeatedly test it's contents.

Any other ideas?
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: memtest prg?

Post by Mike »

srowe wrote:I've replaced the char ROM socket and basically restored the machine back to standard for now. [...] My current guess is that the BASIC ROM is faulty. I'm planning to write a program to repeatedly test it's contents.
Even though it could be a faulty BASIC ROM (I read about several cases of this in the last months) you should also take the function of the 13-input NAND and the three bus-buffers under extreme scrutiny: you don't want the data bus buffer enabled during CPU read accesses of BASIC or KERNAL ROM (or anything on the expansion port, for that matter). Even when there are no chip selects on the input side of the bus buffer (i.e., internal RAM or character ROM), it actively drives a (random) L- or H-level on its outputs which conflicts with signals on the CPU side of the data bus.

Here's a small program to check the BASIC ROM for the correct checksum of $0E8131:

Code: Select all

1 FORT=674TO743:READA:POKET,A:NEXT:POKE36879,27:POKE783,4:SYS674
2 DATA 169,192,133,252,169,0,133,3,133,4,133,5,133,251,168,162,32,24,177,251,101,3,133
3 DATA 3,165,4,105,0,133,4,165,5,105,0,133,5,200,208,234,230,252,202,208,229,165,3,201
4 DATA 49,208,12,165,4,201,129,208,6,165,5,201,14,240,194,169,26,141,15,144,76,229,2
It runs in a loop, as soon as it detects a difference, the border turns red. Here's the source:

Code: Select all

; $05/$04/$03 := high/mid/low-byte of checksum
; $FC/$FB := ZP-pointer into BASIC ROM

.02A2  A9 C0     LDA #$C0
.02A4  85 FC     STA $FC
.02A6  A9 00     LDA #$00
.02A8  85 03     STA $03
.02AA  85 04     STA $04
.02AC  85 05     STA $05
.02AE  85 FB     STA $FB     
.02B0  A8        TAY
.02B1  A2 20     LDX #$20
.02B3  18        CLC
.02B4  B1 FB     LDA ($FB),Y
.02B6  65 03     ADC $03
.02B8  85 03     STA $03
.02BA  A5 04     LDA $04
.02BC  69 00     ADC #$00
.02BE  85 04     STA $04
.02C0  A5 05     LDA $05
.02C2  69 00     ADC #$00
.02C4  85 05     STA $05
.02C6  C8        INY
.02C7  D0 EA     BNE $02B3
.02C9  E6 FC     INC $FC
.02CB  CA        DEX
.02CC  D0 E5     BNE $02B3
.02CE  A5 03     LDA $03
.02D0  C9 31     CMP #$31
.02D2  D0 0C     BNE $02E0
.02D4  A5 04     LDA $04
.02D6  C9 81     CMP #$81
.02D8  D0 06     BNE $02E0
.02DA  A5 05     LDA $05
.02DC  C9 0E     CMP #$0E
.02DE  F0 C2     BEQ $02A2
.02E0  A9 1A     LDA #$1A
.02E2  8D 0F 90  STA $900F
.02E5  4C E5 02  JMP $02E5
(POKE783,4 is used to SYS into the code with interrupts disabled and decimal flag clear - otherwise the DATA would have overflown into a fourth line :))
User avatar
srowe
Vic 20 Scientist
Posts: 1325
Joined: Mon Jun 16, 2014 3:19 pm

Re: memtest prg?

Post by srowe »

Even though it could be a faulty BASIC ROM (I read about several cases of this in the last months) you should also take the function of the 13-input NAND and the three bus-buffers under extreme scrutiny
This is my other suspicion. The only mod I have is the 13-input NAND is socketed.

I'll try your program, thanks. I wrote one that copied both ROMs to RAM and then continually compared them. There are bursts of mismatches at $Cxxx or $Dxxx only.

I've a complete spare system, tomorrow I'll run the test prog on that and then swap ROMs and see if the failure follows it.
User avatar
srowe
Vic 20 Scientist
Posts: 1325
Joined: Mon Jun 16, 2014 3:19 pm

Re: memtest prg?

Post by srowe »

Well your program also fails after a period of time. I'm going to swap ROMs with the other system and see what happens.
User avatar
srowe
Vic 20 Scientist
Posts: 1325
Joined: Mon Jun 16, 2014 3:19 pm

Re: memtest prg?

Post by srowe »

When I swap ROMs the failure follows the suspect ROM. So I seem to have an broken ROM. VIC ROMs don't seem easy to come by so I might build an adapter board than replaces 2 x 2364 with a 27128.

I think I'm still seeing some weird behaviour on the original system, that will need further investigation.
Post Reply