CPCWiki forum

General Category => Amstrad CPC hardware => Topic started by: Bryce on 14:33, 23 August 14

Title: Endless loop...
Post by: Bryce on 14:33, 23 August 14
Hi,
    I found some time to visit a troublesome 6128 that I'm looking at. RAM fixed, shadow key problem fixed and now concentrating on the FDC / ROM 7 problem. This is the issue at the moment. If ROM 7 is removed the CPC runs as normal and using a few pokes I can start/stop the disk motors etc, so the FDC and associated logic seems ok. However when I insert ROM 7 the CPC freezes after the ".... Locomotive Software Ltd." and never gets to the BASIC prompt. I've probed the Databus and it is in an endless loop of:

07 30 7B 6D 78 - 07 30 7B 6D 78 - 07 30 7B 6D 78 ....

Can any of the firmware experts out there tell me exactly what this loop is and what signal it is waiting for?

Bryce.
Title: Re: Endless loop...
Post by: arnoldemu on 14:59, 23 August 14

c95e ed78      in      a,(c)            ; read FDC main status register
c960 87        add     a,a                ; transfer bit 7 ("data ready") to carry
c961 30fb      jr      nc,$c95e         


here it is.

but your order is this:

6d 78 07 30 7b

bit 7 seems to be inverted or stuck at 0.
Title: Re: Endless loop...
Post by: Bryce on 20:55, 23 August 14
Hmmm, then it's most likely the FDC that's failed. I'll swap it.

Thanks,
Bryce.
Title: Re: Endless loop...
Post by: gerald on 21:20, 23 August 14
Quote from: Bryce on 20:55, 23 August 14
Hmmm, then it's most likely the FDC that's failed. I'll swap it.
Interesting case !
Did you try swapping the amsdos ROM (or dumping it to check its content)?
If the FDC is corrupting the data bus, problems should happen earlier.
Title: Re: Endless loop...
Post by: arnoldemu on 21:21, 23 August 14
Quote from: Bryce on 20:55, 23 August 14
Hmmm, then it's most likely the FDC that's failed. I'll swap it.

Thanks,
Bryce.
I think the data lines to the disc Rom need checking. I suspect the fdc is ok. Z80 appears to be seeing bad data from that Rom.
Title: Re: Endless loop...
Post by: Bryce on 21:30, 23 August 14
Both the internal ROMs (0 and 7) have already been replaced. I'll check the solder joints to ROM 7. The EPROMs are definitely known good.

Bryce.
Title: Re: Endless loop...
Post by: MacDeath on 22:56, 23 August 14
simple :

cls
10 goto 10
run
Title: Re: Endless loop...
Post by: arnoldemu on 08:09, 24 August 14
I thought about this: if the CPU was seeing those values it would not loop. As they are they don't make sense. Why did they have bit 7 wrong? So CPU does seem to get the correct values to get to that point.
So my thoughts come back to the fdc.
When the amsdos ROM starts it sends a command to the FDC to initialise it.
This loop happens because it wants bit 7 to be a specific value. Could be the data lines to FDC, could be the FDC is not being reset correctly and could be a faulty FDC exactly as you thought.
Title: Re: Endless loop...
Post by: Bryce on 08:50, 24 August 14
Ok, I also realised that I was measuring the data lines directly from the pins of ROM 7, so that's the data the ROM is seeing. Is this code in ROM 7? If so, I need to check whether my "Known good" ROM 7 has failed.

Bryce.
Title: Re: Endless loop...
Post by: arnoldemu on 08:53, 24 August 14
Quote from: Bryce on 08:50, 24 August 14
Ok, I also realised that I was measuring the data lines directly from the pins of ROM 7, so that's the data the ROM is seeing. Is this code in ROM 7? If so, I need to check whether my "Known good" ROM 7 has failed.

Bryce.
Yes the code is in ROM 7.
Title: Re: Endless loop...
Post by: Bryce on 08:57, 24 August 14
Ok, found the code in ROM 7 (at 095E) and the EPROM is definitely good. The FDC must be holding bit 7 low?

Just checked the FDC reset sequence: It's getting a 40ms reset pulse at 50ms another 140ms reset at 100ms and a 60ms reset at 280ms. So that part of the circuitry seems to be doing what it's meant to.

Bryce.

Edit: Fed up faffing about with this one. Have to go out for a while, but when I get back I'll swap out the FDC.
Title: Re: Endless loop...
Post by: Bryce on 13:30, 24 August 14
Just swapped the FDC and the CPC has sprang to life. Finally all problems resolved. The board belongs to VincentGR and was the victim of an momentary over voltage (the board that is, not Vincent). The RAM, the 74LS145 (keyboard scan driver) and the 765 were all fried. Normally it's hardly worth repairing a board in this state, but it is his original from his childhood, so an exception was made. I'm still going to observe it for a few days. The CPU is getting hotter than it should, so I'll leave it running and use it for a while to see if anything else fails. I've connected a keyboard, joystick, RAM expansion and a MegaFlash just to confirm that they all work too (and they do).

Bryce.

