CPCWiki forum

General Category => Amstrad CPC hardware => Topic started by: Cwiiis on 00:02, 29 July 21

Title: 464+ controller port issue
Post by: Cwiiis on 00:02, 29 July 21
I just got a 464+ off eBay (lucky me!) and while most everything seems fine, it seems like the 1st player (nearest the narrow edge of the machine) port has issues. If I plug a pad in 2P, each press generates one keypress, but in the 1P port, they generate a whole miriad of presses. Trying to play a GX4000 cart game doesn't really work, presumably because of the spurious presses. Navigating in the C4CPC menu works fine with the pad in the 2P port, but goes a bit crazy in the 1P port, again, presumably for the same reasons.

Is this just me not understanding how the Plus computers work, or is this a problem? If the latter, any ideas as to what to check/tweak to fix it? I've no problem with opening it up and getting the soldering iron out (waiting for bits to upgrade it in fact, though they might be a while).
 
Title: Re: 464+ controller port issue
Post by: Cwiiis on 09:13, 29 July 21
Having read the manual, it seems my DEL key might also be having issues - though it works in the keyboard tester app, when I press it at the BASIC terminal, it inserts ".0%u220F%u29D6" and doesn't delete anything. So I guess there's an issue with whatever handles input... Interestingly, the key-repeat of DEL works correctly, it's just the initial press that has issues. This appears to be the same with the controller inputs too.
Title: Re: 464+ controller port issue
Post by: Bryce on 09:56, 29 July 21
Disconnect the keyboard membrane and see if the joystick problem persists. You may just need to clean the membrane.


Bryce.
Title: Re: 464+ controller port issue
Post by: Cwiiis on 11:25, 29 July 21
Disconnect the keyboard membrane and see if the joystick problem persists. You may just need to clean the membrane.


Bryce.
Just tried this and unfortunately the joypad problems persist... Does that point to a bad AY chip? Or are there more debugging steps before that point?
Title: Re: 464+ controller port issue
Post by: GUNHED on 11:52, 29 July 21
Easy fix: Get rid of the resistor network in the 464plus. That will work. See thread about it somewhere here.
Title: Re: 464+ controller port issue
Post by: Cwiiis on 12:11, 29 July 21
Easy fix: Get rid of the resistor network in the 464plus. That will work. See thread about it somewhere here.
Searching around, I see that advised - given that basically everything works for me except that one key and the 1P joypad though, is that likely to be the issue? I suppose desoldering it isn't going to hurt anything so I may as well give it a go...

Edit: Just another piece of information in case it wasn't clear before, every wrong result I get from the 1P pad and the DEL key is perfectly consistent - they all result in the same combination of inputs in the same order every time it seems. I can alter them sometimes by holding other keys while pressing them.
Title: Re: 464+ controller port issue
Post by: Bryce on 13:13, 29 July 21
As the problem effects the Joystick port, it's less likely to be a resistor network problem. The only other two components involved are the ASIC and the AY. Let's hope it's just a bad AY.

