INMC 80 News

  

October–December 1981 · Issue 5

Page 29 of 71

If all is well, plug in the PSG chip (taking precautions against static charges), cross your fingers and switch on. Hopefully everything should now work,

Addressing the PSG:

This is very simple – select a register by writing to port 8 and then load it or read from it with port 9.

eg. to load register 7 (PSG output enable) with 244 (tone channels A and B, noise channel A enabled) simply write:

(BASIC)      OUT8,7:0UT9,244

(ASSEMBLER)  LD A,#07
             OUT (8),A
             LD A,#F4
             OUT(9),A

And to read, say register 7:

(BASIC)      OUT8,7:PRINT INP(9)

(ASSEMBLER)  LD A, #07
             OUT (8),A
             IN A,(9)
             :Contents now in A

Further ideas:

If you anticipate using several PSGs in your system, try using a 2708 EPROM to decode the address bus and control signals. The eight outputs could be paired to provide the BC1 and BDIR signals for four PSGs. Optional simultaneous access to all of them would be possible (in the write mode anyway) and the hardware would be much easier and cheaper to build.

Suggested reading:

  1. The data manual for the PSG from the retailers
  2. BYTE, July 1979
  3. Personal Computer World, October 1980
  4. Practical Electronics, September 1980
  5. TTL Cookbook, D. Lancaster

Figure 2

NASIO Circuitry For Several Ports Attached To Bus

Page 29 of 71