Home -> Magazines -> Issues -> Articles in this issue -> View
Article Group: | |
The Programmable Digital Sound Generator (Part 3) | |
Part 3: The Detailed Program InterfaceArticle from Electronics & Music Maker, July 1984 | |
Our analysis of the Programmable Digital Sound Generator enters its third phase. Your guide: Alan Boothman.
Designer Alan Boothman takes a look at the interface section of this new add-on music system for home computers, paying particular attention to address locations.
In order to control the PDSG, a single page of address locations is required within the memory map of the host computer. The board is configured to match the extended page concept of the BBC Model B computer, and is initialised by writing &70 (112 in decimal) to address &FCFF, which sets a latch until a Reset operation occurs. All further addressing is then carried out using page &FD, ie. locations &FD00 to FDFF. Details are given later on how to disable this part of the system to interface with other computers.
Within the chosen page, addresses 0-127 are reused four times in order to allow Music Load (0-127), Waveform Load (0-127), Low Auxiliary (Keyboard) Read (0-31), and High Auxiliary Read or Write (0-15). Addresses above 127 are reserved to set the Control Register mode, which defines which of the above is active, and includes on/off control of sound and interrupt operation. Addresses 129-255 are not normally used.
The Control Register is set up by writing to address 128 using the data shown in Figure 1. On powering-up, or after a computer Reset, the register is set to zero, thus disabling the sound output and interrupt generator. One or both of these may then be enabled, together with one of the four PDSG functions, by writing the sum of the required activities to address 128. Only one PDSG function should be selected at a particular time: the others are automatically deactivated by the zeros in their bit positions.
Music loading involves the writing of data to the registers shown in Figure 2, which cover Level, Waveform, Channel, and Frequency as required for each logical oscillator. In order to change an oscillator parameter during normal operation, when both sound and interrupt are required, writing 7 to address 128 sets the Control Register, after which data corresponding to the new value is written to the relevant address (0-127) from Figure 2. The Control Register will remain set in Music Load mode until a further write operation takes place to address 128.
Level data is a number between 0 and 255, which gives a linear increase in amplitude. Waveform and Channel are combined into a single number. For the normal configuration of two 2Kx8 memories, the 128 Byte tables in memory 1 have base numbers of 0-15 (31), and 32-47 (63) in memory 2. The figures in brackets indicate the corresponding numbers if 4Kx8 EPROMs are used in either position.
The channel positions are defined as Left 64, Right 128, and Centre 192. Consequently, in order to select the first waveform in memory 2 and the right-hand sound channel, a value of 160 (32+128) is written to the address of the required oscillator. Figure 3 summarises the relevant data to obtain this information for the required combination. Two bytes are required to define frequency and a suitable formula will be given later.
Waveforms are loaded in 128 byte single-table streams. The Control Register is first set to Low Auxiliary by writing 8 (9, 10 or 11) to address 128, and the waveform table base number is then written to address zero. The Control Register is next set to waveform transfer by writing 32 (33, 34 or 35) to address 128. The stream of table data is then written to address 0 to 127 in the PDSG. A routine can be used to load a waveform set by repeating all the above steps for each table.
For programming, the bus is split into two parts, and although the Low Auxiliary Control position was used in the write mode to direct waveform table transfer, the Low Auxiliary bus is actually read only. 32 addresses (0-31) are available on the eight-bit bus, which allows reading of up to 256 switches with suitable decoding. The 61-note keyboard adopted has two pole switches, using bit 4 of the address to define which pole is being scanned. Addresses 0 to 7 therefore scan the up position of the eight blocks of keys, with the top key (number 61 on the keyboard) being treated as number 63 in the scan, and the footswitches as numbers 1 and 2; addresses 16 to 23 scan the corresponding down position of the key blocks. Addresses 8 to 15 and 24 to 31 may be used for additional input devices, but in hardware terms, it should be noted that bit 4 is actually inverted. To scan the keyboard the Control Register is set to Low Auxiliary by writing 8 (9, 10 or 11) to address 128 and then reading from the required address between 0 and 31.
Unless High Auxiliary is selected in the Control Register, bit 5 of the bus remains at level 0 and is used as a device select level, ie. high for peripheral devices (other than the keyboard) which may be connected to the bus. In High Auxiliary mode, bit 4 should always be fed with zero from the software, and in the bus it will appear as a negative Write Enable pulse. The High Auxiliary bus is operated by writing 16 (17, 18 or 19) to address 128 and then reading or writing addresses 0-15.
Control Register | |
| Waveform Transfer | 32 |
| Auxiliary Bus High | 16 |
| Auxiliary Bus Low | 8 |
| Load Music Registers | 4 |
| Enable Interrupt | 2 |
| Enable Sound Output | 1 |
Write to Address 128 | |
| Disable PDSG | 0 |
| Music Load | 4-7 |
| Wave Number | 8-11 |
| Wave Transfer | 32-35 |
| Keyboard Read | 8-11 |
| High Auxiliary | 16-19 |
| Oscillator | Level Register | Waveform & Channel | Frequency Low | Frequency High |
| 0 | 0 | 63 | 126 | 127 |
| 1 | 2 | 1 | 64 | 65 |
| 2 | 4 | 3 | 66 | 67 |
| 3 | 6 | 5 | 68 | 69 |
| 4 | 8 | 7 | 70 | 71 |
| 5 | 10 | 9 | 72 | 73 |
| 6 | 12 | 11 | 74 | 75 |
| 7 | 14 | 13 | 76 | 77 |
| 8 | 16 | 15 | 78 | 79 |
| 9 | 18 | 17 | 80 | 81 |
| 10 | 20 | 19 | 82 | 83 |
| 11 | 22 | 21 | 84 | 85 |
| 12 | 24 | 23 | 86 | 87 |
| 13 | 26 | 25 | 88 | 89 |
| 14 | 28 | 27 | 90 | 91 |
| 15 | 30 | 29 | 92 | 93 |
| 16 | 32 | 31 | 94 | 95 |
| 17 | 34 | 33 | 96 | 97 |
| 18 | 36 | 35 | 98 | 99 |
| 19 | 38 | 37 | 100 | 101 |
| 20 | 40 | 39 | 102 | 103 |
| 21 | 42 | 41 | 104 | 105 |
| 22 | 44 | 43 | 106 | 107 |
| 23 | 46 | 45 | 108 | 109 |
| 24 | 48 | 47 | 110 | 111 |
| 25 | 50 | 49 | 112 | 113 |
| 26 | 52 | 51 | 114 | 115 |
| 27 | 54 | 53 | 116 | 117 |
| 28 | 56 | 55 | 118 | 119 |
| 29 | 58 | 57 | 120 | 121 |
| 30 | 60 | 59 | 122 | 123 |
| 31 | 62 | 61 | 124 | 125 |
| Memory 1 | 0-15 |
| Memory 2 | 32-47 |
| Left | 64 |
| Right | 128 |
| Centre | 192 |
Read the next part in this series:
All parts in this series:
Modify Your "Phlanger" - for Lower Noise |
Amiga Notes |
PC Notes |
Using Microprocessors (Part 1) |
New ROMantics - The MT guide to CD-ROM |
Software Support - Hints, Tips & News From The World Of Music Software |
Workbench - Signal Processors - Frequency Response Modification |
ST Notes |
ICs for Electro-Music (Part 1) |
Studio Project - Going Direct |
The Musical Micro - Take It From The Top |
PC Notes |
Browse by Topic:
Computer Musician
Topic:
Series:
Part 1 | Part 2 | Part 3 (Viewing) | Part 4 | Part 5
Feature by Alan Boothman
mu:zines is the result of thousands of hours of effort, and will require many thousands more going forward to reach our goals of getting all this content online.
If you value this resource, you can support this project - it really helps!
New issues that have been donated or scanned for us this month.
All donations and support are gratefully appreciated - thank you.
Do you have any of these magazine issues?
If so, and you can donate, lend or scan them to help complete our archive, please get in touch via the Contribute page - thanks!