Difference between revisions of "MSM5205"

From Archaic Pixels
Jump to: navigation, search
 
Line 1: Line 1:
PAGE RECOVERY
+
Datasheet: [[File:MSM5205.pdf]]
  
datasheet for Msm5205: [[File:MSM5205.pdf]]
+
= Overview =
  
== overview ==
+
The ADPCM playback hardware consists of the following components:
The ADPCM playback hardware consists of the following:
+
* ASIC NEC gate array containing ADPCM control logic OKI
+
* MSM5205 ADPCM decoder (1 channel)
+
* two M41464 DRAMs 64Kx4 for sample storage
+
  
MSM5205 pin assignments
+
* ASIC (NEC gate array) containing ADPCM control logic.
 +
* Oki MSM5205 ADPCM decoder (1 channel).
 +
* Two M41464 DRAMs (64Kx4) for sample storage.
  
comes in an 18-pin plastic dip with OKI M5205 stamped on it
+
 
 +
= MSM5205 pin assignments =
 +
 
 +
The MSM5205 comes in an 18-pin plastic DIP with "OKI M5205" stamped on it.
  
 
[code]
 
[code]
        +---+--+---+
+
      +----v----+
      S1 |1  +--+ 18| Vdd
+
    S1 |01    18| Vdd
      S2 |2      17| /XT
+
    S2 |02    17| /XT
4B / /3B |3      16| XT
+
4B//3B |03    16| XT
      D0 |4      15| RESET
+
    D0 |04    15| RESET
      D1 |5 M5205 14| /VCK
+
    D1 |05    14| /VCK
      D2 |6      13| T2
+
    D2 |06    13| T2
      D3 |7      12| T1
+
    D3 |07    12| T1
      NC |8      11| NC
+
(N.C.) |08    11| (N.C.)
    Vss |9      10| DAout
+
  Vss |09    10| DAOUT
        +----------+
+
      +---------+
 
[/code]
 
[/code]
  
 +
* S1 : Sample rate select input (1/2).
 +
* S2 : Sample rate select input (2/2).
 +
* 4B//3B: ADPCM data size. (0= 3-bit samples; set D0=GND, 1= 4-bit samples)
 +
* D3-D0 : ADPCM data input.
 +
* XT, /XT : Clock input, typically a 384 KHz ceramic resonator. If using an external oscillator, connect it to XT and leave /XT unconnected.
 +
* /VCK : Output strobe that is triggered at the sample rate, used to latch D0-D3.
 +
* RESET : Hold HIGH for at least two /VCK pulses to reset the chip.
 +
* T1, T2 : Test mode pins (set T1=GND, T2= N.C.)
 +
* DAOUT : Analog output from internal DAC. 5Vp-p @ Vdd=+5V.
  
s1 sample rate select input 1 2
 
s2 sample rate select input 2 2
 
4b 3b adpcm data size 0 3-bit samples; set d0 gnd 1 4-bit samples d3-d0 adpcm data input xt xt clock input typically a 384 khz ceramic resonator if using an external oscillator connect it to xt and leave xt unconnected vck output strobe that is triggered at the sample rate used to latch d0-d3 reset hold high for at least two vck pulses to reset the chip t1 t2 test mode pins set t1 gnd t2 n c daout analog output from internal dac 5vp-p vdd 5v sample rate selection s1 s2 0 0 xt 96 0 1 xt 64 1 0 xt 48 1 1 not documented for a 384 khz clock source these are 4 6 and 8 khz respectively msm5205 configuration msm5205 configuration msm5205 configuration 4b 3b tied to 5v 4-bit sample format selected s1 tied to 5v s2 tied to gnd internal clock divider set to 48 test mode pins are not used asic drives xt reset and inputs vck xt is not used dram configuration dram configuration dram configuration the cpu interface to adpcm ram looks like a 64kx8 array however to the chip it is a 128kx4 array and samples can start on any nibble boundary the sample length is always specified in byte two-sample units
 
  
== msm5205 timing ==
+
Sample rate selection:
 +
[code]
 +
S1 S2
 +
0  0 : XT / 96
 +
0  1 : XT / 64
 +
1  0 : XT / 48
 +
1  1 : (Not documented)
 +
[/code]
 +
For a 384 KHz clock source, these are 4, 6, and 8 KHz respectively.
  
typically the msm5205 is used with a 384 khz resonator and a divider of 48 provides an effective sample rate of exactly 8 000 hz however the pce implementation provides a programmable clock effectively over- or underclocking the chip to allow more sample rates to be selected the asic divides a 1 540 200 mhz clock to provide the clock signal fed to the msm5205 xt pin the divider is set by writing to the lower 4 bits of
+
= MSM5205 configuration =
  
