News Team Current issue History Online Support Download Forum @Pouet

01 - 02 - SE - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 - 11 - 12 - 13 - 14

Alive 6
[ Back to Main ]

5. The National LMC 1992 and the Microwire

  There's a little, but common mistake of minor importance when it
  comes to this combo that allows manipulation of the DMA sound to
  enhance trebble and bass as well as left, right and main volume.
  It is not the Microwire interface that manipulates the sound, it
  is a chip named National LMC 1992.
  This chip however has not been integrated into the Atari STE
  hardware directly but can only be communicated with using a 3-bit
  serial interface, the so-called Microwire.
  It is a bit hard to handle for a beginner, but luckily, it is also
  hard to crash the STE using this register.
  And since the Microwire can basically connect more than just one
  device, it needs a 2 bit address to which device to transfer data
  to. The LMC1992 is at "address" 2 (binary 10). Each address-data-pack
  written to the LMC1992 therefore consists of an 11 bit package.
  The communication is a bit similar to communicating with the YM2149
  since the Microwire also requires to encode data in a certain way.

National LMC 1992
  Adress and Data register
    $FFFF8922  x x x x  x x x x  x x x x  x x x x

    This address is being used to feed the National LMC both
    address and data bits for a certain setting.
    The choice which bits are being read are being described
    in the mask register at $FFFF8924.
    As described above, the first two bits of the 11 bit
    package need to be a "10" to address the LMC1992.
    Then there are 3 more "address" and 6 more data bits.
    The address bits are 3 in total and are being used as
      0 1 1  -  Master Volume (followed by 6 bits of data)
      1 0 1  -  Left channel volume (followed by 6 bits of data)
      1 0 0  -  Right channel volume (followed by 6 bits of data)
      0 1 0  -  Trebble control (followed by 6 bits of data)
      0 0 1  -  Bass control (followed by 6 bits of data)
      0 0 0  -  Mixer (followed by 6 bits of data).

    However, not all bits of the 6 general data bits are being
    used. It is necessary to have a multiple of 6 though since
    the Microwire is a 3-bit serial interface.
    The explanation of the 6 data bits are
      (d means necessary data bit, x means bit is ignored)

      Master Volume: d d d  d d d  (all 6 bits used)
                     0 0 0  0 0 0  = -80 db volume
                     0 1 0  1 0 0  = -40 db volume
                     1 0 1  x x x  =   0 db volume (max)
      Each increment represents 2 db. If the 3 left bit encode "101",
      the last 3 bits are being ignored.

      Left channel:  x d d  d d d  (left bit ignored)
                       0 0  0 0 0  = -40 db volume
                       0 1  0 1 0  = -20 db volume
                       1 0  1 x x  =   0 db volume (max)
      Each increment represents 2 db. If the 3 left bit carry "101",
      the last 2 bits are being ignored.

      Right channel: x d d  d d d  (left bit ignored)
                       0 0  0 0 0  = -40 db volume
                       0 1  0 1 0  = -20 db volume
                       1 0  1 x x  =   0 db volume (max)
      Each increment represents 2 db. If the left 3 bit are "101",
      the last 2 bits are being ignored.

      Trebble:       x x d  d d d  (left 2 bits are ignored)
                         0  0 0 0  = -12 db (min)
                         0  1 1 0  =   0 db (linear)
                         1  1 0 0  =  12 db (max)
      Each increment represents 2 db, normalized at 15 KHz.

      Bass:          x x d  d d d  (left 2 bits are ignored)
                         0  0 0 0  = -12 db (min)
                         0  1 1 0  =   0 db (linear)
                         1  1 0 0  =  12 db (max)
      Each increment represents 2 db, normalized at 50 Hz.

      Mixer control: x x x  x d d  (left 4 bits are ignored)
                              0 0  = DMA + (YM2149 - 12 db)
                              0 1  = DMA + YM2149
                              1 0  = DMA only
                              1 1  = reserved
     Setting "00" mixes the output of the YM2149 and the output
     of the DMA-sound, but the YM2149 sound is being downsized by
     12 db. "01" mixes DMA and YM2149 linearly, "00" means DMA
     sound output only.

  Mask Register
    $FFFF8924  x x x x  x x x x  x x x x  x x x x

    This contains in a bitfield which bits of the Address+Data
    Register are explicetely used. Since the Microwire, as it
    is being used in the STE, requires 11 bits of data (in general,
    the Microwire can transport 14 bits), it is essential to let
    the Microwire know WHICH of the 16 bits of this register are
    to be taken into account.
    As being used in the STE, this register will always feature
    11 "1"s and 5 "0"s.

    Let's say we want to feed the LMC the data "011101000",
    we would need to write a "10 011101000" to the address+data
    register. We can use whatever bits we like of the 16 bits
    of this register, so we use the mask register to mask out
    the unused bits, which might look like:
      $FFFF8924  0 0 0 0  0 1 1 1  1 1 1 1  1 1 1 1
      $FFFF8922  0 0 0 0  0 1 0 0  1 1 1 0  1 0 0 0
      $FFFF8924  0 1 1 0  0 1 1 1  1 1 1 0  1 1 0 1
      $FFFF8922  0 1 0 0  0 0 1 1  1 0 1 0  0 0 0 0
    both have the same effect.

