Scratchpad

If you are new to Scratchpad, and want full access as a Scratchpad editor, create an account!
If you already have an account, log in and have fun!!

READ MORE

Scratchpad
Advertisement

[[]] at Wikia


[[Category:]]

The ay-3-8912(a) is a sound renerating chip that is build in on severall 128kb types off the zx spectrum but also as seperate board for 48k specrum (emulation) It uses different ports on different boards like TS2068 (w/ clock 1.76475Mhz *Sinclair Computer Hardware Factsheet) or european spectrums. On the 128Kb is uses port 49149 and 65533

http://en.wikipedia.org/wiki/AY-3-8912

next part is from "ZXSpectrum+2Manual.txt"

The way in which the AY-3-8912 works is quite complex, and the would-be experimenter is advised to get the manufacturer's data sheet. The following information should be enough to get things underway, however:

The sound chip contains sixteen registers which are selected by writing first to the address write port FFFDh (65533) with the register number, and then reading the register value (same address), or writing to the data register write address BFFDh (49149). Once a register has been selected, any number of data read/writes can be made; the address write port need only be re-written if a different register needs to be accessed.

The basic clock frequency of the circuit is 1.7734MHz (to 0.01%).

The registers do the following:

R0 - Fine tone control channel A R1 - Coarse tone control channel A R2 - Fine tone control channel B R3 - Coarse tone control channel B R4 - Fine tone control channel C R5 - Coarse tone control channel C

The tone of a channel is a 12 bit value taken from the sum of D3-D0 of the coarse register, and D7-D0 of the the fine register. The basic unit of tone is the clock frequency divided by 16 (ie. 110.83KHz), and with a 12 bit counter range, frequencies from 27Hz to 110KHz can be generated.

R6 - Noise generator control, D4-D0

The period of the noise source is taken by counting down the lower 5 bits of the noise register every sound clock period divided by 16.

R7 - Mixer and I/O control

D7 - Not used D6 - 1 means input port - 0 means output port D5 - Channel C noise D4 - Channel B noise D3 - Channel A noise D2 - Channel C tone D1 - Channel B tone D0 - Channel A tone

This register controls both the mixing of noise and tone values for each channel, and the direction of the 8 bit I/O port. A zero in a mix bit indicates that the function is enabled.

R8 - Amplitude control channel A R9 - Amplitude control channel B RA - Amplitude control channel C

D4 - 1 means use envelope generator

               - 0 means use value of D3-D0 for amplitude

D3-D0 - Amplitude

These three registers control the amplitude of each channel and whether or not it is modulated by the envelope registers.

RB - Envelope coarse period control RC - Envelope fine period control

The eight bit values in RB+RC are summed to produce a 16 bit number which is counted down in units of 256 multiplied by the sound clock. Envelope frequencies can be between 0.1Hz and 6KHz.

RD - Envelope control

D3 - Continue D2 - Attack D1 - Alternate D0 - Hold

The diagram of envelope shapes (in part 19 of this chapter) gives a graphic illustration of the possible settings for this register.

Advertisement