divider xt frequency sample rate xt
+
* 4B//3B tied to +5V (4-bit sample format selected)
48 00 16 96 270 hz
+
* S1 tied to +5V, S2 tied to GND (internal clock divider set to 48)
2 005 46875 hz
+
* Test mode pins are not used
01 15 102 680hz
+
* ASIC drives XT, /RESET, and inputs /VCK. /XT is not used.
2 139 166667 hz
+
02 14 110 020 hz
+
2 292 083333 hz
+
03 13 118 480 hz
+
2 468 333333 hz
+
04 12 128 350 hz
+
2 673 958333 hz
+
05 11 140 020 hz
+
2 917 083333 hz
+
06 10 154 020 hz
+
3 208 75 hz
+
07 9 171 140 hz
+
3 565 416667 hz
+
08 8 192 530 hz
+
4 010 8375 hz
+
09 7 220 030 hz
+
4 583 958333 hz
+
0a 6 256 700 hz
+
5 347 916667 hz
+
0b 5 308 050 hz
+
6 417 708333 hz
+
0c 4 385 050 hz
+
8 021 875 hz
+
0d 3 513 400 hz
+
10 695 8 hz
+
0e 2 770 100 hz
+
16 043 75 hz
+
0f 1 1 540 200 hz
+
32 087 5 hz
+
  
to determine how much playback time you get for each sample rate divide the total number of samples that can be contained in ram samples by the sample rate to get the playback time in seconds.
+
= DRAM configuration =
note: according to the turboduo schematics there is a 21 MHz ceramic resonator connected to the ASIC assuming it is divided by 6 before being adjusted by that gives the base frequency of 1.535 MHz for ADPCM decoding.
+
 
 +
The CPU interface to ADPCM RAM looks like a 64Kx8 array. However to the chip it is a 128Kx4 array, and samples can start on any nibble boundary. The sample length is always specified in byte (two-sample) units.
 +
 
 +
= MSM5205 timing =
 +
 
 +
Typically the MSM5205 is used with a 384 KHz resonator, and a divider of 48 provides an effective sample rate of exactly 8,000 Hz. However, the PCE implementation provides a programmable clock (effectively over- or underclocking the chip) to allow more sample rates to be selected.
 +
 
 +
The ASIC divides a 1.540,200 MHz clock to provide the clock signal fed to the MSM5205 XT pin. The divider is set by writing to the lower 4 bits of $180E:
 +
[code]
 +
$180E  Divider    XT frequency  Sample rate (XT/48)
 +
 
 +
$00    16        96,270 Hz    2,005.46875 Hz
 +
$01    15        102,680 Hz    2,139.166667 Hz
 +
$02    14        110,020 Hz    2,292.083333 Hz
 +
$03    13        118,480 Hz    2,468.333333 Hz
 +
$04    12        128,350 Hz    2,673.958333 Hz
 +
$05    11        140,020 Hz    2,917.083333 Hz
 +
$06    10        154,020 Hz    3,208.75 Hz
 +
$07    9        171,140 Hz    3,565.416667 Hz
 +
$08    8        192,530 Hz    4,010.8375 Hz
 +
$09    7        220,030 Hz    4,583.958333 Hz
 +
$0A    6        256,700 Hz    5,347.916667 Hz
 +
$0B    5        308,050 Hz    6,417.708333 Hz
 +
$0C    4        385,050 Hz    8,021.875 Hz
 +
$0D    3        513,400 Hz    10,695.8 Hz
 +
$0E    2        770,100 Hz    16,043.75 Hz
 +
$0F    1      1,540,200 Hz    32,087.5 Hz
 +
[/code]
 +
 
 +
To determine how much playback time you get for each sample rate, divide the total number of samples that can be contained in RAM (131,072 samples) by the sample rate to get the playback time in seconds.
 +
 
 +
Note: According to the TurboDuo schematics there is a 9.21 MHz ceramic resonator connected to the ASIC. Assuming it is divided by 6 before being adjusted by $180E, that gives the base frequency of 1.535 MHz for ADPCM decoding. My measurements were at the XT pin, and seem to be close enough.
 +
 
 +
= ADPCM format =
 +
 
 +
The Oki ADPCM format is identical to the Intel/Dialogic VOX format. The 'Sound eXchange' utility ('sox') supports this format and the non-standard sample rates the PCE uses.
 +
 
 +
The VOX format has no header or other information to specify the sample rate, so that must be explictly stated during conversion. Some examples are as follows:
 +
[code]
 +
; Convert 8 KHz ADPCM data to WAV file
 +
sox -r 8000 test.vox test.wav
 +
 
 +
; Convert WAV file to 32 KHz ADPCM data
 +
sox music.wav -r 32000 music.vox
 +
[/code]
  
my measurements were at the xt pin and seem to be close enough adpcm format adpcm format adpcm format the oki adpcm format is identical to the intel dialogic vox format the \'sound exchange\' utility \'sox\' supports this format and the non-standard sample rates the pce uses the vox format has no header or other information to specify the sample rate so that must be explictly stated during conversion some examples are as follows ; convert 8 khz adpcm data to wav file sox -r 8000 test vox test wav ; convert wav file to 32 khz adpcm data sox music wav -r 32000 music vox the resulting headerloss vox file can be directly included into a program as binary data and stored to adpcm ram for playback links links links sound exchange category pc engine
+
The resulting headerless VOX file can be directly included into a program as binary data and stored to ADPCM RAM for playback.

