Author Topic: Endless loop...  (Read 2891 times)

0 Members and 1 Guest are viewing this topic.

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 10.865
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 3817
  • Likes Given: 391
Endless loop...
« on: 16: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.

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.332
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2251
  • Likes Given: 3477
Re: Endless loop...
« Reply #1 on: 16:59, 23 August 14 »
Code: [Select]
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:
Code: [Select]
6d 78 07 30 7b
bit 7 seems to be inverted or stuck at 0.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 10.865
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 3817
  • Likes Given: 391
Re: Endless loop...
« Reply #2 on: 22:55, 23 August 14 »
Hmmm, then it's most likely the FDC that's failed. I'll swap it.

Thanks,
Bryce.

Offline gerald

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.361
  • Liked: 970
  • Likes Given: 243
Re: Endless loop...
« Reply #3 on: 23:20, 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.

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.332
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2251
  • Likes Given: 3477
Re: Endless loop...
« Reply #4 on: 23:21, 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.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 10.865
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 3817
  • Likes Given: 391
Re: Endless loop...
« Reply #5 on: 23: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.

Offline MacDeath

  • Chaotic post writer and mock-up specialist
  • Supporter
  • 6128 Plus
  • *
  • Posts: 4.041
  • Country: fr
  • Liked: 1109
  • Likes Given: 619
Re: Endless loop...
« Reply #6 on: 00:56, 24 August 14 »
simple :

cls
10 goto 10
run

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.332
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2251
  • Likes Given: 3477
Re: Endless loop...
« Reply #7 on: 10: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.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 10.865
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 3817
  • Likes Given: 391
Re: Endless loop...
« Reply #8 on: 10: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.

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.332
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2251
  • Likes Given: 3477
Re: Endless loop...
« Reply #9 on: 10:53, 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.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 10.865
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 3817
  • Likes Given: 391
Re: Endless loop...
« Reply #10 on: 10: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.
« Last Edit: 11:33, 24 August 14 by Bryce »

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 10.865
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 3817
  • Likes Given: 391
Re: Endless loop...
« Reply #11 on: 15: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.
« Last Edit: 15:51, 24 August 14 by Bryce »

Offline VincentGR

  • 6128 Plus
  • ******
  • Posts: 1.024
  • Country: gr
    • Parts from the past.
  • Liked: 508
  • Likes Given: 1410
Re: Endless loop...
« Reply #12 on: 16:56, 24 August 14 »
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.

AAARrrrgghh  >:(

I have faith  ;D
To blit, or not to blit?
Amiga 1200 Black Project

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 10.865
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 3817
  • Likes Given: 391
Re: Endless loop...
« Reply #13 on: 17: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.

Offline gerald

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.361
  • Liked: 970
  • Likes Given: 243
Re: Endless loop...
« Reply #14 on: 17:41, 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.

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 10.865
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 3817
  • Likes Given: 391
Re: Endless loop...
« Reply #15 on: 17: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.

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 10.865
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 3817
  • Likes Given: 391
Re: Endless loop...
« Reply #16 on: 17: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.
« Last Edit: 17:56, 24 August 14 by Bryce »

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.332
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2251
  • Likes Given: 3477
Re: Endless loop...
« Reply #17 on: 18:58, 24 August 14 »
It is always good to read about another fixed CPC. :)
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline gerald

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.361
  • Liked: 970
  • Likes Given: 243
Re: Endless loop...
« Reply #18 on: 19:30, 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 ?
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.

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 10.865
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 3817
  • Likes Given: 391
Re: Endless loop...
« Reply #19 on: 20:00, 24 August 14 »
Here's the part for reference:

Bryce.



Offline VincentGR

  • 6128 Plus
  • ******
  • Posts: 1.024
  • Country: gr
    • Parts from the past.
  • Liked: 508
  • Likes Given: 1410
Re: Endless loop...
« Reply #20 on: 21:41, 24 August 14 »


Thank you.
To blit, or not to blit?
Amiga 1200 Black Project

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 10.865
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 3817
  • Likes Given: 391
Re: Endless loop...
« Reply #21 on: 11:22, 25 August 14 »
@Vincent: No problem Always good to get another CPC back running. Especially one with "emotional value" to the owner.

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.

Online 00WReX

  • 6128 Plus
  • ******
  • Posts: 674
  • Country: au
  • The time you enjoy wasting is not wasted time.
    • index.php?action=treasury
    • CPCwiki
  • Liked: 387
  • Likes Given: 849
Re: Endless loop...
« Reply #22 on: 11:36, 25 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
The CPC in Australia...
Awa - CPCWiki

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 10.865
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 3817
  • Likes Given: 391
Re: Endless loop...
« Reply #23 on: 11: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.

Offline gerald

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.361
  • Liked: 970
  • Likes Given: 243
Re: Endless loop...
« Reply #24 on: 12:18, 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.