Sounds complicated enough but can boost the DMA-sound output of
the STE quite a lot. When programming it first time however you
might easily see that it did not work as planned. Why ?

? Can't hear any changes on my Falcon ...
! Unfortunately, the Falcon does neither have a Microwire interface
  nor the National Semiconductors LMC1992. The Falcon cannot
  manipulate bass, treble, main, left and right volume as easily as
  the STE can. The Falcon will not report an error either though.
  The TT does have the Microwire interface as well as the LMC1992.

? I write both address+data and the mask register correctly, still
  it doesn't have the expected effect.
! You need to write the mask before you write address and data.
  As soon as address+data register has been written to, the
  Microwire starts to operate (which means shifting to the left).
  Writing the mask register after writing the address+data register
  is therefore useless.

? I write data into the mask-register, then address and data but
  it still doesn't do what i wanted to.
! Always make sure you have a total of "11" bits, and always
  make sure, the leading bits on the left side are a "10".
  Otherwise, the Microwire will try to access other peripherals
  that the STE does not have - which will not lead to an error,
  but result in no changes at all.

? I tried to achieve sound manipulation effects by writing a lot
  of values to the LMC1992 to change DMA sound output. It does
  seem to ignore a lot of my values.
! The LMC1992 is connected to the Microwire and is being fed
  data in a serial way. The Microwire is more or less a parallel
  to serial converter and it does that by shifting the 16 bit
  value (along with the mask) to the left 16 times and passing
  each bit for that the mask-bit is "1" to the LMC.
  That takes some time and during its operational state, the
  Microwire cannot be written to.

? How can i find out wether the Microwire interface is done ?
! Simply check the value in the address+data register after you
  wrote your value into it. If the value at $FFFF8922 is identical
  with the value you wrote into it, the Microwire is done shifting
  and can once again be written to. In all other cases, the
  Microwire is still shifting and cannot be written to.

? I successfully wrote to the LMC1992, but now YM2149 sound output
  is pure torture. What happened ?
! Well, the LMC1992 is not a chip that controls the DMA-sound in
  its digital form but manipulates the analogue sound that comes out
  of the DMA chip. If you now put the mixer to mix YM2149 and DMA
  sound, the LMC1992 will also manipulate the YM sound output.
  However, the YM2149 as a soundchip is not really meant to have
  Bass and Trebble enhanced. This might result in a very ugly

? My program works fine and also exits cleanly, but then any
  subsequent sound output is awful. How come ?
! You should save the contents of the LMC1992 right at the
  start of your program and when exiting, you should restore
  the original value - and the easiest way is to save both
  mask and address+data register.
  Restoring can be done by just writing mask and address+data
  registers. The Microwire does not need any further software
  support once you wrote the values, so it does not harm if
  your program terminates in the meantime.
  Programs you launch when your program is terminated that do
  use DMA or YM2149 sound might be affected by your LMC1992
  settings otherwise.

? How come the Falcon does not have this feature ?
! When the Falcon was initially planned (and named Sparrow),
  it had a chip that was supposed to bear similar features
  named RASCAL. It is probable that this chip was supposed to
  "simulate" a Microwire + LMC 1992 duo as well as give
  enhanced possibilites towards the 16-bit stereo sound of
  the Falcon (Sparrow) as well as the DSP.
  Either Atari did not finish this chip in time, it was too
  expensive or too complex, we don't know. It appeared in
  the first Sparrow prototypes as well as the first few
  Falcon (exhibitors) boards. However, it is so far unknown
  wether this chip is compatible to the Microwire+LMC1992 duo
  or not and why it has been canned.

? Why is the handling of the LMC1992 so complicated ?
  Wouldn't there have been an easier way to give the STE these
  features ?
! Yes, of course, but the LMC1992 was very cheap. The LMC1992
  was never meant to serve in a computer but was commonly used
  in TV sets, Radios etc. and any other Audio-device that had
  the option to control volumes, bass and trebble electronically,
  and those preferred a "1-bit serial" implementation.
  The Microwire is just the connection of the STE's architecture
  to the LMC1992.

[ Back to Main ]
[ Onto next Chapter ]

Alive 6