Latest revision as of 09:56, 2 May 2014

Datasheet: File:MSM5205.pdf

Overview

The ADPCM playback hardware consists of the following components:

  • ASIC (NEC gate array) containing ADPCM control logic.
  • Oki MSM5205 ADPCM decoder (1 channel).
  • Two M41464 DRAMs (64Kx4) for sample storage.


MSM5205 pin assignments

The MSM5205 comes in an 18-pin plastic DIP with "OKI M5205" stamped on it.

       +----v----+
    S1 |01     18| Vdd
    S2 |02     17| /XT
4B//3B |03     16| XT
    D0 |04     15| RESET
    D1 |05     14| /VCK
    D2 |06     13| T2
    D3 |07     12| T1
(N.C.) |08     11| (N.C.)
   Vss |09     10| DAOUT
       +---------+

  • S1 : Sample rate select input (1/2).
  • S2 : Sample rate select input (2/2).
  • 4B//3B: ADPCM data size. (0= 3-bit samples; set D0=GND, 1= 4-bit samples)
  • D3-D0 : ADPCM data input.
  • XT, /XT : Clock input, typically a 384 KHz ceramic resonator. If using an external oscillator, connect it to XT and leave /XT unconnected.
  • /VCK : Output strobe that is triggered at the sample rate, used to latch D0-D3.
  • RESET : Hold HIGH for at least two /VCK pulses to reset the chip.
  • T1, T2 : Test mode pins (set T1=GND, T2= N.C.)
  • DAOUT : Analog output from internal DAC. 5Vp-p @ Vdd=+5V.


Sample rate selection:

S1 S2
 0  0 : XT / 96
 0  1 : XT / 64
 1  0 : XT / 48
 1  1 : (Not documented)
For a 384 KHz clock source, these are 4, 6, and 8 KHz respectively.

MSM5205 configuration

  • 4B//3B tied to +5V (4-bit sample format selected)
  • S1 tied to +5V, S2 tied to GND (internal clock divider set to 48)
  • Test mode pins are not used
  • ASIC drives XT, /RESET, and inputs /VCK. /XT is not used.

DRAM configuration

The CPU interface to ADPCM RAM looks like a 64Kx8 array. However to the chip it is a 128Kx4 array, and samples can start on any nibble boundary. The sample length is always specified in byte (two-sample) units.

MSM5205 timing

Typically the MSM5205 is used with a 384 KHz resonator, and a divider of 48 provides an effective sample rate of exactly 8,000 Hz. However, the PCE implementation provides a programmable clock (effectively over- or underclocking the chip) to allow more sample rates to be selected.

The ASIC divides a 1.540,200 MHz clock to provide the clock signal fed to the MSM5205 XT pin. The divider is set by writing to the lower 4 bits of $180E:

$180E   Divider    XT frequency  Sample rate (XT/48)

$00     16         96,270 Hz     2,005.46875 Hz
$01     15        102,680 Hz     2,139.166667 Hz
$02     14        110,020 Hz     2,292.083333 Hz
$03     13        118,480 Hz     2,468.333333 Hz
$04     12        128,350 Hz     2,673.958333 Hz
$05     11        140,020 Hz     2,917.083333 Hz
$06     10        154,020 Hz     3,208.75 Hz
$07     9         171,140 Hz     3,565.416667 Hz
$08     8         192,530 Hz     4,010.8375 Hz
$09     7         220,030 Hz     4,583.958333 Hz
$0A     6         256,700 Hz     5,347.916667 Hz
$0B     5         308,050 Hz     6,417.708333 Hz
$0C     4         385,050 Hz     8,021.875 Hz
$0D     3         513,400 Hz    10,695.8 Hz
$0E     2         770,100 Hz    16,043.75 Hz
$0F     1       1,540,200 Hz    32,087.5 Hz

To determine how much playback time you get for each sample rate, divide the total number of samples that can be contained in RAM (131,072 samples) by the sample rate to get the playback time in seconds.

Note: According to the TurboDuo schematics there is a 9.21 MHz ceramic resonator connected to the ASIC. Assuming it is divided by 6 before being adjusted by $180E, that gives the base frequency of 1.535 MHz for ADPCM decoding. My measurements were at the XT pin, and seem to be close enough.

ADPCM format

The Oki ADPCM format is identical to the Intel/Dialogic VOX format. The 'Sound eXchange' utility ('sox') supports this format and the non-standard sample rates the PCE uses.

The VOX format has no header or other information to specify the sample rate, so that must be explictly stated during conversion. Some examples are as follows:

; Convert 8 KHz ADPCM data to WAV file
sox -r 8000 test.vox test.wav

; Convert WAV file to 32 KHz ADPCM data
sox music.wav -r 32000 music.vox

The resulting headerless VOX file can be directly included into a program as binary data and stored to ADPCM RAM for playback.