ALS4000A
ALS4000A
Features :
l High performance PCI Digital Audio Subsystem Controller.
l Sound Blaster/Pro/16 Emulation
l MIDI port with input 32 bytes and output 16 bytes FIFO
l Game port interface with fully compatibility with Microsoft SideWinder
l Full-duplex DMA operation
l PCI power management interface
l Hardware power down mode for notebook application.
l Build-In FM compatible synthesizer.
Applications :
l Windows and MPC level 2 compatible audio subsystem.
l PC games.
l Computer based audio reproduction
l Audio on-line tutorial
l Voice annotation or voice E-mail interface.
l Voice recognition or voice command controller.
l Text to speech.
l Karaoke/music sound box.
l MIDI controller.
1
Ver 1.0 at May, 28th, 1998
AD30 I/O 73 PCI Address/Data bit 30 6mA TTL compatible CMOS IO (Vt=1.7V)
AD31 I/O 72 PCI Address/Data bit 31 6mA TTL compatible CMOS IO (Vt=1.7V)
C/BE0 I/O 14 Command/Byte enable bit 0 6mA TTL compatible CMOS IO (Vt=1.7V)
C/BE1 I/O 3 Command/Byte enable bit 1 6mA TTL compatible CMOS IO (Vt=1.7V)
C/BE2 I/O 93 Command/Byte enable bit 2 6mA TTL compatible CMOS IO (Vt=1.7V)
C/BE3 I/O 82 Command/Byte enable bit 3 6mA TTL compatible CMOS IO (Vt=1.7V)
FRAME# I/O 95 PCI Cycle Frame 8mA TTL compatible CMOS IO (Vt=1.7V)
IRDY# I/O 96 PCI Initiator Ready 8mA TTL compatible CMOS IO (Vt=1.7V)
TRDY# I/O 98 PCI Target Ready 8mA TTL compatible CMOS IO (Vt=1.7V)
STOP# I/O 100 PCI Stop 8mA TTL compatible CMOS IO (Vt=1.7V)
IDSEL I 83 PCI Initialization Device Select TTL compatible CMOS input (Vt=1.7V)
DEVSEL# I/O 99 PCI Device Select 8mA TTL compatible CMOS IO (Vt=1.7V)
CLK I 67 PCI System clock(33MHz) TTL compatible CMOS input
RST# I 65 PCI System Reset Schmitt triggered CMOS input (1.4V-2.2V)
PAR O 2 PCI Parity 6mA TTL compatible CMOS output
REQ# O 70 PCI Request 6mA TTL compatible CMOS output
GNT# I 69 PCI Grant TTL compatible CMOS input (Vt=1.7V)
INTA# O 64 PCI Interrupt Request A 6mA open-drain CMOS output
PME# O 71 Power management event 6mA open-drain CMOS output
2
Ver 1.0 at May, 28th, 1998
Power/Ground : 17 pins
Pin Name Type Pin No. Description Characteristic Definition
VDD1 I 7 Digital power 5V
VDD2 I 18 Digital power 5V
VDD3 I 66 Digital power 5V
VDD4 I 75 Digital power 5V
VDD5 I 87 Digital power 5V
VDD6 I 97 Digital power 5V
AVDD1 I 28 Analog power 5V
AVDD2 I 42 Analog power 5V
GND1 I 1 Digital Ground
GND2 I 12 Digital Ground
GND3 I 24 Digital Ground
GND4 I 58 Digital Ground
GND5 I 68 Digital Ground
GND6 I 81 Digital Ground
GND7 I 94 Digital Ground
AGND1 I 37 Analog Ground
AGND2 I 52 Analog Ground
BASE+6h W ESP-RESET-PORT
BASE+6h R CR1E-ACK-PORT
BASE+Ah R ESP-READ-DATA
BASE+Ch W ESP-COMMAND/DATA
BASE+Ch R ESP-WR-STATUS
BASE+Eh R ESP-RD-STATUS8
BASE+Fh R ESP-RD-STATUS16
BASE.9~4 = GCRA9.9~4;
ADLIBBASE.9~3 = GCRA8.9~3;
3
Ver 1.0 at May, 28th, 1998
Gameport :
GAMEBASE+0-1h R GAME-READ
GAMEBASE+0-1h W GAME-WRITE
GAMEBASE.9~3 = GCRA8.25~19;
MPU401:
MPU401BASE.9~3 = GCRA9.25~19;
ALS4000 usually drive GD0~3 to low. When Game-port write command is active, GD0~3 is tri-state
until level on GD0~3 is high again. ALS4000 implement a FLIP-FLOP for GD0~3 respectively, called
FF0~3. FF0~3 are default 1 after system reset. Any Game write operation will set FF0~3 . When level
on GD0~3 reach logic high level, the corresponding FLIP-FLOP will be clear automatically. This
implementation work fine with analog joystick and digital game pad with any detection procedure.
The following are mapping between SD0~7 and GD0~7:
SD7 GD7
SD6 GD6
SD5 GD5
SD4 GD4
SD3 FF3(set/reset controlled by GD3)
SD2 FF2(set/reset controlled by GD2)
SD1 FF1(set/reset controlled by GD1)
SD0 FF0(set/reset controlled by GD0)
GAMEPORT = GAMEBASE+1h
FM synthesizer :
Refer to “ALS120 FM synthesizer specification“
ESP Register Definition:
ESP-RESET-PORT:
Write only
Bit 0 0 normal
1 reset ESP
Bit 7..1 X reserved
ESP-RD-STATUS
Read only
4
Ver 1.0 at May, 28th, 1998
Read ESP-RD-STATUS8 will clear interrupt generated by the ESP for non-BX type DMA.
Read ESP-RD-STATUS16 will clear interrupt for BX type DMA.
After CPU read the data from ESP-READ-DATA port, bit 7 of this read status port will reset to 0 (no
data) until the next read data is available and bit 7 set to 1 (data available).
ESP-READ-DATA
Read only
Bit 7..0 X the data return by ESP
ESP-COMMAND/DATA
Write only
Bit 7..0 X the command or data to ESP
ESP-WR-STATUS:
Read only
After CPU write the command/data to the ESP-COMMAND/DATA port, bit 7 of this write status will
set to 1 (busy) until the ESP processed the written command/data and waiting for the next
command/data by reset bit 7 to 0 (not busy). Any acknowledge byte must be readback before any new
command is issued. ESP will be set busy if any DMA operation is started and will be set not busy if
command port is read twice.
MIDI-STATUS
Read only
MIDI-COMMAND
Write only
In pass-thru mode,
ENTER_UART 03Fh
Return ack byte (0FEh) in midi-data, generate an interrupt if switch to UART mode successfully.
Reading data port will clear the interrupt signal.
5
Ver 1.0 at May, 28th, 1998
MIDI_RESET 0FFh
Return ack byte (0FEh) in midi-data, generate an interrupt, stay in pass-thru mode.
In UART mode,
MIDI_RESET 0FFh
Flush MIDIIN FIFO, wait until MIDIOUT FIFO/MIDI RAM empty, go to pass-thru mode .
MIDI-DATA
Read/write
Read
Bit 7..0 MIDI data input in UART mode or acknowledge byte
Write
Bit 7..0 MIDI data output in UART mode
MIXER-INDEX
Read/write
Bit 7 0 mixer
1 control
MIXER-DATA
Read/write
Any write to this port will reset MX00-MX7F to default value. ESP_RESET() does not affect any of
the mixer register.
Write
Bit 7 X
Bit 6 X
Bit 5 X
Bit 4 X
Bit 3 MX30.7 & MX31.7
Bit 2 MX30.6 & MX31.6
Bit 1 MX30.5 & MX31.5
Bit 0 MX30.4 & MX31.4
Bit 3 MX30.3
6
Ver 1.0 at May, 28th, 1998
Bit 3 MX31.3
Read
Bit 7 MX30.7
Bit 6 MX30.6
Bit 5 MX30.5
Bit 4 MX30.4
Bit 3 MX31.7
Bit 2 MX31.6
Bit 1 MX31.5
Bit 0 MX31.4
0 -45 dB (off)
15 0 dB (maximum volume)
Write
Bit 7 MX32.7
Bit 6 MX32.6
Bit 5 MX32.5
Bit 4 MX32.4
Bit 3 MX33.7
Bit 2 MX33.6
Bit 1 MX33.5
Bit 0 MX33.4
Bit 7 MX32.3
Bit 3 MX33.3
Read
Bit 7 MX32.7
Bit 6 MX32.6
Bit 5 MX32.5
Bit 4 MX32.4
Bit 3 MX33.7
Bit 2 MX33.6
Bit 1 MX33.5
Bit 0 MX33.4
0 -45 dB (off)
15 0 dB (maximum volume)
Write
Bit 7 X
Bit 6 X
Bit 5 X
Bit 4 X
Bit 3 MX34.7 & MX35.7
Bit 2 MX34.6 & MX35.6
7
Ver 1.0 at May, 28th, 1998
Bit 3 MX34.3
Bit 3 MX35.3
Read
Bit 7 MX34.7
Bit 6 MX34.6
Bit 5 MX34.5
Bit 4 MX34.4
Bit 3 MX35.7
Bit 2 MX35.6
Bit 1 MX35.5
Bit 0 MX35.4
0 -45 dB (off)
15 0 dB (maximum volume)
Write
Bit 7 X
Bit 6 X
Bit 5 X
Bit 4 X
Bit 3 MX36.7 & MX37.7
Bit 2 MX36.6 & MX37.6
Bit 1 MX36.5 & MX37.5
Bit 0 MX36.4 & MX37.4
Bit 3 MX36.3
Bit 3 MX37.3
Read
Bit 7 MX36.7
Bit 6 MX36.6
Bit 5 MX36.5
Bit 4 MX36.4
Bit 3 MX37.7
Bit 2 MX37.6
Bit 1 MX37.5
Bit 0 MX37.4
0 -45 dB (off)
15 0 dB (maximum volume)
Write
Bit 7..3 X
Bit 2 MX3A.7
8
Ver 1.0 at May, 28th, 1998
Bit 1 MX3A.6
Bit 0 MX3A.5
Bit 2 MX3A.4
Bit 1 MX3A.3
Read
Bit 7..3 X
Bit 2 MX3A.7
Bit 1 MX3A.6
Bit 0 MX3A.5
0 -42 dB (off)
7 0 dB (maximum volume)
Input filter enable and input filter high/low are dummy read/write bits for Sound Blaster Pro
compatibility.
Input filter high/low: 0 - low filter (3.2 KHz low pass), 1 - high filter (8.8 KHz low pass)
Input source
Bit 2 Bit 1
0 0 microphone (MX3D & MX3E = 1)
0 1 CD-audio (MX3D = 04h, MX3E = 02h)
1 0 microphone (MX3D & MX3E = 1)
1 1 external line-in (MX3D = 10h, MX3E = 08h)
Write to input source will update MX3D and MX3E input mixer left/right control register and 2
dummy bits. Read from input source register will return 2 dummy bits.
Output filter enable is dummy read/write bit for Sound Blaster Pro compatibility.
9
Ver 1.0 at May, 28th, 1998
Write
Bit 7 MX30.7
Bit 6 MX30.6
Bit 5 MX30.5
Bit 4 MX30.4
Bit 3 MX31.7
Bit 2 MX31.6
Bit 1 MX31.5
Bit 0 MX31.4
Bit 7 MX30.3
Bit 3 MX31.3
Read
Bit 7 MX30.7
Bit 6 MX30.6
Bit 5 MX30.5
Bit 4 MX30.4
Bit 3 MX31.7
Bit 2 MX31.6
Bit 1 MX31.5
Bit 0 MX31.4
0 -45 dB (off)
15 0 dB (maximum volume)
Write
Bit 7 MX34.7
Bit 6 MX34.6
Bit 5 MX34.5
Bit 4 MX34.4
Bit 3 MX35.7
Bit 2 MX35.6
Bit 1 MX35.5
Bit 0 MX35.4
Bit 7 MX34.3
Bit 3 MX35.3
Read
Bit 7 MX34.7
Bit 6 MX34.6
Bit 5 MX34.5
Bit 4 MX34.4
Bit 3 MX35.7
10
Ver 1.0 at May, 28th, 1998
Bit 2 MX35.6
Bit 1 MX35.5
Bit 0 MX35.4
0 -45 dB (off)
15 0 dB (maximum volume)
Write
Bit 7 MX36.7
Bit 6 MX36.6
Bit 5 MX36.5
Bit 4 MX36.4
Bit 3 MX37.7
Bit 2 MX37.6
Bit 1 MX37.5
Bit 0 MX37.4
Bit 7 MX36.3
Bit 3 MX37.3
Read
Bit 7 MX36.7
Bit 6 MX36.6
Bit 5 MX36.5
Bit 4 MX36.4
Bit 3 MX37.7
Bit 2 MX37.6
Bit 1 MX37.5
Bit 0 MX37.4
0 -45 dB (off)
15 0 dB (maximum volume)
Write
Bit 7 MX38.7
Bit 6 MX38.6
Bit 5 MX38.5
Bit 4 MX38.4
Bit 3 MX39.7
Bit 2 MX39.6
Bit 1 MX39.5
Bit 0 MX39.4
Bit 7 MX38.3
Bit 3 MX39.3
Read
Bit 7 MX38.7
11
Ver 1.0 at May, 28th, 1998
Bit 6 MX38.6
Bit 5 MX38.5
Bit 4 MX38.4
Bit 3 MX39.7
Bit 2 MX39.6
Bit 1 MX39.5
Bit 0 MX39.4
0 -45 dB (off)
15 0 dB (maximum volume)
0 -46 dB (off)
31 0 dB (maximum volume)
0 -46 dB (off)
31 0 dB (maximum volume)
0 -46 dB (off)
31 0 dB (maximum volume)
0 -46 dB (off)
31 0 dB (maximum volume)
12
Ver 1.0 at May, 28th, 1998
0 -46 dB (off)
31 0 dB (maximum volume)
0 -46 dB (off)
31 0 dB (maximum volume)
0 -46 dB (off)
31 0 dB (maximum volume)
0 -46 dB (off)
31 0 dB (maximum volume)
0 -46 dB (off)
31 0 dB (maximum volume)
0 -46 dB (off)
31 0 dB (maximum volume)
13
Ver 1.0 at May, 28th, 1998
0 -46 dB (off)
31 0 dB (maximum volume)
0 -18 dB (off)
3 0 dB (maximum volume)
0 mute
1 enable audio output
Bit 7 reserved
Bit 6 music left enable
Bit 5 dummy read/write bit
Bit 4 external line left enable
Bit 3 dummy read/write bit
Bit 2 CD-audio left enable
Bit 1 dummy read/write bit
Bit 0 microphone enable
0 mute
1 enable audio input
Bit 7 reserved
Bit 6 dummy read/write bit
Bit 5 music right enable
Bit 4 dummy read/write bit
Bit 3 external line right enable
Bit 2 dummy read/write bit
Bit 1 CD-audio right enable
Bit 0 microphone enable
0 mute
14
Ver 1.0 at May, 28th, 1998
15
Ver 1.0 at May, 28th, 1998
Mono output is the analog sum of left and right channel of the output mixer. It is after output gain
control, before 3D processor.
Mono output should be attenuated by 6dB to prevent clipping. Bit 5 is the output mute control.
16
Ver 1.0 at May, 28th, 1998
MX4F
Read/write
Default 20h
Power up value changeable
Bit 7 CODEC test mode control
1 Test mode ( Primary FIFO → FM D/A, SB A/D → SB D/A
Enable internal Music resistor for test)
0 normal mode
Bit 6 CP Test mode control
1 CP test mode (Enable SBAD/SBDA clock and power)
0 Normal mode
Bit 5 SB D/A 3dB freq control bit (HLDA_d)
1 20KHz
0 8KHz
Bit 4 reserved
Bit3..1 analog test bit
1 disable
0 enable
Bit3 DABLOCK.INTERP (MUINT_d)
Bit2 ADBLOCK.SH (MUSH_d)
Bit1 ADBLOCK.LPF (MULPF_d)
Bit0 reserved
Bit 3 reserved
17
Ver 1.0 at May, 28th, 1998
0000 1.142ms
0001 2.284ms
. .
. .
. .
1111 18.272ms
18
Ver 1.0 at May, 28th, 1998
0 Disable
1 Enable (Disconnect SH/LPF from AD)
Bit 6 LPF clock control
0 Clock running
1 Clock stopped
Bit 5 SH Zero input control
0 Disable
1 Enable (Disconnect LPF from SH)
Bit 4 SB AD/DA clock select
0 FXTALB + DFF
1 FXTALB
Bit 3 CKLP1/CKLP2 exchange control
0 CLKP1↔CKINT2, CLKP2↔CKINT1
1 CLKP1↔CKINT1, CLKP2↔CKINT2
Bit 2 SH clock control
0 Clock running
1 Clock stopped
Bit 1,0 Reserved
Write
If subsequent access odd times (i.e, 1st, 3rd, 5th...)
Bit 7..0 input pattern high byte to 3-D delay-line
If subsequent access even times (i.e, 2nd, 4th, 6th...)
Bit 7..4 input pattern low byte to 3-D delay-line (4 bits only)
Bit 3..0 reserved
After writing a whole pattern (12 bits), a pulse would be generated to shift the delay-line.
After each accessing to pattern register, the internal H/L byte pointer will toggle automatically.
After power on reset, the internal H/L byte pointer points to high byte.
0: disable interrupt
1: enable interrupt
19
Ver 1.0 at May, 28th, 1998
Read
Write if CR0.7=1
Default 00h
0: disable DMA
1: enable DMA
Change this register will set GCR99.26~24 with the correct value.
0 : no interrupt
1 : interrupt triggered
CR2 MISC.control
Default 00h
Read/write
20
Ver 1.0 at May, 28th, 1998
CR3 configuration
Default 03h
Bit 7 r/w digital loop back test enable
Bit 6..2 reserved
Bit 1,0 chip version number (read as 11)
Bit 1 Bit 0
0 0 ALS007SP
0 1 ALS100
1 0 ALS007/WTA2000
1 1 ALS200/ALS110//ALS4000/ALS120
The output of primary PCM FIFO can directly feed back as the input to the secondary PCM FIFO
instead of the Sound Blaster A/D converter. This implement PCM FIFO digital loop back test. This
mode is disabled at default. The operation of secondary PCM FIFO is fully controlled by CR1E register.
CR3.7 just selects the input source of secondary PCM FIFO.
During full duplex running mode, if the secondary PCM FIFO is full when new sample arrives, bit 7
will be set.
Any time during DMA playback, if the primary FIFO is empty when new sample is needed, bit 5 will
be set.
Any time midi output FIFO is full, bit 4 will be set.
Any time a new midi input data is received and the midi input FIFO is full, bit 3 will be set.
Reading this register will clear all flags(ie. Bit 7-3).
Bit 2-0 are sticky, that is, hardware will not clear them automatically and it is needed for software to
clear the bits.
21
Ver 1.0 at May, 28th, 1998
Bit 4 X reserved
When midi is in pass-thru mode, midi clock is stopped. Internal midiin is tied high and external
midiout is connected to external midiin pad.
In MPU-401 UART mode, the internal midiin input, the external midiout output and the midi clock are
controlled by CR1A.7-5 bits.
In midi loop back mode, when midiin FIFO is full, midi clock will be stop until midiin is not full.
This will avoid midi FIFO overrun.
Only CR1E can control the secondary PCM FIFO. To avoid conflict, when both PCM FIFO will be
active, these two FIFO should run under the same sample frequency. The secondary PCM FIFO is for
recording only. SB AD and input mixer power line controlled by CR1E.7.
22
Ver 1.0 at May, 28th, 1998
Bit 1 reserved
Bit 0 0 disable SB16 E3 command
1 enable SB16 E3 command
Try the best power management for both active and inactive stage of ALS4000 for notebook
application.
Pay special attention to data bus and address bus inside ALS4000 because this may be the very heavy
power consumption source.
Use internal block chip select signal to be the block power control signal as much as possible.
The pull up resistors on any power up configuration pin must be disconnected from VCC after reset.
Whenever new continuous DMA command for 8/16 bit wave playback is received, SB16 ESP should
always flush primary PCM FIFO.
ALS4000 should has a primary FIFO r/w counter reset indicator, system reset or ESP RESET should
reset this indicator. When current DMA operation is 8 bit stereo or 16 bit mono, if DMA transfer times
is not even, this indicator should indicate bit 0 of FIFO r/w counter must be reset by ESP when new
DMA command is received. When current DMA operation is 16 bit stereo, if DMA transfer times is
not multiple times of 4, this indicator should indicate that bit 0 and bit 1 of FIFO r/w counter must be
reset by ESP when new DMA command is received.
Any time when new DMA command is received, this indicator must be reset after primary FIFO r/w
counter control.
23
Ver 1.0 at May, 28th, 1998
0Xh reserved
1Xh set audio output mode for 4:1 ADPCM 2 to 8 bit playback
2Xh reserved
3Xh reserved
4Xh set sample rate and continuos/special DMA block length
5Xh reserved
6Xh reserved
7Xh set audio output for all ADPCM, 8 bit playback
8Xh output silence
9Xh 8 bit special DMA mode playback
AXh reserved
BXh 16 bit DMA audio output
CXh 8 bit DMA audio output
DXh control DMA and speaker
EXh ESP version and diagnostic test
FXh test IRQ and ESP ROM
All 8-bit ESP command is MONO except command 14h,1Ch,9Xh and CXh
Bit 0 0 normal
1 the first ADPCM block with reference byte
a. ESP_WRITE(10h)
b. ESP_WRITE(single-sample)
c. Wait for next sample time, go to a.
a. ESP_WRITE(14h)
b. ESP_WRITE(length.low)
c. ESP_WRITE(length.high)
ESP will generate an interrupt after the specified size of data transferred.
a. ESP_WRITE(16h)
24
Ver 1.0 at May, 28th, 1998
b. ESP_WRITE(length.low)
c. ESP_WRITE(length.high)
ESP will generate an interrupt after the specified size of data transferred.
a. ESP_WRITE(17h)
b. ESP_WRITE(length.low)
c. ESP_WRITE(length.high)
ESP will generate an interrupt after the specified size of data transferred.
ESP_WRITE(1Ch)
ESP will generate an interrupt for every specified block size transferred.
ESP_WRITE(1Eh)
ESP will generate an interrupt for every specified block size transferred.
ESP_WRITE(1Fh)
ESP will generate an interrupt for every specified block size transferred.
a. ESP_WRITE(40h)
b. ESP_WRITE(time constant)
a. ESP_WRITE(41h)
b. ESP_WRITE(frequency.high)
c. ESP_WRITE(frequency.low)
a. EPS_WRITE(48h)
b. ESP_WRITE(length.low)
c. ESP_WRITE(length.high)
25
Ver 1.0 at May, 28th, 1998
Bit 2 Bit 1
0 0 reserved
0 1 4:1 ADPCM 2 to 8 bit mode
1 0 2:1 ADPCM 4 to 8 bit mode
1 1 3:1 ADPCM 2.6 to 8 bit mode
Bit 0 0 normal
1 the first ADPCM block with reference byte
a. ESP_WRITE(72h)
b. ESP_WRITE(length.low)
c. ESP_WRITE(length.high)
ESP will generate an interrupt after the specified size of data transferred.
a. ESP_WRITE(73h)
b. ESP_WRITE(length.low)
c. ESP_WRITE(length.high)
ESP will generate an interrupt after the specified size of data transferred.
a. ESP_WRITE(74h)
b. ESP_WRITE(length.low)
c. ESP_WRITE(length.high)
ESP will generate an interrupt after the specified size of data transferred.
a. ESP_WRITE(75h)
b. ESP_WRITE(length.low)
c. ESP_WRITE(length.high)
26
Ver 1.0 at May, 28th, 1998
ESP will generate an interrupt after the specified size of data transferred.
a. ESP_WRITE(76h)
b. ESP_WRITE(length.low)
c. ESP_WRITE(length.high)
ESP will generate an interrupt after the specified size of data transferred.
a. ESP_WRITE(77h)
b. ESP_WRITE(length.low)
c. ESP_WRITE(length.high)
ESP will generate an interrupt after the specified size of data transferred.
ESP_WRITE(7Ah)
ESP will generate an interrupt for every specified block size transferred.
ESP_WRITE(7Bh)
ESP will generate an interrupt for every specified block size transferred.
ESP_WRITE(7Ch)
ESP will generate an interrupt for every specified block size transferred.
ESP_WRITE(7Dh)
ESP will generate an interrupt for every specified block size transferred.
ESP_WRITE(7Eh)
ESP will generate an interrupt for every specified block size transferred.
ESP_WRITE(7Fh)
ESP will generate an interrupt for every specified block size transferred.
Output Silence
27
Ver 1.0 at May, 28th, 1998
8Xh
a. ESP_WRITE(80h)
b. ESP_WRITE(duration.low)
c. ESP_WRITE(duration.high)
After each specified duration elapses, ESP will generate an interrupt. During silence period, ESP out
0x80 to PCM D/A.
All special DMA mode use command 48h to set the transfer block size. The non-continuous special
DMA mode will interrupt the CPU at the end of the transfer block and wait for new command. Use
RESET-ESP() to end the continuous special DMA, all other parameters remains the same after
RESET-ESP( ).
ESP_WRITE(90h)
ESP will generate an interrupt for every specified block size transferred.
ALS4000 use CR0.2 to control the DMA running mode of 90h command. When CR0.2 is 1, ESP will
continue DMA transfer no matter whether the interrupt is acknowledged, this is SBPRO 90 command.
When CR0.2 is 0, ESP will continue DMA transfer after the interrupt is acknowledged, this is SB16
90h command.
ESP_WRITE(91h)
ESP will generate an interrupt after the specified size of data transferred.
For non-continuous special DMA output, every time when ESP receives the 91h command, ESP will
use the block length that most recently set by command 48h to begin the special DMA transfer. So
if every block of DMA data is the same size, software needs only set block length one time by using
command 48h. When each block is transferred over, software needs only send 91h command to ESP,
the DMA transfer will then continue with previous block length.
28
Ver 1.0 at May, 28th, 1998
#BXh
FIFO will reset when ESP receives any digital audio I/O command.
FIFO is always on.
a. ESP_WRITE(BXh)
b. ESP_WRITE(mode)
c. ESP_WRITE(length.low)
d. ESP_WRITE(length.high)
Mode
Bit 7..6 X reserved
Bit 5 0 MONO
1 stereo
Bit 4 0 unsigned (0--8000h--FFFFh)
1 signed (8000h--0--7FFFh)
Bit 3..0 X reserved
ESP will generate an interrupt after the specified size of data transferred (if non-continuous) or every
block(if continuous).
FIFO will reset when ESP receives any digital audio I/O command.
FIFO is always on.
a. ESP_WRITE(CXh)
b. ESP_WRITE(mode)
c. ESP_WRITE(length.low)
d. ESP_WRITE(length.high)
Mode
Bit 7..6 X reserved
Bit 5 0 MONO
1 stereo
Bit 4 0 unsigned (0--80h--FFh)
1 signed (80h--0--7Fh)
Bit 3..0 X reserved
ESP will generate an interrupt after the specified size of data transferred (if non-continuous) or every
block(if continuous).
29
Ver 1.0 at May, 28th, 1998
ESP_WRITE(D0h)
The DMA request is stopped after this command. Internal FIFO will continue until the FIFO is empty
(playback) or full (record). The DMA request will resume after command D4h or any of new DMA
command is issued.
ESP_WRITE(D1h)
ESP_WRITE(D3h)
ESP_WRITE(D4h)
The DMA request that is suspended by the command D0h is enable again. The internal FIFO is
working as usual in pause or resume DMA mode.
ESP_WRITE(D5h)
The DMA request is stopped after this command. Internal FIFO will continue until the FIFO is empty
(playback) or full (record). The DMA request will resume after command D6h or any of new DMA
command is issued
ESP_WRITE(D6h)
The DMA request that is suspended by the command D5h is enable again. The internal FIFO is
working as usual in pause or resume DMA mode. This command is no use to non-BX type command
DMA transfer.
a. ESP_WRITE(D8h)
b. ESP_READ(status)
c. Status = 00h (digital audio off) or FFh (digital audio on)
ESP_WRITE(D9h)
Causes the ESP to finish the current block, then cease transferring. Use this command while the DMA
is transferring the last block of audio data from/to ESP. ESP-RESET() or any of new DMA command
30
Ver 1.0 at May, 28th, 1998
ESP_WRITE(DAh)
Causes the ESP to finish the current block, then cease transferring. Use this command while the DMA
is transferring the last block of audio data from/to ESP. ESP-RESET() or any of new DMA command
should reset this flag.
a. ESP_WRITE(E0h)
b. ESP_WRITE(test-data)
c. ESP_READ(result)
d. If result = bit invert of test-data, ESP is working
a. ESP_WRITE(E1h)
b. ESP_READ(major.version)
c. ESP_READ(minor.version)
a. ESP_WRITE(E2h)
b. ESP_WRITE(first byte b1),return r1 via DMA
c. ESP_WRITE(E2h)
d. ESP_WRITE(second byte b2),return r2 via DMA
a. ESP_WRITE(E3h)
b. ESP_READ(message)
31
Ver 1.0 at May, 28th, 1998
Message :
TEXT "COPYRIGHT (C) CREATIVE TECHNOLOGY LTD, 1992.",0h)
HEX 43 4F 50 59 52 49 47 48 54 20 28 43 29 20
43 52 45 41 54 49 56 45 20 54 45 43 48 4E 4F 4C 4F 47 59 20
4C 54 44 2C 20 31 39 39 32 2E 00
This command is valid only when CR3A.0 = 1.
a. ESP_WRITE(E4h)
b. ESP_WRITE(test-data)
a. ESP_WRITE(E4h)
b. ESP_WRITE(test-data)
c. ESP_WRITE (E8h)
c. ESP_READ(result)
d. If result = test-data, ESP is working
Testing
FXh
ESP_WRITE(F2h)
32
Ver 1.0 at May, 28th, 1998
33
Ver 1.0 at May, 28th, 1998
ESP_READ(return_byte)
ESP_WRITE(command/data)
ESP_RESET( )
You can use ESP_RESET() procedure to immediately terminate the special DMA transfer.
1. Direct Mode
ESP is programmed to do audio output on each command. All delay time is controlled by CPU delay
loop or timer interrupt. Only 8 bit mono output is supported.
Output:
a. ESP_WRITE(10h)
b. ESP_WRITE(next 8 bit mono PCM)
c. Wait until next sample time, goto a.
2. DMA Mode
ESP is programmed to make one transfer with a specified block size. At the end of transfer, the ESP
will generate an interrupt and wait for next command.
ESP is programmed to make continuous transfer to CODEC. After each transfer of a specified block
size, ESP will generate an interrupt and continue the next transfer of the same block size after the
interrupt is acknowledged.
1.Program ESP to switch to normal DMA mode transfer. At the end of the current DMA
transfer, ESP will exit from continuous DMA mode and continue to transfer using the
specified normal DMA mode.
34
Ver 1.0 at May, 28th, 1998
2.Send the exit continuous command. The ESP will exit continuous DMA mode at the end of
current block and terminate the transfer.
Once ESP is in the special DMA mode, it will not accept any further commands or data until the DMA
mode is terminated by
Either
1. Non-continuous special DMA mode will exit special DMA mode automatically at the end
of transfer.
Or
2. For continuous special DMA mode, a ESP_RESET() is needed to exit special DMA mode.
The ESP_RESET() will only stop special DMA transfer, all other parameters remain the same.
Either
1. Sound Blaster Pro (time constant)
Time constant = 256d - (1,000,000d / ( channel * sampling rate))
Channel = 1 for mono or BX,CX type DMA command, 2 for stereo
a. ESP_WRITE(40h)
b. ESP_WRITE(time constant)
Or
2. Sound Blaster 16 (sampling frequency)
a. ESP_WRITE(41h)
b. ESP_WRITE(frequency.high)
c. ESP_WRITE(frequency.low)
To end the UART mode, send MIDI_RESET (0FFh) to midi-command port. MIDIIN FIFO will be
flushed, any data in MIDIOUT FIFO will be output. When both FIFO are empty, MPU-401 will enter
pass-thru mode .
35
Ver 1.0 at May, 28th, 1998
36
Ver 1.0 at May, 28th, 1998
D0
Power is on. Device is operating.
D1
Not implemented. Any attempt to put the device to this state will be discarded and the power state
should remain the original state.
D2
Power down internal FM synthesizer, FM D/A, SB D/A, gameport block. All the information of mixer
and global control register should remain. Internal Audio Inactivity Timer started. When Audio
Inactivity Timer expires, PME# should be asserted.
D3hot
ALS4000 is drawing minimal power. The only power consumption is for audio activity detection
circuit, internal registers and for PCI configuration read/write. If audio activity is detected, PME#
should be asserted to wake up from sleeping. Only legal state transition is to D0. Any other attempt to
change the power state is illegal and has no effect.
D3cold
Power is removed.
Note: Only BYTE access is supported on those IO addresses that followed with an asterisk (*).
37
Ver 1.0 at May, 28th, 1998
Hardware should translate and forward the IO cycles to SB core. If WORD or DWORD access occurs,
HW should deal with the condition gracefully, i.e., the access cycle should be terminated normally. If
write, the written data should be discarded. If read, the data driven out by ALS4000 is meaningless.
38
Ver 1.0 at May, 28th, 1998
39
Ver 1.0 at May, 28th, 1998
GCRA2 Default : 00000000h PCI start address for secondary PCM FIFO
Bit Type Function
31:24 reserved
23:0 R/W PCI starting address SSA[23..0] for secondary FIFO
ŒStuff SSA[31..24] with 0 when implemented.
GCRA3 Default : 00000000h Secondary PCM FIFO base byte count
Bit Type Function
31:16 Reserved
15:0 R/W Secondary base byte count SBBC[15..0]
ŒOnly auto-init and address increase mode supported while recording.
GCRA4 Default : 00XXXXXXh Secondary PCM FIFO current address
Bit Type Function
31:24 reserved (read as 0)
23:0 R PCI current address CA1[23..0] for secondary FIFO
GCRA5 Default : XXXXXXXXh Secondary PCM FIFO status and current byte count
Bit Type Function
31:18 Reserved
17 R Request status, set to 1 if a request for secondary FIFO is pending.
16 R TC1 status, 1=TC1 is reached. Read and clear it.
15:0 R Secondary FIFO current byte count CBC1[15..0]
40
Ver 1.0 at May, 28th, 1998
41
Ver 1.0 at May, 28th, 1998
42
Ver 1.0 at May, 28th, 1998
43
Ver 1.0 at May, 28th, 1998
Pay more attention to PME# circuit design. Note that when VCC is removed, PME# must be tri-
state.
44
Ver 1.0 at May, 28th, 1998
Internal Registers/Flags :
RETRY: The flag decide whether read status from 8237 or not.(Effective in Legacy-DMA)
1 Enabled read (Default)
0 Disable read
FFLP: 1_bit Flip-Flop function as low/high byte pointer for DMA IO register (00~07h)
(Effective in Legacy-DMA)
Write 0x0c will clear FFLP to 0.FFLP is default 0 after reset.
Any access to 00h~07h will toggle it’s value.
CA0: 24-bit address counter of DMA emulation for primary PCM FIFO
CBC0: 16-bit byte counter of DMA emulation for primary PCM FIFO
CA1: 24-bit address counter secondary PCM FIFO
CBC1: 16-bit byte counter secondary PCM FIFO
DMA Emulation Scheme for two Legacy-DMA modes and DDMA mode :
l Legacy-DMA Mode 1 (claim DMAC read cycle):
ALS4000 decode the following IO command:
Address Command Function Enabled
00h IO write FFLP=0: Write to GCR91.7~0 GCRA9.0=1
FFLP=1: Write to GCR91.15~8
00h IO read FFLP=0: read from CA0.7~0 SBDMA=000
FFLP=1: read from CA0.15~8 & GCRA9.0=1
01h IO write FFLP=0: Write to GCR92.7~0 GCRA9.0=1
FFLP=1: Write to GCR92.15~8
01h IO read FFLP=0: read from CBC0.7~0 SBDMA=000
FFLP=1: read from CBC0.15~8 & GCRA9.0=1
87h IO write write to GCR91.23~16 GCRA9.0=1
02h IO write FFLP=0: Write to GCR93.7~0 GCRA9.0=1
FFLP=1: Write to GCR93.15~8
02h IO read FFLP=0: read from CA0.7~0 SBDMA=001
FFLP=1: read from CA0.15~8 & GCRA9.0=1
03h IO write FFLP=0: Write to GCR94.7~0 GCRA9.0=1
45
Ver 1.0 at May, 28th, 1998
For DMA register access, ALS4000 take different action for read and write operation :
Write Operation “Snoop” it, fetch data and save to corresponding registers.
l Legacy-DMA Mode 2 (write back DMAC current address and byte counter register):
For DMAC register write operation, ALS4000 acts just the same as Legacy-DMA mode 1, snoops and
fetches data and stores in the corresponding register.
ALS4000 will always ignore DMAC register read cycle.
If bus master for DMAC register update is enabled, ALS4000 should perform four IO write cycles each
time after one byte has been read from memory, as follow:
Address Data
46
Ver 1.0 at May, 28th, 1998
l DDMA Mode :
ALS4000 implemented DDMA register for system chipset access. One channel for primary PCM FIFO
only.
For DMA/software compatibility issue, CA0/CBC0 load starting value according the condition as
follow in spite of legacy SB function is enabled or not:
47
Ver 1.0 at May, 28th, 1998
For software compatibility issue, CA1/CBC1 load starting value according the condition as follow :
Source: GCRA2/GCRA3
Condition: (IO write to GCRA2, GCRA3.15~0) | (TC1=1)
Note: TC1=1 when CBC1 reach FFFFh.
Note: When PWRDN_ is low, PCI clock can be stopped. All PCI output drivers must be disabled.
It is suggested that block power switch control signal should be combined with PWRDN_, except
analog power switch control (PWR_d). Audio activity detection power (APWR) should be cut
too. When PWRDN_ pin goes from low to high, an internal reset signal should be generated. In
any case, crystal oscillator (14.318MHz) will always work.
Attention for test mode: If set GCR90.14=1, and set sample rate=48KHz, internal PCM FIFO
will run at a fixed rate=48*8 (KHz) to accelerate procedure.
48