General Category > Amstrad CPC hardware

How to interface to AY-3-8912 Port with other logic

(1/4) > >>

fkey:
Hello all,


Does anybody know how to interface the PSG (AY-3-8912) I/O Ports with any other logic gates ?
I mean, I can see from the schematics that a 74LS145 is interfaced with the PSG to control the keyboard/keys.
This is an OpenCollector output chip which (to me) means that there is no problem to interface it to the PSG I/O Port (input or output).


If I'm not mistaken (and being wrong happens a lot when I speak about a domain that I don't master), if the PSG I/O Port is set as an input (Keyboard matrix read), we can tie the output of a classical gate, e.g. 74HC00, to it without problem.
But what if the PSG I/O Port is set as an output ? Could it burn my 74HC00, or even worse my PSG ?


I haven't been able to find this information in the AY-3-8912 datasheet (I was looking for something like "Open Collector", "Totem Pole", etc ..), so maybe I missed it.


I figured out that the safer in that case is probably to stick an open collector/drain buffer in-between the 74HC00 and the PSG to mimic what is done between the 74LS145 and the PSG and avoid any damage, but is there a better approach ?
Thanks.

ralferoo:

--- Quote from: fkey on 14:46, 01 December 21 --- Could it burn my 74HC00, or even worse my PSG
--- End quote ---
You'll probably destroy whatever is most expensive! And not necessarily either of those chips, although they are the most likely to suffer.

But any other chip on the board could see problems when it's ground is suddenly higher potential than its inputs. And of course, you could also destroy your PSU. And if all of those survive, you could burn up the tracks on the PCB.

If you want to mitigate the problem a bit, you could stick a 100R resistor on each data line between the chips, but this will slow the transition times down, and still won't particularly help if left with both chips driving for a long time, as eventually the resistors will very hot. But 100R is a reasonable compromise that's relatively low current, so you might be able to last a while. This is definitely in hacky territory though. It's common practice nowadays to do this in some places to protect against accidental short circuits, but you shouldn't design the circuit using this to make it work.

However... A MASSIVE word of caution. (Someone else will have to correct me here, it's been too long and I might have this next bit wrong)... I think it's whenever you change direction on the PSG port, it results the output value to 0. Or it might be whenever you select a different port, the direction is reset, but that would be too dangerous, so I think it's the first one. But, e.g. this is the reason why my tape demo can't play music AND allow keyboard/joystick input at the same time... Because as soon as you switch between them, the tape motor switches off. Which I think, must mean it's the output that gets set to 0.

fkey:
Hi ralferoo,


Thanks a lot for your response.
Indeed, I would like to be as cautious as possible since I'm kind of learning on this area and I don't want to destroy anything.
The cpc 464 schematics [1] seems to suggest that 74LS145(OC) is connected straight to the AY-3-8912 when keys are pressed without any additional components.


That works well when the PSG Port is set an input, but I wonder what may happen if one sets the PSG I/O Port (PIN 7-14) as output and begins to change their values while keyboard keys are pressed ?
Is there a risk that something could break in that configuration ? (I would have thought that CPC engineers thought about  that, but who knows ?)


[1] https://www.cpcwiki.eu/imgs/6/6d/Schaltplan_cpc_464.jpg

TotO:
You will next require to program the PPI and the AY to access your add-on... Why not using the parallel port instead?

fkey:
Hi Toto,


I would like to build a gamepad adapter for pads that are not cpc compatible.
This adapter needs some logic (hence the gates I was mentionning) in order to operate correctly.
That's the reason why I would like to hook this to the joystick port.


I don't really want to use the PSG port as an output in that context, I'm just trying to consider side effects that may occur if this happens (who knows what cpc coders are capable of  :D [size=78%])[/size]
To be honest, I'm also using this "project" as an excuse to train myself in basic electronic.

Navigation

[0] Message Index

[#] Next page

Go to full version
Powered by SMFPacks Reactions Mod
Powered by SMFPacks Alerts Pro Mod
Powered by SMFPacks Mentions Pro Mod