If connecting a sound chip, any reason to use a 6522?

Building your first 6502-based project? We'll help you get started here.
Post Reply
JasonRP
Posts: 4
Joined: 29 Jun 2016

If connecting a sound chip, any reason to use a 6522?

Post by JasonRP »

Here's a newbie question:
If I want to connect a PSG chip to my 6502 computer, like an AY-3-8910 for example, do I need to connect it through a 6522? Or can I just connect it direct to the bus? And if either solution would work, is there any advantage to using the 6522 in this scenario?

Jason
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Check out my home-brew computer projects:
https://m.youtube.com/watch?v=EgXulWcfLKc
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: If connecting a sound chip, any reason to use a 6522?

Post by BigEd »

I notice Acorn's BBC Micro connects the sound chip indirectly. I can think of a couple of possible reasons:
- the timing of the chip's bus interface might make it tricky to connect directly
- by putting several (low-bandwidth) peripheral chips behind the 6522, there's reduced load on the bus. In this machine, the bus is very overloaded even with this tactic in play, so it might have been an important consideration

Another possibility is that indirect connection offers a boundary, both for hardware and software, which means the main part of the machine can be developed and debugged even if it's not yet known exactly what peripheral chips will be needed.

(On the Beeb, behind the system VIA we find the keyboard, LEDs, sound chip, optional ROM cartridge interface and optional speech chip, behind which is the optional serial ROM.)
User avatar
PaulF
Posts: 143
Joined: 08 Dec 2008
Location: Brighton, England

Re: If connecting a sound chip, any reason to use a 6522?

Post by PaulF »

There are two reasons to use a 6522 to connect a sound chip

1) Incompatible bus speed.
The old PSGs, like the AY-3-8910, can't be connected directly to the 6502 bus if the CPU is running faster than 2MHz without the hassle of implementing wait-states. If you want to run your CPU faster than 2MHz, connecting older, slow devices through a 6522 is the easiest option.

2) Incompatible bus signals.
Most PSGs were not designed to directly connect to the 6502 bus. As a result, they need different control signals to those on the 6502 bus, requiring logic to convert the 6502 bus signals to those needed by the PSG. While this isn't a major problem if you are implementing your system with a programmable logic device, if you are using 74HC devices, the interface between a 6502 and a PSG can require several logic devices to implement. By connecting the PSG through a 6522, the logic needed to generate the control signals for the PSG becomes a software issue instead of a hardware issue.

To summarize, if you are happy running your system at a low clock speed and it isn't too difficult to interface the PSG to the 6502's bus, there is no advantage to using a 6522 to connect the PSG. If, however, you want to run your CPU faster than 2MHz or the interfacing requirements of the PSG are complex, connecting the PSG through a 6522 is the better option.
Shift to the left,
Shift to the right,
Mask in, Mask Out,
BYTE! BYTE! BYTE!
User avatar
cbmeeks
Posts: 1254
Joined: 17 Aug 2005
Location: Soddy-Daisy, TN USA
Contact:

Re: If connecting a sound chip, any reason to use a 6522?

Post by cbmeeks »

One other advantage of using a 6522 between the PSG and CPU is that is how the Mockingboard (for example) in the Apple II was designed. Which makes it a little easier to find example code to control the PSG. In other words, it's a "proven" design with software floating out there that uses that design.
Cat; the other white meat.
Post Reply