Edit: Seems I spoke too soon :( The keyboard shadow problem is back!?! Either the 145 has failed again or the 8255 is also bad, time to go looking again.
Title: Re: Endless loop...
Post by: VincentGR on 14:56, 24 August 14
Quote from: Bryce on 13:30, 24 August 14Edit: Seems I spoke too soon :( The keyboard shadow problem is back!?! Either the 145 has failed again or the 8255 is also bad, time to go looking again.

AAARrrrgghh  >:(

I have faith  ;D
Title: Re: Endless loop...
Post by: Bryce on 15:27, 24 August 14
Really wierd. The 145 works when I test it on its own. When it's installed on the board it's getting 5V, GND and the 4 BCD bits are also fine, but none of the outputs ever goes to 5V. I've checked the pins on the baord and they aren't shorted to GND?? So where's the problem? Will continue looking...

Bryce.
Title: Re: Endless loop...
Post by: gerald on 15:41, 24 August 14
Quote from: Bryce on 15:27, 24 August 14
Really wierd. The 145 works when I test it on its own. When it's installed on the board it's getting 5V, GND and the 4 BCD bits are also fine, but none of the outputs ever goes to 5V. I've checked the pins on the baord and they aren't shorted to GND?? So where's the problem? Will continue looking...
Have checked/replaced the AY ?
The 145 has open collector output, they will only go high if pulled up externally.
The pull up are in the AY, and will pull the 145 ouput only when pressing a key that is not in the selected line.
If the AY has its pull up damaged, the ghosting may happen.
There is also a place for a resistor network that should act as pull up just behind the AY, you may try adding it.
Title: Re: Endless loop...
Post by: Bryce on 15:46, 24 August 14
The AY has already been replaced and I was also using a pull-up resistor to test the outputs. Maybe it's the AY version I'm using? Let me check if I have a different version....

Bryce.
Title: Re: Endless loop...
Post by: Bryce on 15:54, 24 August 14
Bloody Nora! It was the type of AY that was messing things up, so just to confirm what was recently discussed in a different thread here. Certain makes of AY can cause problems in the CPC. I now have a Microchip version installed: Works fine. The other one I had is marked "MICREL" and causes shadow keys on the first row. Possibly adding the pull-up resistors as Gerald has suggested would remove this problem?

@Vincent: Ok, this time it really does seem to be fixed completely, currently playing Sabrewolf :)

Bryce.
Title: Re: Endless loop...
Post by: arnoldemu on 16:58, 24 August 14
It is always good to read about another fixed CPC. :)
Title: Re: Endless loop...
Post by: gerald on 17:30, 24 August 14
Quote from: Bryce on 15:54, 24 August 14
Bloody Nora! It was the type of AY that was messing things up, so just to confirm what was recently discussed in a different thread here. Certain makes of AY can cause problems in the CPC. I now have a Microchip version installed: Works fine. The other one I had is marked "MICREL" and causes shadow keys on the first row.
That's interesting. I did not find any datasheet for the micrel version. Does it have internal pull up ?
Quote from: Bryce on 15:54, 24 August 14
Possibly adding the pull-up resistors as Gerald has suggested would remove this problem?
That should do the trick. I've been always wondering why Amstrad put it on the board. I've seen few board having them mounted.
Title: Re: Endless loop...
Post by: Bryce on 18:00, 24 August 14
Here's the part for reference:

Bryce.


Title: Re: Endless loop...
Post by: VincentGR on 19:41, 24 August 14
(http://guidowatch.typepad.com/.a/6a0120a51d52b4970b01310fce78e1970c-800wi)

Thank you.
Title: Re: Endless loop...
Post by: Bryce on 09:22, 25 August 14
@Vincent: No problem Always good to get another CPC back running. Especially one with "emotional value" to the owner.

Quote from: gerald on 17:30, 24 August 14
That's interesting. I did not find any datasheet for the micrel version. Does it have internal pull up ? That should do the trick. I've been always wondering why Amstrad put it on the board. I've seen few board having them mounted.

I have three makes of AY here: GI and Microchip parts work fine, the Micrel part doesn't (at least not without external pull-up resistors). Do you know of other makes?

Bryce.
Title: Re: Endless loop...
Post by: 00WReX on 09:36, 25 August 14
Quote from: Bryce on 18:00, 24 August 14
Here's the part for reference:

Bryce.


I have a lot of CPC's and none have that brand AY.

The date code on the one in the picture is 9610 ... so that particular one was never (originally) in a CPC ??

Cheers,
Shane
Title: Re: Endless loop...
Post by: Bryce on 09:46, 25 August 14
No, all CPCs had GI AYs installed, the others are parts that I extracted from Arcade machines (Bally used them extensively) or parts I bought from other sources over the years.

Bryce.
Title: Re: Endless loop...
Post by: gerald on 10:18, 25 August 14
Quote from: Bryce on 09:22, 25 August 14
I have three makes of AY here: GI and Microchip parts work fine, the Micrel part doesn't (at least not without external pull-up resistors). Do you know of other makes?
I was only aware of GI and Microchip (being a GI spin-out). Never crossed a Micrel one on my way ;)
But it would be interesting to check if these have internal pull-up or not.
Title: Re: Endless loop...
Post by: Bryce on 10:35, 25 August 14
I'll test it properly when I get a chance.

Bryce.
Title: Re: Endless loop...
Post by: VincentGR on 11:28, 25 August 14
When I repaired my CPC 464 which I found him in a trashcan 12+ years ago I had the same feeling.
It makes me happy when a micro is ressurected and that goes x2 when it is the first one  :)
Title: Re: Endless loop...
Post by: pacomix on 12:15, 25 August 14
Hi Brice!


   Regarding the FDC problem is the exact behaviour I get when connecting an external 3.5" pc drive with the hacked cable. I think that happens 'cos of the READY signal if I remember correctly.
Title: Re: Endless loop...
Post by: Bryce on 12:17, 25 August 14
Hi pacomix,
      thanks for the tip. This CPC had no drive connected when it was having this problem. The FDC really was the fault.

Bryce.
Powered by SMFPacks Menu Editor Mod