Bryce.
Title: Re: 464+ controller port issue
Post by: Cwiiis on 13:36, 29 July 21
I snipped off the resistor network (not after spending more time than I'd have liked trying to desolder it...) and yes, no difference at all. I guess I'll be sourcing a new AY chip :| I have a GX4000, maybe I should take the chip from that to test with, though I'm going to need to get a decent desoldering station. If it's anything like this 464+ I don't really trust that I can desolder it using just a pump+wick...

There's some other odd behaviour I've noticed... If I'm holding down other keys, some keys will input multiple characters - this becomes obvious as you touch-type - so 1+2, then 3 inputs '43', o+u, then n inputs 'oumn'... Is this expected?
Title: Re: 464+ controller port issue
Post by: eto on 13:56, 29 July 21
There's some other odd behaviour I've noticed... If I'm holding down other keys, some keys will input multiple characters - this becomes obvious as you touch-type - so 1+2, then 3 inputs '43', o+u, then n inputs 'oumn'... Is this expected?

Yes, that's a side effect of a keyboard matrix. If you have already pressed 1+2, Line &48 will be selected and also bit 0 and 1. When you now hit 3 while the others are still pressed, line &47 will be selected, but since bit 0 and 1 are also already active, it will detect both 4 and 3.

Check out the matrix here: https://www.cpcwiki.eu/index.php/Programming:Keyboard_scanning

DEL and joystick one are also on the same line, so whatever causes this, is probably related to this line. When you start BASIC and hit the joystick directions, does it only show arrows or will there also be other characters?

Regarding this:  ".0%u220F%u29D6", do you mean it shows . then 0 then % then u then 2 then 2 again then 0 then F then ... or is "%u220F" and "%u29D6" a unicode character that somehow got not properly copy/pasted?
Title: Re: 464+ controller port issue
Post by: Bryce on 14:25, 29 July 21
I snipped off the resistor network (not after spending more time than I'd have liked trying to desolder it...) and yes, no difference at all. I guess I'll be sourcing a new AY chip :| I have a GX4000, maybe I should take the chip from that to test with, though I'm going to need to get a decent desoldering station. If it's anything like this 464+ I don't really trust that I can desolder it using just a pump+wick...

There's some other odd behaviour I've noticed... If I'm holding down other keys, some keys will input multiple characters - this becomes obvious as you touch-type - so 1+2, then 3 inputs '43', o+u, then n inputs 'oumn'... Is this expected?

Before you go ordering anything, I'd remove and (carefully) clean the membrane with warm soapy water using a soft cloth. Don't use anything abrasive!And don't take the AY from your GX. You'll end up damaging the GX board, when you can get an AY cheaply on ebay.

Bryce.
Title: Re: 464+ controller port issue
Post by: Cwiiis on 14:30, 29 July 21
Yes, that's a side effect of a keyboard matrix. If you have already pressed 1+2, Line &48 will be selected and also bit 0 and 1. When you now hit 3 while the others are still pressed, line &47 will be selected, but since bit 0 and 1 are also already active, it will detect both 4 and 3.

Check out the matrix here: https://www.cpcwiki.eu/index.php/Programming:Keyboard_scanning (https://www.cpcwiki.eu/index.php/Programming:Keyboard_scanning)

DEL and joystick one are also on the same line, so whatever causes this, is probably related to this line. When you start BASIC and hit the joystick directions, does it only show arrows or will there also be other characters?

Regarding this:  ".0%u220F%u29D6", do you mean it shows . then 0 then % then u then 2 then 2 again then 0 then F then ... or is "%u220F" and "%u29D6" a unicode character that somehow got not properly copy/pasted?
Ok, I thought the matrix thing might be the case, though interestingly the keyboard tester seems to be clever enough to work around that. Re those symbols, yes, it was unicode that got mangled by this forum - here's a screenshot: https://photos.app.goo.gl/3yrAhWaqCDRB6xgf8 (https://photos.app.goo.gl/3yrAhWaqCDRB6xgf8)
That's the result of me pressing each button once and hitting return (after typing out the label). Left is a bit confusing because it includes a break in it... If I press the buttons multiple times, it results in the same inputs in the same order (at least it seems that way) and if I keep the button held, the correct behaviour happens. At the end of each string, you can see it actually inputs the correct character. I'm not sure if that's happening with Del, I don't see another character that gets deleted, but it might just be happening too quickly for me to see.
Title: Re: 464+ controller port issue
Post by: Cwiiis on 14:31, 29 July 21
Before you go ordering anything, I'd remove and (carefully) clean the membrane with warm soapy water using a soft cloth. Don't use anything abrasive!And don't take the AY from your GX. You'll end up damaging the GX board, when you can get an AY cheaply on ebay.

Bryce.
Given this happens with the keyboard entirely removed, is there much point? Doesn't hurt to be clean of course :) But in terms of fixing the problem...
Title: Re: 464+ controller port issue
Post by: Bryce on 14:39, 29 July 21
No, it won't solve the issue, but it is a good idea to do it anyway when you have the computer apart.

Bryce.
Title: Re: 464+ controller port issue
Post by: eto on 14:59, 29 July 21
That's the result of me pressing each button once and hitting return (after typing out the label). Left is a bit confusing because it includes a break in it... If I press the buttons multiple times, it results in the same inputs in the same order (at least it seems that way) and if I keep the button held, the correct behaviour happens.

If you compare the exact output to the keyboard matrix, then you see, that anything that happens on line 48 will trigger everything else on the same bit of all lines.

Gamepad right is most easy to explain, as there are no special characters involved: F9, F8, ], p, i, y t, w, q, joystick right, which is exactly bit 3, line &40 - &49

I am no expert in electronics and hopefully Bryce can correct me if I am wrong, but if the soundchip would be malfunctioning, I doubt that it would have this effect. To me it looks much more like there must be somewhere a short between line 49 and either ground or 5v (not sure which one though...). If I understand the keyboard scanning correctly, whenever bit 3 is checked by the computer (which is done for every line starting at 40, that's why they are always in exactly the same sequence), it will will always detect that the key on each line is pressed, as long as the respective key on line 49 is pressed.

If that's the case, then carefully check if the membrane is clean, especially where it connects to the board, check the connector, if something is in there. Or maybe some short on the membrane. Or on the PCB...
Title: Re: 464+ controller port issue
Post by: Bryce on 15:14, 29 July 21
Close but not 100% correct. I'm not sure what you mean with "line 48" or "line 49", but if there was a direct short then you would get characters appearing without pressing anything. What can happen is that inputs (AY) or ouputs (ASIC) can end up being connected inside the chips due to unexpected voltages (if some idiot connected a powered joystick to the joystick port for example). Then the failure only occurs when a key is pressed. The AY then "thinks" that every key on a certain row/column is pressed. What has actually happened inside the IC is that the pullup resistors have either lost their connection to the 5V rail or the resistors have shorted (become 0 ohms).


Bryce.
Title: Re: 464+ controller port issue
Post by: eto on 15:27, 29 July 21
I'm not sure what you mean with "line 48" or "line 49",

I am referring to the map in this document and there it's called line &40-&49: https://www.cpcwiki.eu/index.php/Programming:Keyboard_scanning

Thanks for the clarification. Then let's hope it's the AY and not the ASIC.


Title: Re: 464+ controller port issue
Post by: Cwiiis on 15:44, 29 July 21
Interesting, I've got an AY on the way, here's hoping it's that... I assume by ASIC, you're referring to the big Amstrad branded chip that I guess is basically impossible/pointless to replace? Is there anything worth testing outside of the chips, just in case? I did test for ground/5V shorts, I didn't find any but then I don't really know what I'd be looking for either...
Title: Re: 464+ controller port issue
Post by: GUNHED on 18:35, 29 July 21
Sorry to hear. I did remove (by moving the network back and forward a couple of times) the resistor network and that way I got three 6128plus working again (regarding the keyboard failures).
Hope you'll find a working solution.
Title: Re: 464+ controller port issue
Post by: Bryce on 21:16, 29 July 21
Sorry to hear. I did remove (by moving the network back and forward a couple of times) the resistor network and that way I got three 6128plus working again (regarding the keyboard failures).
Hope you'll find a working solution.

The resistor network solution only resolves keyboard problems, because the membrane has a relatively high resistance. Joysticks have real buttons or contacts, so the resistance should be a lot lower and they won't be effected by the resistor network issue.

Bryce.
Title: Re: 464+ controller port issue
Post by: Cwiiis on 11:41, 30 July 21
I guess it's very unlikely, but it could possibly be a shorted/bust resistor too? I'm going to check all of the relevant ones later... Will probably be a few days before the AY chip arrives, so may as well. I suppose I can get on without a delete key and without the 1P pad, though it's a shame given that the system otherwise works perfectly, even the tape drive...
Title: Re: 464+ controller port issue
Post by: eto on 11:56, 30 July 21
Close but not 100% correct.

Just out of curiosity: what is actually happening there? From the code on the Wiki page I would expect it to be something like this: Rows/lines are by default high. As long as no key is pressed, the bits (AY) are ... floating? To identify key presses on all rows/lines the computer iterates over the rows/lines and switches every single row for a short period to low. Since the computer now knows which line is selected a logical 0 on a respective bit will indicate that a specific key is pressed.
Title: Re: 464+ controller port issue
Post by: Cwiiis on 13:12, 30 July 21
Testing resistor values around the control port,

R58-60 test at about 3.98K

R61-63 test at 0.916, 0.926 and 0.936 K respectively - I guess that's within tolerance?
R67 and R64 test at 7.1K

R65 and R66 test at 7.7K

All the diodes around there test the same, so I assume are functional (0V in one direction, 0.610V in the other).

On IC16, there's also a 4.5K resistor between legs 14 and 2 and a diode between legs 3 and 4 that tests 1.4V in one direction and the same as the rest (0.610V) in the other... Is that expected?
Please excuse my lack of electronics knowledge, I'm very happy to be educated 🙂
Edit: Took a bunch of pictures of the board, in case anyone wanted to look or if it's helpful for someone in the future: https://photos.app.goo.gl/vAZgNScxPm6mEkPT8
Title: Re: 464+ controller port issue
Post by: pelrun on 13:50, 30 July 21
As long as no key is pressed, the bits (AY) are ... floating?


Not floating, but pulled up weakly with a resistor (internal for the original AY, external with the -A version). That way they stay high unless connected to ground, i.e. through a pressed switch to a row pin when it's currently being scanned.
Title: Re: 464+ controller port issue
Post by: Bryce on 15:38, 30 July 21
Just out of curiosity: what is actually happening there? From the code on the Wiki page I would expect it to be something like this: Rows/lines are by default high. As long as no key is pressed, the bits (AY) are ... floating? To identify key presses on all rows/lines the computer iterates over the rows/lines and switches every single row for a short period to low. Since the computer now knows which line is selected a logical 0 on a respective bit will indicate that a specific key is pressed.

All correct except for the floating bit that pelrun has just explained.

Bryce.
Title: Re: 464+ controller port issue
Post by: GUNHED on 16:30, 30 July 21
The resistor network solution only resolves keyboard problems, because the membrane has a relatively high resistance. Joysticks have real buttons or contacts, so the resistance should be a lot lower and they won't be effected by the resistor network issue.
Bryce.
True! For the joystick. Not for the DEL key. As told it worked for me in three cases. In the CPC6128 there is actually a spot for this resistor network on the PCB, but unused ;-) They got it. But back to topic...
Title: Re: 464+ controller port issue
Post by: Cwiiis on 20:10, 30 July 21
Back to the topic, I just socketed the AY chip - not received the new one yet, but the old one is acting identically to before, so good to know I didn't screw it up! Will update once I get the new AY...
Title: Re: 464+ controller port issue
Post by: Cwiiis on 15:00, 31 July 21
And bad news for me, new AY chip arrived and unfortunately the behaviour is exactly the same :( I guess at this point it's likely to be the ASIC... Is there a circuit diagram/chip listing somewhere handy for the 464+? It'd be good to check everything and make sure that it's definitely the ASIC and not something simpler - I don't want to give up hope just yet!

Edit: Found the service manual - now to decide how deep I want to go here...
Title: Re: 464+ controller port issue
Post by: Bryce on 16:26, 31 July 21
If you have a logic analyser you can connect it up to the ASIC keyboard outputs and observe what happens. It should run in an endless loop of all bits high except for one going low. ie:
11111110
11111101
11111011


Bryce.
 
Title: Re: 464+ controller port issue
Post by: Cwiiis on 16:35, 31 July 21
If you have a logic analyser you can connect it up to the ASIC keyboard outputs and observe what happens. It should run in an endless loop of all bits high except for one going low. ie:
11111110
11111101
11111011


Bryce.
Now, do I buy a logic analyser to debug this...  :D
I assume that what might happen is that on one of the scans, it might erroneously have all of the bits low?
If it was scanning correctly, is there a part of the circuit outside of the ASIC that might be worth checking? I guess IC16, given it's connected directly to those lines - are the diode and resistor bodges on there standard?
Title: Re: 464+ controller port issue
Post by: Cwiiis on 17:06, 31 July 21
I was looking around for pictures of other people's 464+'s... I notice on this photo*, there are no bodges on IC16 at all... (unless they're on the underside I suppose - which seems unlikely?) I'm wondering if this is some kind of fix or mitigation that didn't quite work out? Here's mine**

* https://www.nightfallcrew.com/wp-content/gallery/amstrad_cpc_464_plus/img_1582.jpg?1ad88f
** https://photos.app.goo.gl/5BUETo78oZQePGpi9 (https://photos.app.goo.gl/5BUETo78oZQePGpi9)
Title: Re: 464+ controller port issue
Post by: Bryce on 17:20, 31 July 21
IC16?? The keyboard outputs of the ASIC go directly to the keyboard connector. Those traces from the ASIC only go under IC16, they are not connected to it.

Bryce.
Title: Re: 464+ controller port issue
Post by: Cwiiis on 17:31, 31 July 21
ah, ok, I guess they just go under that chip, I assumed there must be vias connected to it but obviously a bad assumption :) Also I see that the differences on that IC are down to different board revisions and the chip is actually different.
I don't have or have access to an oscilloscope at the moment, I'd like to eliminate everything possible without one if possible, but perhaps I have already...
Title: Re: 464+ controller port issue
Post by: Cwiiis on 00:57, 01 August 21
Not wanting to let go of this without a fight, I've been reading, studying schematics, searching... I found this video of someone with the exact same problem on a CPC6128 - https://www.youtube.com/watch?v=PU_AIW6kJSU

The Y keyboard lines go to a 74LS chip on there though, which seems to have been subsumed by the ASIC on the Plus, so more evidence pointing at that :(

Having looked at all the schematics in the service manual, the only things the keyboard Y lines are connected to are the ASIC, the keyboard connector and COM1 on the joystick ports. I've checked for shorts between pins on CP04, NR02 and any unexpected ground/5V shorts, all came up negative. Nothing is wrong with keyboard X, but I've checked everything there anyway. The X lines are connected to the AY (replaced and no change, so presumably fine) and NR02 (removed and no change, so presumably fine).


I think I might be out of ideas for things I can check with the equipment I have... Everything points to the ASIC right now, but it seems like such an unlikely thing to happen with no trace of any other issues anywhere else... If anyone has any ideas, I'm all ears. If it is the ASIC, I guess I'm just out of luck? I'd happily sacrifice my GX4000 to have a fully working 464 Plus if there's anyone that has the skills to desolder/resolder that chip... I have the equipment, but I'm certain I don't have the talent and I'd rather not test that on something like this... Any help gratefully received! (alternatively, anyone looking to get rid of a 464 Plus on the cheap...)
Title: Re: 464+ controller port issue
Post by: RetroCPC on 10:15, 01 August 21
Hi,


Its a chance that the ASICS Joystick / keyboard port has been Damged by ESD (Joystick cable).

I can confirm condition of the ASICs internal ESD protection diodes with lab equipment here and no problem to swap the ASIC SMD IC if required (I have full SMD rework equipment) - trouble is during these covid times I'm based in Czech Rep. so shipping is not so easy post Brexit... but happy to do the work for free if you cover the shipping costs...
Title: Re: 464+ controller port issue
Post by: Cwiiis on 12:20, 01 August 21
Thanks, that's a very generous offer! Postage is actually not too expensive, at least on the UK side, so once I've exhausted a couple more avenues I'll send you a PM 🙂

It's a shame the design didn't include more protection from this kind of thing...

Hi,


Its a chance that the ASICS Joystick / keyboard port has been Damged by ESD (Joystick cable).

I can confirm condition of the ASICs internal ESD protection diodes with lab equipment here and no problem to swap the ASIC SMD IC if required (I have full SMD rework equipment) - trouble is during these covid times I'm based in Czech Rep. so shipping is not so easy post Brexit... but happy to do the work for free if you cover the shipping costs...
Title: Re: 464+ controller port issue
Post by: Cwiiis on 15:29, 01 August 21
Ok, one last desperate idea... Would it be possible to bypass the ASIC for keyboard handling using a 74LS145 like on the non-Plus models?
I can't work out from the schematics if it's possible and what exactly you'd need to bodge where to do it, but it seems like it might be vaguely possible? I suppose that if you could figure out what corresponds to the 4 input lines on that chip, you could cut the traces for KY1-10 on the ASIC, connect those 10 lines to the 74LS145 (along with the 4 inputs, assuming they have corresponding lines somewhere), find points for VCC/GND and that'd work around the ASIC for input?
Title: Re: 464+ controller port issue
Post by: Cwiiis on 15:43, 01 August 21
Ok, one last desperate idea... Would it be possible to bypass the ASIC for keyboard handling using a 74LS145 like on the non-Plus models?
I can't work out from the schematics if it's possible and what exactly you'd need to bodge where to do it, but it seems like it might be vaguely possible? I suppose that if you could figure out what corresponds to the 4 input lines on that chip, you could cut the traces for KY1-10 on the ASIC, connect those 10 lines to the 74LS145 (along with the 4 inputs, assuming they have corresponding lines somewhere), find points for VCC/GND and that'd work around the ASIC for input?
More reading and I can see that that's probably not feasible - those input lines are on an 8225 on the CPC and the strobing of those 4 pins is likely also completely internal to the ASIC... Maybe it's time to give up :( It's a shame to sacrifice a GX4000, but I'd rather have the home computer than the console...
Title: Re: 464+ controller port issue
Post by: eto on 15:44, 02 August 21
It's a shame to sacrifice a GX4000, but I'd rather have the home computer than the console...

but what if this doesn't work or if you fry the other Acid? If you buy a broken Plus or GX, it's fine, but please don't kill a very rare working machine.
Title: Re: 464+ controller port issue
Post by: Cwiiis on 16:16, 02 August 21
but what if this doesn't work or if you fry the other Acid? If you buy a broken Plus or GX, it's fine, but please don't kill a very rare working machine.
I don't like the idea either, but I trust anyone offering to do this that they have the skills necessary, I suppose. I'm looking at other Pluses on sale in case I can get a reasonable deal and avoid this.
Title: Re: 464+ controller port issue
Post by: Cwiiis on 20:48, 02 August 21
Crisis averted, just got a decent deal on a fully working 6128+, so I can even use the RAM I got to upgrade my GX4000 :)