Here are some measured timings for the SP0256-AL2 speech chip. Mainly here to confirm and understand how it works. All timings were measured by gerald, on a Amstrad SSA-1 with 3.12MHz ceramic resonator.
PWM Output
This image shows the PWM output. The PWM is clocked at 3.12MHz/2 (so one step is circa 630..640 µs).
- Normally, 7bit PWM should consist of one "packet" with 128 steps. However, this seems to be broken down to four "quarter-packets" with 32 steps. This technique reduces the PWM noise from 10kHz to in-audible 40kHz.
- The image shows one such "quarter-packet" with 32 steps (actually 33 steps, not sure why, so let's ignore that). Additionally, there are some dummy steps with constant LOW level inserted between each quarter-packet, making each quarter 39 steps long. This is done to achieve a sample rate of 10kHz (a full packet is 156 = 4*39 steps, so sample rate is 3.12MHz/2/156 = 10kHz).
- For whatever reason, the quarter packets aren't always 39 steps long, instead, they vary from 38 to 40 steps. Anyways, better let's ignore that, too.
LRQ / SBY Timings
This table shows timings when sending an allophone number to the chip (by sending ALD=LOW) while the chip was in standby mode:
Timing min avg max ALDn falling to LDQn rising 180ns 187ns 190ns ALDn falling to SBY falling 200ns 204ns 210ns LRQn high duration 15940ns 24203ns 41600ns SBY low duration (....allophone length....)
- From the Z80 perspective, the stuff with 180..210ns timings reacts immediately.
- However, the LRQ high duration of 15..41us is visible to the Z80 (though any existing and any well programmed Z80 software should not RELY on the presence of this delay) (it should of course be able DEAL with it, ie. it should not send new allophones while LRQ is high).
- Theoretically, in standby state, the chip could process incoming data immediately, so LRQ wouldn't need to go HIGH at all. The fact that it does go HIGH may have two reasons: First, the chip may be unable to react immediately. Second, it may be done intentionally, for use with edge-triggered IRQ or DMA hardware.
Allophone Lengths
This table shows the allophone lengths in milliseconds.
- spec = Timings from original datasheets (these values are totally wrong)
- calc = Timings calculated from 10kHz sample rate and the pitch/repeat values in the -AL2 ROM
- min/avg/max = Timings measured on real hardware (Amstrad SSA-1)
The min/avg/max values are slightly higher than the calculated values. This is probably because the SP0256 executes "NOPs" (with repeat=1 and pitch=unchanged) while in standby mode, and refuses to start a new allophone until it has finished the "NOP".
num name spec calc min avg max 00 PA1 10.0 6.4 6.66 10.05 12.80 01 PA2 30.0 25.6 26.71 31.33 32.37 02 PA3 50.0 44.8 46.05 50.12 51.39 03 PA4 100.0 96.0 97.81 101.72 103.24 04 PA5 200.0 198.4 200.50 204.11 206.69 05 /OY/ 420.0 291.2 293.06 297.24 299.12 06 /AY/ 260.0 172.9 174.81 175.98 176.96 07 /EH/ 70.0 54.6 56.32 57.05 57.94 08 /KK3/ 120.0 76.8 78.82 79.89 81.05 09 /PP/ 210.0 147.2 148.91 153.20 155.04 0A /JH/ 140.0 98.4 99.15 103.24 105.45 0B /NN1/ 140.0 172.9 174.89 175.81 176.92 0C /IH/ 70.0 45.5 46.80 47.73 48.38 0D /TT2/ 140.0 96.0 98.85 99.47 100.29 0E /RR1/ 170.0 127.4 128.37 132.63 134.44 0F /AX/ 70.0 54.6 55.55 57.01 57.97 10 /MM/ 180.0 182.0 184.14 185.08 186.15 11 /TT1/ 100.0 76.8 78.47 79.92 80.93 12 /DH1/ 290.0 136.5 137.33 141.89 143.54 13 /IY/ 250.0 172.9 174.31 175.74 176.46 14 /EY/ 280.0 200.2 201.75 202.85 203.69 15 /DD1/ 70.0 45.5 46.95 48.12 49.14 16 /UW1/ 100.0 63.7 65.20 66.21 66.78 17 /AO/ 100.0 72.8 74.09 75.46 76.50 18 /AA/ 100.0 63.7 64.51 65.72 67.49 19 /YY2/ 180.0 127.4 128.82 129.93 131.25 1A /AE/ 120.0 81.9 83.35 84.44 85.51 1B /HH1/ 130.0 89.6 91.78 92.79 93.78 1C /BB1/ 80.0 36.4 37.44 41.30 43.08 1D /TH/ 180.0 128.0 130.04 130.96 131.91 1E /UH/ 100.0 72.8 73.53 77.48 79.34 1F /UW2/ 260.0 172.9 174.95 175.91 176.66 20 /AW/ 370.0 254.8 256.68 258.09 259.14 21 /DD2/ 160.0 72.1 73.42 74.94 76.17 22 /GG3/ 140.0 110.5 111.86 113.73 114.78 23 /VV/ 190.0 127.4 128.55 130.10 131.48 24 /GG1/ 80.0 72.1 73.55 75.05 75.85 25 /SH/ 160.0 198.4 201.15 202.43 203.59 26 /ZH/ 190.0 134.1 135.23 139.72 141.61 27 /RR2/ 120.0 81.9 82.45 87.02 88.53 28 /FF/ 150.0 108.8 111.12 112.07 113.32 29 /KK2/ 190.0 134.4 136.08 140.64 142.21 2A /KK1/ 160.0 115.2 116.63 121.24 122.82 2B /ZZ/ 210.0 148.6 149.79 153.20 155.85 2C /NG/ 220.0 200.2 202.19 203.01 204.00 2D /LL/ 110.0 81.9 82.75 84.16 85.52 2E /WW/ 180.0 145.6 147.85 148.41 149.52 2F /XR/ 360.0 245.7 247.67 248.61 249.59 30 /WH/ 200.0 145.2 147.29 148.30 149.80 31 /YY1/ 130.0 91.0 92.79 94.04 94.87 32 /CH/ 190.0 147.2 149.15 150.62 151.77 33 /ER1/ 160.0 109.2 109.87 114.27 116.10 34 /ER2/ 300.0 209.3 211.77 212.71 213.70 35 /OW/ 240.0 172.9 174.74 176.24 177.05 36 /DH2/ 240.0 182.0 183.81 184.58 185.83 37 /SS/ 90.0 64.0 65.48 66.66 67.66 38 /NN2/ 190.0 136.5 141.65 142.48 143.68 39 /HH2/ 180.0 126.0 128.30 128.99 130.16 3A /OR/ 330.0 236.6 238.56 240.04 241.20 3B /AR/ 290.0 200.2 202.69 203.70 204.72 3C /YR/ 350.0 245.7 247.68 249.01 250.33 3D /GG2/ 40.0 69.4 71.15 71.96 73.17 3E /EL/ 190.0 136.5 138.22 139.21 140.52 3F /BB2/ 50.0 50.2 51.92 53.17 54.10