Crystalclear Advanced Audio System With 3D Sound: General Description
Crystalclear Advanced Audio System With 3D Sound: General Description
OSCILLATOR VREF
INPUT MIXER
Sample Rate
Converters
LINEAR
Σ
SAMPLE
Stereo
µ-LAW
A/D
FIFO
BUS A-LAW
SD<7:0> INTERFACE ADPCM
DMA
Converters
Σ
LINEAR OUTPUT MIXER
SAMPLE
DIGITAL MOUT
µ-LAW
FIFO
Σ
MIXER
16
QSound
Decode A-LAW
Stereo
DSP
Σ
D/A
Advanced Product Information This document contains information for a new product. Cirrus
Logic, Inc. reserves the right to modify this product without notice.
Cirrus Logic, Inc SEP ’97
P.O. Box 17847, Austin, TX 78760 Copyright Cirrus Logic, Inc. 1997 DS215PP4
(All Rights Reserved)
(512) 445 7222 Fax: (512) 445 7581 1
http://www.cirrus.com
CS4238B
TABLE OF CONTENTS
Windows and Windows Sound System are registered trademarks of Microsoft Corporation.
Sound Blaster and Sound Blaster Pro are registered trademarks of Creative Labs.
Adlib is a registered trademark of Adlib Corporation.
QSOUND, QXpander, Q1, QSpace, Virtual Audio and the QSound Logo are registered trademarks of QSound Labs, Inc.
QSound technology is protected by US and foreign patents.
2 DS215PP4
CS4238B
DS215PP4 3
CS4238B
4 DS215PP4
CS4238B
MIXERS (TA = 25 °C; VA, VD1, VDF1-VDF4 = +5V; Input Levels: Logic 0 = 0V, Logic 1 = VD1;
1 kHz Input Sine wave, Measurement Bandwidth is 20 Hz to 20 kHz - unweighted.
Parameter Symbol Min Typ Max Units
Mixer Gain Range Span LINE, AUX1, AUX2 45 46.5 dB
MIC, MIN 42 45 dB
Hardware Master 44 48 dB
(Digital) Wavetable, Monitor, PC Wave, DSP, FM 90 94.4 dB
Step Size MIC, LINE, AUX1, AUX2 1.3 1.5 1.7 dB
MIN 2.3 3.0 3.7 dB
Hardware Master 1.6 2.0 2.4 dB
(Digital) Wavetable, Monitor, PC Wave, DSP, FM 0.9 1.5 2.0 dB
Dynamic Range -Total 94.5 dB
(Analog Mixers) -Instantaneous 91 dB
Total Harmonic Distortion (Note 3) 0.002 %
(Analog Mixers)
ABSOLUTE MAXIMUM RATINGS (AGND, DGND, SGND = 0V, all voltages with respect to 0V.)
Parameter Symbol Min Max Units
Power Supplies: Digital VD1 -0.3 6.0 V
VDF1-VDF4 -0.3 6.0 V
Analog VA -0.3 6.0 V
Total Power Dissipation (Supplies, Inputs, Outputs) 1 W
Input Current per Pin (Except Supply Pins) -10.0 +10.0 mA
Output Current per Pin (Except Supply Pins) -50 +50 mA
Analog Input Voltage -0.3 VA+0.3 V
Digital Input Voltage: SA<11:0>, IOR, IOW, AEN
SD<7:0>, DACK<A:C> -0.3 VD1+0.3 V
DS215PP4 5
CS4238B
6 DS215PP4
CS4238B
Timing Parameters(TA = 25 °C; VA, VD1, VDF1-VDF4 = +5V; outputs loaded with 30pF
Input Levels: Logic 0 = 0V, Logic 1 = VD1)
Parameter Symbol Min Max Units
E2PROM Timing (Note 1)
SCL Low to SDA Data Out Valid tAA 0 3.5 µs
Start Condition Hold Time tHD:STA 4.0 µs
Clock Low Period tLSCL 4.7 µs
Clock High Period tHSCL 4.0 µs
Start Condition Setup Time tSU:STA 4.7 µs
(for a Repeated Start Condition)
Data In Hold Time tHD:DAT 0 µs
Data In Setup Time tSU:DAT 250 ns
SDA and SCL Rise Time (Note 7) tR 1 µs
SDA and SCL Fall Time tF 300 ns
Stop Condition Setup Time tSU:STO 4.7 µs
Data Out Hold Time tDH 0 ns
Notes 7. Rise time on SDA is determined by the capacitance of the SDA line with all connected gates and the
external pullup resistor required.
tF t HSCL t LSCL tR
XA0/SCL
XD0/SDA (IN)
t AA t DH
XD0/SDA (OUT)
DS215PP4 7
CS4238B
8 DS215PP4
CS4238B
t
pd2
FSYNC SF1,0=01,10
t t
pd2 pd2
FSYNC SF1,0=00
SCLK
t
t s1
sckw t
h1
SDIN MSB, Left
DRQ<>
t DKSUa t DRHD
DACK<>
t STW t DKHDb
IOR
t RDDV t DHD1
SD<7:0>
t RESDRV
RESDRV
t t EEPROM
INIT
Reset Timing
DS215PP4 9
CS4238B
DRQ<>
t DKSUb t DRHD
DACK<>
t STW t DKHDa
IOW
t WDSU t DHD2
SD<7:0>
DRQ<>
DACK<>
IOR/IOW
tBWDN
LEFT/LOW RIGHT/HIGH
SD<7:0> BYTE BYTE
DRQ<>
DACK<>
IOR/IOW
t BWDN
10 DS215PP4
CS4238B
DRQ<>
t SUDK1 t SUDK2
DACK<>
IOR
t RDDV t DHD1
SD<7:0>
t ADSU t ADHD
SA<>
AEN
DRQ<>
t SUDK1 t SUDK2
DACK<>
t STW
IOW
t WDSU tDHD2
SD<7:0>
t ADSU tADHD
SA<>
AEN
DS215PP4 11
CS4238B
12 DS215PP4
CS4238B
Logical Device 0 Logical Device 1 Logical Device 2 Logical Device 3 Logical Device 4 Logical Device 5
DS215PP4 13
CS4238B
14 DS215PP4
CS4238B
DS215PP4 15
CS4238B
3. A unique identifier (handle) is assigned to the The CM determines the necessary resource re-
part and the resource data is read. quirements for the system and then programs the
part through the configuration registers. The con-
4. After all cards’ resource requirements are de- figuration register data is written one logical
termined, the host uses the handle to assign device at a time. After all logical devices have
conflict-free resources been configured, CM activates each device indi-
vidually. Each logical device is now available on
5. After the configuration registers have been the ISA bus and responds to the programmed
programmed, each configured logical device address range, DMA channels, and interrupts that
is activated. have been allocated to that logical device.
16 DS215PP4
CS4238B
The next 3 bytes are the PnP version number. External E2PROM section for more information
The default is version 1.0a: 0Ah, 10h, 01h. on the serial E2PROM interface and E2PROM
programming.
The next sequence of bytes are the ANSI identi-
fier string. The default is: 82h, 0Eh, 00h, The format for the data stored in the E2PROM is
’Crystal Codec’, 00h. as follows:
The logical device data must be entered using (Hardware Configuration Data:)
the PnP ISA Specification format. Typical logical 2 bytes E2PROM validation: 55h, BBh
device values are found in Table 1. The
E2PROM version for this data is found in Ap- 2 bytes length of resource data in E2PROM
pendix A.
19 bytes Hardware Configuration
Loading Resource Data
(Plug and Play Resource Data:)
A serial E2PROM interface allows user-program- 9 bytes Plug and Play ID
mable serial number and resource data to be
stored in an external E2PROM. The interface is 3 bytes Plug and Play version number
compatible with devices from a number of ven-
dors and the size may vary according to specific Variable number of bytes of user defined
customer requirements. The maximum size for ASCII ID string
resource data supported by the part’s internal
RAM is 384 bytes of combined Hardware Con- Logical Device 0 (Windows Sound System,
figuration and PnP resource data. With the FM Synthesizer, Sound Blaster Pro) data
addition of the 4-byte header, the maximum
amount of E2PROM space used would be 388 Logical Device 1 ( Game Port) data
bytes. However, the part also supports firmware
Logical Device 2 ( Control) data
upgrades via the E2PROM. The maximum size
E2PROM supported is 2k bytes. After power-up, Logical Device 3 ( MPU-401) data
the existence of an E2PROM is checked by read-
ing the first two bytes from the E2PROM Logical Device 4 ( CD-ROM) data
interface. If the data from the E2PROM port
reads 55h and BBh, then the rest of the Logical Device 5 (Modem) data
E2PROM data is loaded into the internal RAM.
If the first two bytes aren’t correct, the E2PROM End of Resource byte & checksum byte
is assumed not to exist and a "hostload" proce-
dure must be used to load the internal RAM. The Firmware patch code.
Hostload procedure can be found in the Hostload
section. For motherboard designs, an E2PROM A typical E2PROM data load, in assembly for-
should still be included, to allow faster integrat- mat, can be found in Appendix A.
ing of resource and firmware patch data. This
allows updates without respiring BIOS code. If Loading Firmware Patch Data
the part is installed on a plug-in card, then an An external E2PROM is read during the power-
external E2PROM is required to ensure that the up sequence that stores Hardware Configuration
proper PnP resource data is loaded into the inter- and PnP data, and firmware patch data. The part
nal RAM prior to a PnP sequence. See the contains RAM and ROM to run the core proces-
DS215PP4 17
CS4238B
Physical Device Logical Device Best Choice Acceptable Sub optimal Sub optimal
Choice 1 Choice 1 Choice 2
WSS 0 ANSI ID = WSS/SB
16-bit address WSSbase 534h-534h 534-608h 534-FFCh
decode Length/Alignment 4/4 4/D4h 4/4
high true IRQ 5 5,7,9,11,12,15 5, 7, 9, 11, 12, 15
edge sensitive (SB share) (SB share) (SB share)
8-bit, count by DMA 1 0, 3 0, 1, 3
byte, type A (SB share) (SB share) (SB share)
same DMA 0, 3 0, 1, 3 ----
Synthesis 0
16-bit address SYNbase 388h 388h 388-3F8h
decode Length/Alignment 4/8 4/8 4/8
IRQ ---- ---- ----
SB Pro 0
16-bit address SBbase 220h 220-260h 220-300h
decode Length/Alignment 16/16 16/32 16/32
Game Port 1 ANSI ID = GAME
16-bit address GAMEbase 200h 208h
decode Length/Alignment 8/8 8/8
Control 2 ANSI ID = CTRL
16-bit address CTRLbase 120-3F8h
decode Length/Alignment 8/8
IRQ ----
MPU401 3 ANSI ID = MPU
16-bit address MPUbase 330h 330-360h 330-3E0h
decode Length/Alignment 2/8 2/8 2/8
IRQ 9 9,11,12,15 ----
---- Feature not supported in the listed configuration, but is supported through customization.
18 DS215PP4
CS4238B
The Crystal key places the part in the configura- To use the SLAM method, the following se-
tion mode. Once the Crystal key has been quence must be followed:
initiated, new PnP resource data can be down-
loaded by a hostload sequence, or an alternate 1. Host sends 32-byte Crystal key to I/O
method of programming the configuration regis- 0279h, chip enters configuration mode.
ters may be used. This alternate method is
referred to as the "SLAM" method. The SLAM 2. Host programs CSN (Card Select Number)
method allows the user to directly access the by writing a 06h and 00h to I/O 0279h.
configuration registers, configure, and activate
the chip, and then, optionally, disable the PnP 3. Host programs the configuration registers of
and/or Crystal key feature. The SLAM method each logical device by writing to I/O 0279h.
uses commands that are similar to the PnP com- The following data is the maximum amount
mands; however, they are different since the user of information per device. All current devices
has direct access to the configuration registers. only need a subset of this data:
To use the SLAM method, see the Bypassing Logical Device ID (15h, xxh)
PnP section. xxh is logical device number: 0-5
The following 32 bytes, in hex, are the Crystal I/O Port Base Address 0 (47h, xxh, xxh)
key: high byte , low byte
96, 35, 9A, CD, E6, F3, 79, BC,
I/O Port Base Address 1 (48h, xxh, xxh)
5E, AF, 57, 2B, 15, 8A, C5, E2 high byte , low byte
F1, F8, 7C, 3E, 9F, 4F, 27, 13,
I/O Port Base Address 2 (42h, xxh, xxh)
09, 84, 42, A1, D0, 68, 34, 1A high byte , low byte
DS215PP4 19
CS4238B
015h, 003h ; LOGICAL DEVICE 3 CM2-CM0 Address bit masks for the Alternate
047h, 003h, 030h ; MPUbase=0x330 CDROM address decode, ACDbase.
See the CDROM Interface section
022h, 009h ; MPU IRQ = 9 for more details on ACDbase
033h, 001h ; activate logical device 3
000 - ACDCS low for 1 byte
001 - ACDCS low for 2 bytes
079h ; activate Crystal device 011 - ACDCS low for 4 bytes
111 - ACDCS low for 8 bytes
If all the above data is sent, after the Crystal key, xxx - all others, RESERVED
all devices except the CDROM and Modem will
respond to the appropriate resources given.
20 DS215PP4
CS4238B
NOTE:The first four bytes are exclusive to the E2PROM and are not used in the Hostload mode.
* Currently not supported. Must be set to default values given in the table.
DS215PP4 21
CS4238B
HW Config. Byte 6: COMbase Address Length HW Config. Byte 7: Misc. Configuration Bits,
Mask, Default = 00000011 Default = 10000000
D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
MM7 MM6 MM5 MM4 MM3 MM2 MM1 MM0 IHCD IHS PKD CKD IHM VCEN SDD ACDB7D
MM7-MM0 Address bit masks for Logical Device ACDB7D Alternate CDROM, data Bit 7 Disable.
5, typically a modem address, When set, SD7 is held in a high
COMbase. See the Modem Interface impedance state when reading from
Section for more details on ACDbase+1 (only this one address).
COMbase. This bit provides support for IDE al-
ternate base address sharing with
00000000 - MCS low for 1 byte the floppy disk controller.
00000001 - MCS low for 2 bytes
00000011 - MCS low for 4 bytes SDD SD Disable. When set, SD<7:0> are
00000111 - MCS low for 8 bytes high impedance on reads from any
00001111 - MCS low for 16 bytes peripheral port address: External syn-
00011111 - MCS low for 32 bytes thesis, CDROM or Modem devices.
00111111 - MCS low for 64 bytes Allows external buffers to bypass the
01111111 - MCS low for 128 bytes part while still allowing PnP address
11111111 - MCS low for 256 bytes support. This bit is also internally
xxxxxxxx - all others, RESERVED forced on whenever WTEN or SPS
in HW Config. byte 8, or C8, is set.
NOTE: The part only buffers the lower three address
bits onto the peripheral port. When setting the ad- VCEN Volume Control Enable. When set,
dress decode greater than 8 bytes, the upper the UP, DOWN, and MUTE pins be-
address bits should be buffered externally. come active and provide a hardware
master volume control.
22 DS215PP4
CS4238B
DS215PP4 23
CS4238B
Bytes 19 through 21 map the interrupt number to 2. Write 57h (Jump to ROM) command to
the actual interrupt pins A - F. As shown in the CTRLbase+5.
table, the byte 20 default is 0xB9; therefore,
IRQC, which is the lower nibble, maps to the 3. Download the PnP resource data.
ISA interrupt 9. Likewise IRQD, which is the
upper nibble, maps to the ISA interrupt 11 a. Send download command by writing AAh
(0Bh). to CTRLbase+5.
Bytes 22 and 23 map the DMA channel number b. Send starting download address (4000h)
to the actual DMA pins A-C. As shown in the by writing low byte (00h) first, and then
table, the byte 22 default is 0x10; therefore, high byte (40h) to CTRLbase+5.
DRQA/DACKA is the lower nibble which maps
to the ISA DMA channel 0. Likewise c. Send the Hardware Configuration and re-
DRQB/DACKB is the upper nibble which maps source data in successive bytes to
to the ISA DMA channel 1. CTRLbase+5. This includes the Hardware
Configuration and the PnP resource data.
Hostload Procedure The PnP resource format is described in
the PnP Data section. The resource header
This procedure is provided for backwards com- should not contain the first four bytes
patibility with the CS4236. Since the E2PROM which are only used for E2PROM loads.
allows all resource and firmware patch data to be
loaded at power-up, this procedure is typically 4. End download by writing 00h to
not used. To download PnP resource data from CTRLbase+6.
the host to the part’s internal RAM, use the fol-
lowing sequence: 5. If any of the Hardware Configuration Data
(first 19 bytes) has changed, 5Ah must be
1. Configure Control I/O base address, written to CTRLbase+5 to force the part to
CTRLbase, by one of two methods: regular internally update this information.
PnP cycle or Crystal Key method.
a. The host can use the regular PnP cycle to The new PnP data is loaded and the part is ready
program the CTRLbase, and then place the for the next PnP cycle.
chip in the wait_for_key_state
External E2PROM
b. If the Crystal Key method is used:
The Plug and Play specification defines 32 bits
First, send the 32-byte Crystal key to I/O of the 72-bit Serial Identifier as being a user de-
address 0279h. (The Crystal Key only fined serial number. The E2PROM is used to
supports one Crystal part per system.) change the user section of the identifier, store
default resource data for PnP, Hardware Con-
Second, configure logical device 2 base figuration data specific to the Crystal part, and
address, CTRLbase, by writing to I/O firmware patches to upgrade the core processor
0279h (15h, 02h, 47h, xxh, xxh, 33h, functionality.
01h, 79h).
Note: The two xxh represent the base_ad-
dress_high and base_address_low
respectively. The default is: 01h, 20h.
24 DS215PP4
CS4238B
The E2PROM interface uses an industry standard The maximum Hardware Configuration and PnP
2-wire interface consisting of a bi-directional resource RAM data supported is 384 bytes, and
data line and a clock line driven from the part. a four byte header; therefore, the maximum
After power-on the part looks for the existence amount of data storage, without firmware
of an E2PROM device and loads the user de- patches, in E2PROM would be 388 bytes. The
fined data. The existence is determined by the maximum size E2PROM supported is 2k bytes.
first two bytes read (0x55 followed by 0xBB). If This allows the inclusion of firmware patches af-
the first two bytes are correct, the part reads the ter the PnP resource data.
next two bytes to determine the length of data in
the E2PROM. The length bytes indicate the If an external E2PROM exists, it is accessed by
number of bytes left to be read (not including the serial interface and is connected to the XD0
the two validation bytes or two length bytes). As and XA0 pins. The two-wire interface is control-
shown in Figure 3, the E2PROM is read using a led by three bits in the Control logical device,
start bit followed by a dummy write, to initialize Hardware Control Register (CTRLbase+1). The
the address to zero. Then another start bit and serial data can be written to or read from the
device address, followed by all the data. Since E2PROM by sequentially writing or reading that
the part uses the sequential read properties of the register. The three register bits, D0, D1, D2 are
E2PROM, only one E2PROM, is supported labeled CLK, DOUT, and DIN/EEN respectively.
(ganged E2PROMs are not supported). The DIN/EEN bit, when written to a one, en-
ables the E2PROM serial interface. When the
Some E2PROMs that are compatible with this DIN/EEN bit is written to a zero, the serial inter-
interface are: face is disabled. The DIN/EEN bit is also the
Atmel AT24Cxx series Data In (DIN) signal to read back data from the
MicroChip 24LCxxB series E2PROM. The XD0 pin is a bi-directional open-
National NM24CxxL series drain data line supporting DIN and DOUT;
Ramtron FM24Cxx series therefore, to read the correct data, the DOUT bit
SGS Thompson ST24Cxx series must be set to a one prior to performing a read
Xicor X24Cxx series of the register. Otherwise, the data read back
where the xx is replaced by 02, 04, 08, or 16 from DIN/EEN will be all zeros. The E2PROM
based on the size of the E2PROM desired. The data can then be read from the DIN/EEN bit.
size of 16 (2k bytes) is preferred since it allows The CLK bit timing is controlled by the host
the maximum flexibility for upgrading firmware software. This is the serial clock for the
patches. Other E2PROMs compatible with Fig- E2PROM. The DOUT bit is used to write/pro-
ure 3 and the timing parameters listed in the gram the data out to the E2PROM. An external
front of the data sheet may also be used. pull-up resistor is required on XD0 because it is
an open-drain output. Use the guidelines in the
Part Bank No
Part Read
Crystal IC Start Address Write Address Start Acknowledge Acknowledge
Address Stop
S 1 0 1 0 0 0 0 0 A 0 0 0 0 0 0 0 0 AS 1 0 1 0 0 0 0 1 A Data A Data 1P
DS215PP4 25
CS4238B
specific E2PROM data sheet to select the value WINDOWS SOUND SYSTEM CODEC
of the pull-up resistor (a typical value would be The WSS Codec software interface consists of 4
3.3kΩ). I/O locations starting at the Plug and Play ad-
dress ’WSSbase’, and supports 12-bit address
Programming the E2PROM: decoding. If the upper address bits, SA12-SA15
1. Configure Control I/O base address by one are used, they must be 0 to decode a valid ad-
of two methods: regular PnP cycle or Crystal dress. The WSS Codec also requires one
Key method. interrupt and one or preferably two DMA chan-
nels, one for playback and one for capture. Since
a. The host can use the regular PnP cycle to the WSS Codec and Sound Blaster device are
program the logical device 2 I/O base ad- mutually exclusive, the two devices share the
dress, and then place the chip in the same interrupt and DMA playback channel.
wait_for_key_state
The WSS Codec/Mixer is register compatible
b. If the Crystal Key method is used: with the Microsoft Windows Sound System.
Functions include stereo Analog-to-Digital and
First, write to I/O 0279h, send the 32- Digital-to-Analog converters (ADCs and DACs),
byte Crystal key. (The Crystal Key only analog mixing, anti-aliasing and reconstruction
supports one Crystal part per system.) filters, line and microphone level inputs, optional
A-Law/µ-Law coding, simultaneous capture and
Second, configure the Control I/O base
playback (at independent sample frequencies)
address by writing 15h, 02h, 47h, 01h,
and a parallel bus interface. Five analog inputs
20h, 33h, 01h, 79h to 0279h.
are provided and four can be mixed to the ADC
mixer. All five can be mixed with the output of
2. Refer to the specific data sheet for the
the DAC with full volume control. Several data
E2PROM you are using for timing require-
modes are supported including 8- and 16-bit lin-
ments and data format. Also, refer to the
ear as well as 8-bit companded, 4-bit ADPCM
Loading Resource Data section of this data
compressed, and 16-bit big Endian.
sheet for the E2PROM resource data format.
Enhanced Functions (MODEs)
3. Send the E2PROM data in successive bits to
CTRLbase+1 (Hardware Control Register) The initial state is labeled MODE 1 and forces
while following the E2PROM data sheet for- the part to appear as a CS4248. The more popu-
mat. lar second mode, MODE 2, forces the part to
appear as a CS4231 super set and is compatible
The E2PROM now contains the PnP resource with the CS4232. To switch from MODE 1 to
data. For this new data to take effect, the part MODE 2, the CMS1,0 bits, in the MODE and
must be reset, causing the part to read the ID register (I12), should be set to 10 respec-
E2PROM during initialization. Crystal can pro- tively. When MODE 2 is selected, the bit IA4 in
vide a utility, RESOURCE.EXE, to program the Index Address register (R0) will be decoded
E2PROMs through the Control logical device in- as a valid index pointer providing 16 additional
terface. registers and increased functionality over the
CS4248.
26 DS215PP4
CS4238B
MODE 1. Except for the Capture Data Format and then makes requests as positions inside the
(I28), Capture Base Count (I30/31), and Alter- FIFO are emptied, thereby keeping the playback
nate Feature Status (I24) registers, all other FIFO as full as possible. Thus when the system
Mode 2 functions retain their values when re- cannot respond within a sample period, the FIFO
tur ning to Mode 1. The WS S Codec is starts to empty, avoiding a momentary loss of
backwards compatible with the CS4236, audio data. If the FIFO runs out of data, the last
CS4232, CS4231 and CS4248. valid sample can be continuously output to the
DACs (if DACZ in I16 is set) which will elimi-
The additional MODE 2 functions are: full-du- nate pops from occurring.
plex support, a programmable timer, Mono In
and Mono Out support. When capture is enabled, the capture FIFO tries
to continually stay empty by making requests
MODE 3 is selected by setting CMS1,0 to 11. every sample period. Thus when the system can-
MODE 3 allows access to new bits in the indi- not respond within a sample period, the capture
rect registers I0-I31, and allows access to a third FIFO starts filling, thereby avoiding a loss of
set of "extended registers" which are designated data in the audio data stream.
X0-X17+X25. The extended registers are ac-
cessed through I23. The additional MODE 3 WSS Codec PIO Register Interface
functions are: Four I/O mapped locations are available for ac-
cessing the Codec functions and mixer. The
1. A full symmetrical mixer. This changes the in- control registers allow access to status, audio
put multiplexer to a input mixer. data, and all indirect registers via the index reg-
isters. The IOR and IOW signals are used to
2. Independent sample frequency control on the define the read and write cycles respectively. A
ADCs and DACs. PIO access to the Codec begins when the host
puts an address on to the ISA bus which matches
3. Programmable Gain and Attenuation on the WSSbase and drives AEN low. WSSbase is pro-
Microphone inputs. grammed during a Plug and Play configuration
sequence. Once a valid base address has been
4. Independent control over the volume of inter- decoded then the assertion of IOR will cause the
nal FM synthesis and external wavetable. WSS Codec to drive data on the ISA data bus
lines. Write cycles require the host to assert data
5. Volume control on the DSP serial port input on the ISA data bus lines and strobe the IOW
data. signal. The WSS Codec will latch data into the
PIO register on the rising edge of the IOW
6. Stereo volume on the monitor feedback path. strobe.
FIFOs The audio data interface typically uses DMA re-
The WSS Codec contains 16-sample FIFOs in quest/grant pins to transfer the digital audio data
both the playback and capture digital audio data between the WSS Codec and the bus. The WSS
paths. The FIFOs are transparent and have no Codec is responsible for asserting a request signal
programming associated with them. whenever the Codec’s internal buffers need updat-
ing. The bus responds with an acknowledge
When playback is enabled, the playback FIFO signal and strobes data to and from the Codec, 8
continually requests data until the FIFO is full, bits at a time. The WSS Codec keeps the request
DS215PP4 27
CS4238B
pin active until the appropriate number of 8-bit data, and the capture DMA requests will be
cycles have occurred to transfer one audio sam- routed to the DMA pair specified by the DMA
ple. Note that different audio data types will Channel Select 1 resource data.
require a different number of 8-bit transfers.
DUAL DMA CHANNEL MODE
DMA Interface The WSS Codec supports a single and a dual
The second type of parallel bus cycle from the DMA channel mode. In dual DMA channel
WSS Codec is a DMA transfer. DMA cycles are mode, playback and capture DMA requests and
distinguished from PIO register cycles by the as- acknowledges occur on independent DMA chan-
sertion of a DRQ followed by an nels. In dual DMA mode, SDC should be set to
acknowledgment by the host by the assertion of 0. The Playback- and Capture-Enables (PEN,
DACK (with AEN high). While the acknow- CEN, I9) can be changed without a Mode
ledgment is received from the host, the WSS Change Enable (MCE, R0). This allows for
Codec assumes that any cycles occurring are proper full duplex control where applications are
DMA cycles and ignores the addresses on the independently using playback and capture.
address lines.
SINGLE DMA CHANNEL (SDC) MODE
The WSS Codec may assert the DMA request When two DMA channels are not available, the
signal at any time. Once asserted, the DMA re- SDC mode forces all DMA transfers (capture or
quest will remain asserted until a complete DMA playback) to occur on a single DMA channel
cycle occurs to the part. DMA transfers may be (playback channel). The trade-off is that the
terminated by resetting the PEN and/or CEN bits WSS Codec will no longer be able to perform
in the Interface Configuration register (I9), de- simultaneous DMA capture and playback.
pending on the DMA that is in progress
(playback, capture, or both). Termination of To enable the SDC mode, set the SDC bit in the
DMA transfers may only happen between sample Interface Configuration register (I9). With the
transfers on the bus. If DRQ goes active while SDC bit asserted, the internal workings of the
resetting PEN and/or CEN, the request must be WSS Codec remain exactly the same as dual
acknowledged with DACK and a final sample mode, except for the manner in which DMA re-
transfer completed. quest and acknowledges are handled.
DMA CHANNEL MAPPING The playback of audio data will occur on the
Mapping of the WSS Codec’s DRQ and DACK playback channel exactly as dual channel opera-
onto the ISA bus is accomplished by the Plug tion; however, the capture audio channel is now
and Play configuration registers. If the Plug and diverted to the playback channel. Alternatively
Play resource data specifies only one DMA stated, the capture DMA request occurs on DMA
channel for the Codec (or the codec is placed in channel select 0 for the WSS Codec. (In
SDC mode) then both the playback and capture MODEs 2 and 3, the capture data format is al-
DMA requests should be routed to the same ways set in register I28.) If both playback and
DRQ/DACK pair (DMA Channel Select 0). If capture are enabled, the default will be playback.
the Plug and Play resource data specifies two SDC does not have any affect when using PIO
DMA channels for the Codec, then the playback accesses.
DMA request will be routed to the DMA pair
specified by the DMA Channel Select 0 resource
28 DS215PP4
CS4238B
DS215PP4 29
CS4238B
30 DS215PP4
CS4238B
bit5 bit4 bit3 bit2 bit1 bit0 WG5-0 (X16,17) LBA5-0, PA5-0, SPA5-0, FMA5-0
0 0 0 0 0 0 0 12.0 dB 0.0 dB
1 0 0 0 0 0 1 10.5 dB -1.5 dB
2 0 0 0 0 1 0 9.0 dB -3.0 dB
3 0 0 0 0 1 1 7.5 dB -4.5 dB
. . . . . . . - .
8 0 0 1 0 0 0 0 dB -12.0 dB
. . . . . . . - .
. . . . . . . - .
60 1 1 1 1 0 0 -78.0 dB -90.0 dB
61 1 1 1 1 0 1 -79.5 dB -91.5 dB
62 1 1 1 1 1 0 -81.0 dB -93.0 dB
63 1 1 1 1 1 1 -82.5 dB -94.5 dB
CFS
2 1 0 C2SL = 0 C2SL=1 FMT1 FMT0 C/L Data Format
0 0 0 8.0 kHz 5.51 kHz 0 0 0 Linear, 8-bit unsigned
0 0 1 16.0 kHz 11.025 kHz 0 0 1 µ-Law, 8-bit companded
0 1 0 27.42 kHz 18.9 kHz 0 1 0 Linear, 16-bit two’s
0 1 1 32.0 kHz 22.05 kHz complement, Little Endian
1 0 0 N/A 37.8 kHz 0 1 1 A-Law, 8-bit companded
1 0 1 N/A 44.1 kHz 1 0 1 ADPCM, 4-bit, IMA compatible
1 1 0 48.0 kHz 33.075 kHz 1 1 0 Linear, 16-bit two’s
1 1 1 9.6 kHz 6.62 kHz complement, Big Endian
Table 9. Sample Frequencies Table 11. WSS Codec Data Format
DS215PP4 31
CS4238B
32 DS215PP4
CS4238B
DS215PP4 33
CS4238B
PL/R Playback Left/Right Sample: This bit CL/R Capture Left/Right Sample: This bit
indicates whether data needed is for indicates whether the capture data
the Left channel or Right channel in waiting is for the Left channel or
all data formats except ADPCM. In Right channel in all audio data for-
ADPCM it indicates whether the first mats except ADPCM. In ADPCM it
two or last two bytes of a 4-byte set indicates whether the first two or last
(8 ADPCM samples) are needed. two bytes of a 4-byte set (8 ADPCM
samples) are waiting.
0 - Right or 3/4 ADPCM byte needed
1 - Left, Mono, or 1/2 ADPCM byte 0 - Right or 3/4 ADPCM byte available
needed 1 - Left, Mono, or 1/2 ADPCM byte
available
PU/L Playback Upper/Lower Byte: This bit
indicates whether the playback data CU/L Capture Upper/Lower Byte: This bit
needed is for the upper or lower indicates whether the capture data
byte of the channel. In ADPCM it in- ready is for the upper or lower byte
dicates, along with PL/R, which one of the channel. In ADPCM it indi-
of the four ADPCM bytes is needed. cates, along with CL/R, which one of
four ADPCM bytes is available.
0 - Lower or 1/3 ADPCM byte needed
1 - Upper, any 8-bit format, or 2/4 0 - Lower or 1/3 ADPCM byte
ADPCM byte needed. available
1 - Upper, any 8-bit format, or 2/4
SER Sample Error: This bit indicates that a ADPCM byte available
sample was not serviced in time and
an error has occurred. The bit indi-
cates an overrun for capture and Note on PRDY/CRDY: These two bits are de-
underrun for playback. If both the signed to be read as one when action is required
capture and playback are enabled,
by the host. For example, when PRDY is set to
the source which set this bit can not
be determined. However, the Alter- one, the device is ready for more data; or when
nate Feature Status register (I24) the CRDY is set to one, data is available to the
can indicate the exact source of the host. The definition of the CRDY and PRDY bits
error. are therefore consistent in this regard.
CRDY Capture Data Ready. The Capture
Data register (R3) contains data I/O DATA REGISTERS
ready for reading by the host. This The PIO Data register is two registers mapped to
bit would be used for direct pro- the same address. Writes to this register sends
grammed I/O data transfers.
data to the Playback Data register. Reads from
0 - Data is stale. Do not reread the this register will receive data from the Capture
information. Data register.
1 - Data is fresh. Ready for next
host data read. During initialization and software power down
of the WSS Codec, this register CANNOT be
written and is always read 10000000 (80h)
34 DS215PP4
CS4238B
During initialization and software power down LMGE This bit has no function in MODE 3.
of the WSS Codec, this register can NOT be In MODEs 1 & 2 it controls the
20 dB gain boost for the left MIC in-
written and is always read 10000000 (80h) put to the ADC.
DS215PP4 35
CS4238B
36 DS215PP4
CS4238B
DS215PP4 37
CS4238B
38 DS215PP4
CS4238B
C/L, FMT1, and FMT0 bits set the audio data format ables PIO capture mode. CEN may
as shown below. In MODE 1, FMT1, be set and reset without setting the
which is forced low, FMT0, and C/L MCE bit.
are used for both playback and cap-
ture. In MODEs 2 and 3, these bits 0 - Capture Disabled (capture DRQ
are only used for playback, and the and PIO inactive)
capture format is independently se- 1 - Capture Enabled
lected via register I28. MCE (R0) or
PMCE (I16) must be set to modify SDC Single DMA Channel: This bit will force
the upper four bits of this register. BOTH capture and playback DMA re-
See Changing Audio Data Formats quests to occur on the Playback
section for more details. DMA channel. This bit forces the
WSS Codec to use one DMA chan-
FMT1† FMT0 C/L Audio Data Format nel. Should both capture and
D7 D6 D5 playback be enabled in this mode,
0 0 0
only the playback will occur. See the
Linear, 8-bit unsigned
DMA Interface section for further ex-
0 0 1 µ-Law, 8-bit companded planation.
0 1 0 Linear, 16-bit two’s
complement, Little Endian 0 - Dual DMA channel mode
0 1 1 A-Law, 8-bit companded 1 - Single DMA channel mode
1 0 0 RESERVED
1 0 1 ADPCM, 4-bit, IMA compatible CAL1,0 Calibration: These bits determine
1 1 0 Linear, 16-bit two’s which type of calibration the WSS
complement, Big Endian Codec performs whenever the Mode
1 1 1 Change Enable (MCE) bit, R0,
RESERVED
changes from 1 to 0. The number of
sample periods required for calibra-
† FMT1 is not available in MODE 1 (forced to 0). tion is listed in parenthesis.
CEN Capture Enabled. This bit enables the Caution: This register, except bits CEN and
capture of data. The WSS Codec PEN, can only be written while in Mode Change
will generate a DRQ and respond to
Enable (either MCE or PMCE). See the Chang-
DACK signal when CEN is enabled
and CPIO=0. If CPIO=1, CEN en- ing Sampling Rate section for more details.
DS215PP4 39
CS4238B
res Reserved. Must write 0. Could read 0 - TTL logic low on XCTL1,0 pins
as 0 or 1. 1 - TTL logic high on XCTL1,0 pins
IEN Interrupt Enable: This bit enables the Error Status and Initialization (I11, Read Only)
interrupt pin. The Interrupt pin will re-
flect the value of the INT bit of the Default = 00000000
Status register (R2). The interrupt D7 D6 D5 D4 D3 D2 D1 D0
pin is active high. COR PUR ACI DRS ORR1 ORR0 ORL1 ORL0
40 DS215PP4
CS4238B
DS215PP4 41
CS4238B
Alternate Feature Enable I (I16) OLB Output Level Bit: Provided for back-
Default = 00000000 wards compatibility with the CS4236.
This bit does nothing on this chip.
D7 D6 D5 D4 D3 D2 D1 D0
OLB TE CMCE PMCE SF1 SF0 SPE DACZ
Alternate Feature Enable II (I17)
DACZ DAC Zero: This bit will force the out-
put of the playback channel to AC Default = 0000x000
zero when an underrun error occurs D7 D6 D5 D4 D3 D2 D1 D0
TEST TEST TEST TEST APAR res XTALE HPF
1 - Go to center scale
0 - Hold previous valid sample HPF High Pass Filter: This bit enables a
DC-blocking high-pass filter in the
SPE DSP Serial Port Enable. When digital filter of the ADC. This filter
set, audio data from the ADCs is forces the ADC offset to 0.
sent out SDOUT and audio data
from SDIN is sent to the DACs. 0 - disabled
MCE in R0 must be set to change 1 - enabled
this bit.
XTALE Crystal Enable. Provided for back-
1 - Enable serial port wards compatibility with the
0 - Disable serial port. ISA Bus CS4231A. This bit does nothing on
used for audio data. the this part.
SF1,SF0 Serial Format. Selects the format of res Reserved. Must write 0. Could read
the serial port when enabled by as 0 or 1.
SPE. MCE in R0 must be set to
change these bits. APAR ADPCM Playback Accumulator Reset.
While set, the Playback ADPCM
0 - 64-bit enhanced. Figure 9. accumulator is held at zero. Used
1 - 64-bit. Figure 10. when pausing a playback stream.
2 - 32-bit. Figure 11.
3 - ADC/DAC. Figure 12. TEST Factory Test. These bits are used for
factory testing and must remain at 0
PMCE Playback Mode Change Enable. for normal operation.
When set, it allows modification of
the stereo/mono and audio data for-
42 DS215PP4
CS4238B
This register controls either the left LINE input or is LR7-LR0 Left Remapped Register.
remapped to control the internal FM (X6) or external
CS9236 Wavetable synthesizer (X16), or both. When When IFM=1 and FMRM=1, writes
no remapping occurs, the bit definitions are: to I18 will write the Internal FM regis-
ter X6.
LLG4-LLG0 Left LINE Volume. This register is
used to control the LLINE analog in- When WTEN=1 and WTRMD=0,
put volume to the mixers. The least writes to I18 will write the Wavetable
significant bit represents 1.5 dB, with synthesis register X16.
01000 = 0 dB. See Table 10.
Right Line (Synthesizer) Volume (I19)
LLBM Left LINE Bypass Mute. In MODE 3,
when set to 1, the analog Left Line Default = xxxxxxxx
Input, LLINE, (bypassing the gain D7 D6 D5 D4 D3 D2 D1 D0
block) to the input mixer is muted. RLOM RLIM RLBM RLG4 RLG3 RLG2 RLG1 RLG0
In MODEs 1 & 2, this bit is not avail- RR7 RR6 RR5 RR4 RR3 RR2 RR1 RR0
able and is internally controlled by
LSS1,0 in I0. This register controls either the right LINE input or is
remapped to control the internal FM (X7) or external
LLIM Left LINE Input Mute. In MODE 3, CS9236 Wavetable synthesizer (X17), or both. When
when set to 1, the Left Line Input, no remapping occurs, the bit definitions are:
LLINE, from the volume control to
the input mixer is muted. RLG4-RLG0 Right LINE Volume. This register is
In MODEs 1 & 2, this bit is not avail- used to control the RLINE analog in-
able and internally forced on (muted). put volume to the mixers. The least
significant bit represents 1.5 dB, with
LLOM Left LINE Output Mute. 01000 = 0 dB. See Table 10.
When set to 1, the Left Line Input,
LLINE, from the volume control to RLBM Right LINE Bypass Mute. In MODE 3,
the output mixer is muted. when set to 1, the analog Right Line
Input, RLINE, (bypassing the gain
block) to the input mixer is muted.
In MODEs 1 & 2, this bit is not avail-
To Output
Mixer able and is internally controlled by
LLINE LLOM RSS1,0 in I1.
LLG4-G0
(Synthesis) To Input
LLIM Mixer
+12 to -34.5 dB
LLBM
DS215PP4 43
CS4238B
RLOM Right LINE Output Mute. TU7-TU0 Upper Timer Bits: This is the high
When set to 1, the Right Line Input, order byte of the 16-bit timer. The
RLINE, from the volume control to time base is determined by the fre-
the output mixer is muted. quency base selected from either
To Output C2SL in I8 or CS2 in I22.
RLOM Mixer
RLINE RLG4-G0 C2SL = 0 - 24.576MHz / 245
(Synthesis) To Input (9.969 µs)
RLIM Mixer
+12 to -34.5 dB C2SL = 1 - 16.9344MHz / 168
(9.92 µs)
RLBM
When IFM=1 and FMRM=1, FM remapping is en-
abled. When WTEN=1 and WTRMD=0, Wavetable Alternate Sample Frequency Select (I22)
remapping is enabled. If either synthesizer remap is Default = 00000000
enabled, right LINE analog volume is controlled D7 D6 D5 D4 D3 D2 D1 D0
through X1. With remapping the bit definitions are: SRE DIV5 DIV4 DIV3 DIV2 DIV1 DIV0 CS2
44 DS215PP4
CS4238B
XA3-XA0 Extended Register Address. Along The PI, CI, and TI bits are reset by writing a "0"
with XA4, sets the register number to the particular interrupt bit or by writing any
(X0-X17+X25) accessed when value to the Status register (R2).
XRAE is set. MODE 3 only. See the
WSS Extended Register section for
more details.
DS215PP4 45
CS4238B
0 - no mute
Mono Input and Output Control (I26) 1 - muted
Default = 101x0000
D7 D6 D5 D4 D3 D2 D1 D0
MIM MOM MBY res MIA3 MIA2 MIA1 MIA0
46 DS215PP4
CS4238B
res Reserved. Must write 0. Could read res Reserved. Must write 0. Could read
as 0 or 1. as 0 or 1.
res Reserved. Must write 0. Could read CUB7-CUB0 Capture Upper Base: This register is
as 0 or 1. the upper byte which represents the
8 most significant bits of the 16-bit
S/M Stereo/Mono Select: This bit deter- Capture Base register. Reads from
mines how the capture audio data this this register returns the same
stream is formatted. Selecting stereo value that was written.
will result with alternating samples
representing left and right audio
channels. Selecting mono only cap-
Capture Lower Base (I31)
tures data from the left audio Default = 00000000
channel. MCE (R0) or CMCE (I16) D7 D6 D5 D4 D3 D2 D1 D0
must be set to modify S/M. See CLB7 CLB6 CLB5 CLB4 CLB3 CLB2 CLB1 CLB0
Changing Audio Data Formats sec-
tion for more details. CLB7-CLB0 Lower Base Bits: This register is the
lower byte which represents the 8
0 - Mono least significant bits of the 16-bit
1 - Stereo Capture Base register. Reads from
this register returns the same value
C/L, FMT1, FMT0 set the capture data format in which was written.
MODEs 2 and 3. See Table 11 or
register I8 for the bit settings and
data formats. The capture data for-
mat can be different than the
playback data format; however, the
sample frequency must be the same
and is set in I8. MCE (R0) or CMCE
(I16) must be set to modify this regis-
ter. See Changing Audio Data
Formats section for more details.
DS215PP4 47
CS4238B
48 DS215PP4
CS4238B
DS215PP4 49
50
s
s
shows the active bit(s) for the Mute I2L, I3R
s
s
s
s
s
register function specified
s
Mute I2L, I3R Gain I2L AUX1
I3R (LINE IN)
s
Analog Input
s
s
s
s
s
Mixer Atten. Mute I4L, I5R Gain I4L AUX 2
16-bit Gain I0L X4L I5R (CDROM)
s
SRC
A/D I1R X5R
s
s
s
s
s
Mute I18L, I19R
s
s
s
s
*
s
s
s
Atten. X8L Loopback Atten. Mute I18L, I19R Gain I18L LINE
X9R I13L & (R) * * I19R (Syn.)
s
s
s
s
s
s
s
s
s
s
s
s
X10 Stereo Enable
s
s
s
s
s
s
Mute
s
s
s
s
s
s
s
s
X9R Loopback enable I13 X11R
s
PnP ISA Interface
20dB X2L
s
s
s
Mute I6L 16 bit Gain X14L Loopback
Mute I2L, I3R
I7R DSP X15R I0L, I1R
D/A
s
s
s
s
s
s
Mute I4L, I5R
s
s
s
s
s
s
Mute X6L Mute I18L, I19R
Atten. I6L Mute X16L
* X7R Analog *
I7R * X17R
s
s
Master LINE
Atten. X6L X15R
Volume OUT
s
* X7R Mute
SRC Gain X16L Mixer
s
s
s
s
s
s
I26L
s
* X17R X5R
Mute I26L
s
s
s
s
s
s
Atten.
s
MONO
Atten. I26 -9db
Wavetable Serial Port OUT
* I18/I19 can be remapped to control
s
s
s
s
C8
s
CS4238B
DS215PP4
Left LINE Alternate Volume (X0) Right LINE Alternate Volume (X1)
Default = 11101000 Default = 11101000
D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
LLAOM LLAIM LLBAM LLAG4 LLAG3 LLAG2 LLAG1 LLAG0 RLAOM RLAIM RLABM RLAG4 RLAG3 RLAG2 RLAG1 RLAG0
LLAG4-LLAG0 Left LINE Alternate Volume. This RLAG4-RLAG0 Right LINE Alternate Volume.
register is used to control the LLINE This register is used to control the
analog input volume to the mixers RLINE analog input volume to the
when I18 is remapped to control FM mixers when I19 is remapped to con-
and/or Wavetable Serial Port vol- trol FM and/or Wavetable Serial Port
ume. The remapping bits are FMRM volume. The remapping bits are
and WTRMD (X4). The least signifi- FMRM and WTRMD in X4. The
cant bit represents 1.5 dB, with least significant bit represents
01000 = 0 dB. See Table 10. 1.5 dB, with 01000 = 0 dB.
See Table 10.
LLABM Left LINE Alternate Bypass Mute.
When set to 1, the analog Left Line RLABM Right LINE Alternate Bypass Mute.
Input, LLINE, (bypassing the gain When set to 1, the analog Right Line
block) to the input mixer is muted. Input, RLINE, (bypassing the gain
block) to the input mixer is muted.
LLAIM Left LINE Alternate Input Mute.
When set to 1, the Left Line Input, RLAIM Right LINE Alternate Input Mute.
LLINE, from the volume control to When set to 1, the Right Line Input,
the input mixer is muted. RLINE, from the volume control to
the input mixer is muted.
LAOM Left LINE Alternate Output Mute.
When set to 1, the Left Line Input, RLAOM Right LINE Alternate Output Mute.
LLINE, from the volume control to When set to 1, the Right Line Input,
the output mixer is muted. RLINE, from the volume control to
the output mixer is muted.
To Output
LLAOM Mixer
LLINE LLAG4-G0 To Output
(Synthesis) To Input RLAOM Mixer
RLINE RLAG4-G0
LLAIM Mixer (Synthesis) To Input
+12 to -34.5 dB
RLAIM Mixer
+12 to -34.5 dB
LLABM
RLABM
DS215PP4 51
CS4238B
To Output
Mixer
Left MIC Volume (X2) RMIC RMOM +20 dB
RMG4-G0 RMBST
Input To Input
Default = 11001111 Mixer
RMIM
D7 D6 D5 D4 D3 D2 D1 D0 +22.5 to -22.5 dB
LMIM LMOM LMBST LMG4 LMG3 LMG2 LMG1 LMG0
LMG4-LMG0 Left Microphone Gain. Synthesis and Input Mixer Control (X4)
The least significant bit represents
1.5 dB, with 01111 = 0 dB. Default = 100001xx
See Table 13. D7 D6 D5 D4 D3 D2 D1 D0
MIMR LIS1 LIS0 IFM WTRMD FMRM res res
LMBST Left Microphone 20 dB boost.
When set to 1, the signal to the out- res Reserved. Must write 0. Could be
put mixer is given a 20 dB boost. read as 0 or 1.
LMOM Left Microphone Output Mixer Mute. FMRM FM Volume Control Remap. This bit
When set to 1, the signal to the out- only functions when IFM = 1.
put mixer is muted.
If FMRM = 1, internal FM Synthesis
LMIM Left Microphone Input Mixer Mute. volume is controlled by I18/I19
When set to 1, the signal to the in- (writes to I18/I19 get remapped to
put mixer is muted. X6/X7). Analog LINE volume is con-
trolled by X0/X1.
To Output
+20 dB Mixer
LMIC LMOM If FMRM = 0, internal FM synthesis
LMG4-G0 LMBST
Input To Input volume is controlled by X6/X7 only.
Mixer
LMIM
+22.5 to -22.5 dB
WTRMD WaveTable Volume Remap Disable.
This bit only functions when
WTEN = 1 (C8/Global Config. byte).
Right MIC Volume (X3)
Default = 11001111 If WTRMD = 0, the Wavetable Serial
D7 D6 D5 D4 D3 D2 D1 D0 Port volume is controlled by I18/I19
RMIM RMOM RMBST RMG4 RMG3 RMG2 RMG1 RMG0 (writes to I18/I19 get remapped to
X16/X17). Analog LINE volume is
controlled by X0/X1.
RMG4-RMG0 Right Microphone gain.
The least significant bit represents
If WTRMD = 1, the Wavetable Serial
1.5 dB, with 01111 = 0 dB.
Port volume is controlled by
See Table 13.
X16/X17 only.
RMBST Right Microphone 20 dB boost. NOTE: If FMRM = 1, and
When set to 1, the signal to the out- WTRMD = 0, I18/I19 control both in-
put mixer is given a 20 dB boost. ternal FM and Wavetable Serial Port
volume.
RMOM Right Microphone Output Mixer Mute.
When set to 1, the signal to the out- IFM Internal FM enable. When set to 1,
put mixer is muted. the internal FM synthesis engine is
enabled. Setting this bit also
RMIM Right Microphone Input Mixer Mute. changes I6/7 from the master digital
When set to 1, the signal to the in- audio volume to the ISA bus wave
put mixer is muted. volume control. X14/15 becomes the
52 DS215PP4
CS4238B
master digital audio volume. This bit res Reserved. Must write 0. Could read
can be set through the Hardware as 0 or 1.
Configuration data in the EEPROM.
LFMM Left FM mute. When set to 1, the
LIS1-LIS0 Left Input Mixer Summer Attenuator. left internal FM input to the digital
This attenuates the inputs to the left mixer is muted.
input mixer to enable overload pro-
tection when multiple input sources
are utilized. The least significant bit Internal FM
LFMA5-A0 To Digital Mixer
Synthesizer LFMM
represents 6 dB of attenuation, Summer
where 00 yields 0 dB of attenuation.
0 to -94.5 dB
See Table 8.
DS215PP4 53
CS4238B
LSPM Left DSP Serial Port Mute. When set SLBE Stereo LoopBack Enable. When set to
to 1, the Left DSP Serial Port input 1, control over the Left and Right
(SDIN) to the digital mixer is muted. loopback volume is separated.
RLBA5-RLBA0 (X10) control the
Right channel, and LBA5-LBA0 (I13)
Serial
LSPA5-A0 To Digital Mixer control the Left channel.
Port LSPM Summer When set to 0, LBA5-LBA0 (I13) con-
trol both channels.
0 to -94.5 dB
54 DS215PP4
CS4238B
SRDA7-SRDA0 Sample Rate frequency select for This register becomes the master digital audio vol-
the D/A converter. This register is ume control for the left channel when either IFM or
only in effect (and can only be writ- WTEN is set to one.
ten) while IFSE=1 in X11. See Table
15. RDMG6-RDMG0 Right Digital Master Mixer Attenu-
ation. The least significant bit
represents 1.5 dB, with 000000 =
Left Master Digital Audio Volume (X14) 0 dB. See Table 12.
Default = 00000000
D7 D6 D5 D4 D3 D2 D1 D0 RDMOM Right Digital Master Output Mixer Mute.
LDMOM LDMG6 LDMG5 LDMG4 LDMG3 LDMG2 LDMG1 LDMG0 When set, the Right DAC output is
muted to the Right output mixer.
This register becomes the master digital audio vol- Note: This bit is controlled
ume control for the left channel when either IFM or by register (X11)
WTEN is set to one. Digital Analog
To Input
From Digital Mixer
LDMG6-LDMG0Left Digital Master Mixer Attenuation. Mixer DAC
RDMIM
Digital Analog
To Input
From Digital LDMIM Mixer
Mixer DAC
Summer To Output
LDMOM Mixer
0 to -60dB +12 to -34.5dB
LDMG6-G0
DS215PP4 55
CS4238B
Left Wavetable Serial Port Volume (X16) Chip Version and ID (X25)
Default = 00000000 Default = 11001001
D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
LWM res LWG5 LWG4 LWG3 LWG2 LWG1 LWG0 V2 V1 V0 CID4 CID3 CID2 CID1 CID0
This Wavetable volume register can also be control- This register was added to Revision C silicon. In revi-
led through I18 when WTEN=1 (C8 or Global Config. sion B, this register read 0x00.
byte) & WTRMD=0 (X4).
CID5-CID0 Chip Identification. Distinguishes
LWG5-LWG0 Left Wavetable Serial Port Gain. between this chip and other codec
Least significant bit represents chips that support this register set.
1.5 dB, with 01000 = 0 dB. This register is identical to C1 and
See Table 6. replaces the ID register in I25.
LWM Left Wavetable Serial Port Mute. V2-V0 Version Number. As enhancements
When set, the Left Wavetable Serial are made, the version number is
Input to the digital mixer is muted. changed so software can distinguish
between the different versions of the
same chip.
Right Wavetable Serial Port Volume (X17)
Default = 00000000 000 - Revision B
D7 D6 D5 D4 D3 D2 D1 D0 110 - Revision C/D
RWM res RWG5 RWG4 RWG3 RWG2 RWG1 RWG0 111 - Revision E
56 DS215PP4
CS4238B
DS215PP4 57
CS4238B
MIC
MIC V A
AUX1
LINE O D
LINE
FM L C
CD DIG
ATTN
VOL
A
U
X
1
Σ
U
LINE OUT
X
2
L
I
N
E
D V
DIG VOICE Σ A O
C L
V
MONO IN
PC SPEAKER O
L
Register D7 D6 D5 D4 D3 D2 D1 D0
00H DATA RESET
02H RESERVED
04H VOICE VOLUME LEFT VOICE VOLUME RIGHT
06H RESERVED
08H RESERVED
0AH X X X X X MIC MIXING
0CH X X X INPUT SELECT X
0EH X X X X X X VSTC X
20H RESERVED
22H MASTER VOLUME LEFT MASTER VOLUME RIGHT
24H RESERVED
26H FM VOLUME LEFT FM VOLUME RIGHT
28H CD VOLUME LEFT CD VOLUME RIGHT
2AH RESERVED
2CH RESERVED
58 DS215PP4
CS4238B
DS215PP4 59
CS4238B
60 DS215PP4
CS4238B
Address Register
PM1,0 Power Management. These bits are
CTRLbase+0 Joystick & Power Control
provided for backwards compatibility.
CTRLbase+1 E2PROM Interface For new designs, the bits in
CTRLbase+2 Block Power Down CTRLbase+2 should be used.
CTRLbase+3 Control Indirect Address Reg.
CTRLbase+4 Control Indirect Data Register 00 - All functions active.
CTRLbase+5 Control/RAM Access 01 - A/D and D/A powered down.
Mixer still active, but volume reg-
CTRLbase+6 RAM Access End
isters are frozen. Disables PDC
CTRLbase+7 Global Status and PDM bits.
10 - Full part power down. All
Table 21. Control Logical Device Registers functions are disabled except
reads and writes to this register.
All internal logic, including PnP
config. registers are reset. To exit
Joystick and Power Control this power-down mode, PM1/0
CTRLbase + 0, Default = 00000000 must be reset, through CTRLbase+
D7 D6 D5 D4 D3 D2 D1 D0 0, and then the entire chip must be
PM1 PM0 CONSW PDC PDP PDM JR1 JR0 reinitialized.
11* - WSS Codec, SBPro, MPU-401,
JR1,0 Joystick rate control. Selects operating and PnP interfaces, and the analog
speed of the joystick (changes the mixer are powered down.
trigger threshold for the X/Y coordi-
nates).
* NOTE: The SBPro, PnP, and MPU-401 interfaces
00 - slowest speed are linked together. Setting PM1,0 or PDP will power
01 - medium slow speed all three interfaces down; however, if any one of the
10 - medium fast speed interfaces is written to, they will all power back up
11 - fastest speed automatically. PM1,0 and PDP always reflects the
value written, not whether the three devices are pow-
ered up or not.
DS215PP4 61
CS4238B
62 DS215PP4
CS4238B
DS215PP4 63
CS4238B
CR7-CR0 This register controls the loading of res Reserved. Could read as 0 or 1.
the part’s internal RAM. RAM sup-
port includes hardware configuration IMPU MPU-401 Interrupt status.
and PnP default resource data, as
well as program memory. See the 0 - no interrupt pending
Hostload Procedure section for more 1 - an interrupt is pending
information. Commands are followed
by address and data information. IWSS Windows Sound System Interrupt
status.
Commands: 0x55 - Disable PnP Key
0 - no interrupt pending
0x56 - Disable Crystal Key 1 - an interrupt is pending
64 DS215PP4
CS4238B
01001 - CS4238B
101 - Revision B
110 - Revision C/D
111 - Revision E
DS215PP4 65
CS4238B
3DV3-3DV0 QXpander processed "Volume". res Reserved. Must write 0. Could read
The least significant bit represents as 0 or 1.
1.5 dB attenuation, with 0000=0 dB.
See Table 24. V The Validity bit in a sub-frame of
digital audio data.
SPC3-SPC0 QXpander processed "Space".
The least significant bit represents U The User bit in a sub-frame of digital
1.5 dB attenuation, with 0000=0 dB. audio data.
See Table 24.
CSBR Channel Status Block Reset. When
set, resets the channel status block
3D Enable (C3) boundary.
Default = 0x0xxxxx
D7 D6 D5 D4 D3 D2 D1 D0 CSPE Consumer Serial Port Enable. When
res res 3DSO QSEN res res res res set, the serial port output format con-
verts to the consumer standard for
res Reserved. Must write 0. Could read digital audio transmission, compat-
as 0 or 1. ible with the consumer portion of
IEC-958. An older version of the
QSEN QSound Enable. Must be set to 1 to standard is also called S/PDIF. Note
enable the QXpander 3D Sound that the serial port is still enabled us-
DSP. ing the SPE bit in WSS I16. For
more information on the consumer
3DSO 3D Serial Output. When set, SDOUT digital audio transmission format see
data comes from the DAC inputs Crystal’s Application Note 22 titled
which includes 3D effects. Typically Overview of Digital Audio Interface
used when CSPE in C4 is set and Data Structures.
determines the data used on the
Consumer Serial Port output pin.
66 DS215PP4
CS4238B
res Reserved. Must write 0. Could read CS8-CS14 Category Code channel status bits.
as 0 or 1. Note that CS8 and CS9 are con-
tained in register C5. These bits
CS1 Channel Status bit 1: Audio. When define the type of product transmit-
clear, indicates that the transmitted ting and are used in the SCMS copy
data is digital audio and suitable for protection scheme to interpret the L
conversion to an analog signal. bit.
DS215PP4 67
CS4238B
68 DS215PP4
CS4238B
expansion effect can be heard at a single listener sounds to the far left and the other places sounds
location without having to move from side to to the far right, beyond the positions of the
side to hear various audio images. physical speakers.
QXpander is a patented process that works with The left stereo input channel is applied to the
any existing stereo recorded material. QXpander left placement processor and the right channel
is not required in the recording process. This connects to the right placement processor. The
means a listener’s entire audio library can be en- amount of processed signal summed into the out-
hanced by QXpander by simply playing it puts can be increased using SPC3-0 to increase
through the CS4238B Crystal chip. Like stereo, the expansion effect. These outputs are summed
any two-speaker stereo system is adequate. internally such that the output is a single two-
channel stereo mix.
Other notable features of Crystal’s CS4238B
QXpander DSP include: Built around the two processors is a special net-
work that allows mono (equal in both channels)
• Elements of the stereo image that are widely information to bypass both processors and be re-
placed in the original stereo mix will appear well combined with the output. Without this
beyond the physical speaker positions, at the pe- arrangement, mono information would be ap-
riphery of the new QSpaceTM sound field. plied, unattenuated, to both left and right
modified Q1 processors, creating undesirable
• The remaining elements of the mix will appear side effects.
in the same relative positions as in the original
source material, but will be expanded propor- QXpander Space Control
tionately. The QXpander Space adjustment, SPC3-0 in C2,
controls the digital output levels from the modi-
• Mono (center) information will remain solid, fied Q1 processors. These outputs contain the
natural-sounding, and properly positioned. spatial information that allows us to perceive
sounds from coming all around and the direc-
• Correct loudness balance of the various sounds tional cues that we use to determine the
in a recording are maintained. localization of those sounds.
• Provides excellent imaging of panned sounds. Turning up the Space control increases the
amount of processed directional information, re-
• Correct frequency content compared to the stores the proper localization of the original
original recording is maintained. sounds, and expands the width of the overall
sound stage. Turning down the Space control at-
The QXpander 3D Stereo Process tenuates the processed signal components and
The patented QSound QXpander architecture es- thus limits the intensity of these effects.
sentially consists of a pair of modified Q1
localization processors with a special mono-han- QXpander 3D sound is enabled by setting QSEN
dling network as illustrated in Figure 7. in C3 to 1. Although proper listening levels are
subjective and program dependent, QSound Labs
The two modified Q1 processors are configured has found that subtler settings are better suited to
to locate sounds on opposite sides: one places
DS215PP4 69
CS4238B
high fidelity applications such as music listening, Unfortunately there is no universal 3D algorithm
whereas more extreme settings are ideal for that is equally effective in both cases. QXpander,
video games. as implemented in the CS4238B Crystal chip, is
designed for speaker listening. Auditioning
The QXpander algorithm requires a stereo input QXpander-processed material over headphones is
in order to produce spatially broadened output. If in no way objectionable except that the expan-
adjusting the Space control yields no change in sion effect is lost.
the sound image, the input signal is probably
mono. QSound Virtual Audio Guide to Optimal
Listening
QXpander 3D Volume Control
These guidelines will help you get the maximum
The QXpander 3D Volume adjustment, 3DV3-0 enjoyment from your stereo system. Since
in C2, determines the overall level of the final QXpander is a stereo process, the following will
left and right digital signals going to the DACs. provide optimum results from Qsound Virtual
Audio. The aim of the following suggestions is
Speakers vs. Headphones simply to set up the playback system symmetri-
Most audio parameters relating to timbre, rela- cally, so that both left and right speakers are
tive volume, etc. are considered essentially similarly arranged.
equivalent on speakers and headphones. 3D
audio is somewhat unique in this respect. This • Both speakers should be placed at the same
uniqueness is a result of the mechanics of sound distance from the listening position.
location in human listeners and the fact that the
transfer of sound from the transducers to the lis- • Both speakers should be at the same angle,
tener’s ears is characterized by significant (Facing straight forward or turned slightly to-
differences between loudspeaker and headphone ward the listening position; whichever is
listening. preferred.) and same height.
Modified L
Σ
L
Q1
Filter
Master Digital
Σ
R Modified
Q1
Filter R
SPC3-0 3DV3-0
70 DS215PP4
CS4238B
• The speakers should not be too far apart. The SDOUT pin can either be on joystick B’s
For example, in a multimedia setup, they CX pin or it can be on the peripheral port data
should be just to either side of the video bus pin XD3, controlled by the SPS bit in the
monitor. Hardware Configuration data or register C8.
• If the system has a balance control, it The data going out SDOUT can come from the
should be centered. If, on the other hand, ADC or from the DAC interface (which includes
each speaker has its own volume control, QSound 3D Sound if enabled). This functionality
they should be adjusted so that the speakers is controlled by the 3DSO bit in register C3.
are as closely matched in relative volume as
possible. For the receiving device to function properly, the
Channel Status bits in C5 and C6 must be set
• The speakers must be in phase. Most multi- properly. See the Sanchez AES paper An Under-
media speakers use connectors that standing and Implementation of the SCMS Serial
automatically ensure proper phasing, but Copy Management System for Digital Audio
some systems (e.g. home stereos) having Transmission for more details on setting the
separate speakers and amplifier use two ter- Channel Status information.
minals for each connection point. Care
should be taken to make sure the phasing is Figure 8 illustrates the circuit necessary for im-
correct. plementation of the IEC-958 consumer interface.
An external buffer is required to drive the cur-
Although stereo imaging can be heard off axis, rent needed to drive the 75 Ω interface (415 Ω
the best listening location for stereo effects, in- or 12 mA).
cluding dramatic sound stage broadening, is
centered between the speakers. By properly con- 374 Ω
figur ing the playback system, maximum SDOUT
enjoyment of the QSound QXpander audio en- RCA
hancement, built into the CS4238B Advanced 90.9 Ω
Phono
Audio System, can be achieved.
DS215PP4 71
CS4238B
72 DS215PP4
CS4238B
DS215PP4 73
CS4238B
volume is applied to the PCM FM data, it is as the Yamaha OPL3LS, or the Crystal Semicon-
summed into the digital mixer which is then ductor CS9233 wave-table synthesizer chip. This
summed into the analog output mixer. interface consists of:
74 DS215PP4
CS4238B
DS215PP4 75
CS4238B
FSYNC
SCLK ...
SDOUT 15 14 13 12 ... 0 15 14 ... 0 8 zeros INT 7 zeros CEN PEN OVR 13 zeros
FSYNC
FSYNC
16 Clocks 16 Clocks
Left Data Right Data Left Data
DS215PP4 77
CS4238B
The third serial format - SPF2, shown in Fig- ADC and DAC data on the SDOUT allows ex-
ure 11, is called 32-bit mode. This format has 32 ternal modem DSPs to cancel the local audio
SCLKs per frame and FSYNC is high for the source from the local microphone signal.
left channel and low for the right channel. The
absolute time is similar to the other two modes CS9236 WAVETABLE SERIAL PORT
but SCLK is stopped after the right channel is A digital interface to the Crystal CS9236 Single-
finished. SCLK is held stopped until the start of Chip Wavetable Music Synthesizer is provided
the next frame (stopped for 32 bit period times). that allows the CS9236 PCM audio data to be
This mode is useful for DSPs that do not want summed digitally into the output digital mixer.
the interrupt overhead of the 32 unused bit peri- The Wavetable Serial port pins are multiplexed
ods. As an example, if a DSP serial word length with the XD7-XD5 external bus pins; therefore,
is 16 bits, then four interrupts will occur in SPF0 when this serial interface is enabled, any external
and SPF1 modes. In mode SPF2 the DSP will peripheral (CDROM, modem, etc.) will need an
only be interrupted twice. external buffer to the ISA bus. This serial port is
enabled via the WTEN bit located in Control
The fourth serial format - SPF3, shown in Fig- register C8 or in the Global Configuration byte
ure 12, is called ADC/DAC mode. This format in the Hardware Configuration data. The hard-
has 64 SCLKs per frame, with FSYNC high ware connections to the CS9236 are illustrated in
transitions at the start of the left ADC data word Figure 13.
and low transitions at the start of the right ADC
data word. For serial data in, SDIN, both the left Volume control for the serial port is supported
and right 16-bit DAC data word should be fol- through X16 and X17 in the WSS extended reg-
lowed by zeros. For serial data out, SDOUT, ister space. The volume range is +12 dB to
both the left and right ADC data words are fol- -82.5 dB with 001000 equal to 0 dB. After vol-
lowed by 16 bits of the DAC data words. The ume is applied to the PCM data, it is summed
DAC data words are tapped off the data stream into the digital mixer which is then summed into
right before the data enters the Codec DACs (af- the analog output mixer.
ter all digital summing is done). Having the
FSYNC
78 DS215PP4
CS4238B
DS215PP4 79
CS4238B
80 DS215PP4
CS4238B
with the rest of the bits in I22, are used to set the The WSS Codec always orders the left channel
sample frequency. Once enabled, these bits can data before the right channel. Note that these
be changed without doing an MCE cycle. definitions apply regardless of the specific for-
mat of the data. For example, 8-bit linear data
The third method supports independent sample streams look exactly like 8-bit companded data
frequencies (Fs) for capture and playback. The streams. Also, the left sample always comes first
independent sample frequency mode is enabled in the data stream regardless of whether the sam-
by setting IFSE in X11. Once enabled, the other ple is 16-bit or 8-bit in size.
two methods for setting Fs (I8, I10, and I22) are
disabled. The capture (ADC) Fs is set in X12 There are four data formats supported by the
and the playback (DAC) Fs is set in X13. WSS Codec during MODE 1 operation: 16-bit
signed (little endian), 8-bit unsigned, 8-bit com-
Changing Audio Data Formats panded µ-Law, and 8-bit companded A-Law.
In MODE 1, MCE must be used to select the See Figures 14-17.
audio data format in I8. Since MCE causes a
calibration cycle, it is not ideal for full-duplex Additional data formats are supported in MODE
operation. In MODE 2 and 3, individual Mode 2 and 3: 4-bit ADPCM, and 16-bit signed Big
Change Enable bits for capture and playback are Endian. See Figures 18 through 21. With the ad-
provided in register I16. MCE (R0) must still be dition of the Big Endian and ADPCM audio data
used to select the sample frequency, but PMCE formats, the WSS Codec is compliant with the
(playback) and CMCE (capture) allow changing IMA recommendations for digital audio data for-
the respective data formats without causing a mats (and sample frequencies).
calibration to occur. Setting PMCE (I16) clears
the playback FIFO and allows the upper four 16-BIT SIGNED
bits of I8 to be changed. Setting CMCE (I16) The 16-bit signed format (also called 16-bit 2’s
clears the capture FIFO and allows the upper complement) is the standard method of repre-
four bits of I28 to be changed. senting 16-bit digital audio. This format gives
96 dB theoretical dynamic range and is the
Audio Data Formats standard for compact disk audio players. This
In MODE 1 operation, all data formats of the format uses the value -32768 (8000h) to repre-
WSS Codec are in "little endian" format. This sent maximum negative analog amplitude, 0 for
format defines the byte ordering of a multibyte center scale, and 32767 (7FFFh) to represent
word as having the least significant byte occupy- maximum positive analog amplitude.
ing the lowest memory address. Likewise, the
most significant byte of a little endian word oc- 8-BIT UNSIGNED
cupies the highest memory address. The 8-bit unsigned format is commonly used in
the personal computer industry. This format de-
The sample frequency is always selected in the livers a theoretical dynamic range of 48 dB. This
Fs & Playback Data Format register (I8). In format uses the value 0 (00h) to represent maxi-
MODE 1 the same register, I8, determines the mum negative analog amplitude, 128 for center
audio data format for both playback and capture; scale, and 255 (FFh) to represent maximum
however, in MODE 2 and 3, I8 only selects the positive analog amplitude. The 16-bit signed and
playback data format and the capture data format 8-bit unsigned transfer functions are shown in
is independently selectable in the Capture Data Figure 22.
Format register (I28).
DS215PP4 81
CS4238B
MONO MONO
31 24 23 16 15 8 7 0
RIGHT LEFT
31 24 23 16 15 8 7 0
82 DS215PP4
CS4238B
DS215PP4 83
CS4238B
+FS
ANALOG VALUE
-FS
A-Law: 2Ah 15h 55h/D5h 95h AAh
u-Law: 00h 3Fh 7Fh/FFh BFh 80h
DIGITAL CODE
Figure 22. Linear Transfer Functions Figure 23. Companded Transfer Functions
84 DS215PP4
CS4238B
reading until the FIFO is empty, at which time For all data formats except ADPCM, the DMA
the requests will stop. When ACF is cleared, the Base registers must be loaded with the number
ADPCM adaptation will continue. of samples, minus one, to be transferred between
"DMA Interrupts". Stereo data contains twice as
When PEN is cleared (playback disabled), the many samples as mono data; however, 8-bit data
ADPCM block’s accumulator and step size are and 16-bit data contain the same number of sam-
cleared. When PEN is set, the ADPCM block ples. Symbolically:
will start converting. When pausing the playback
stream is desired, audio data should not be sent DMA Base register16 = NS - 1
to the codec which will cause a data underrun.
This can be accomplished by disabling the DMA Where NS is the number of samples transferred
controller or not sending data in PIO mode. The between interrupts and the "DMA Base regis-
underrun will be detected by the WSS Codec ter16" consists of the concatenation of the upper
and the adaptation will freeze. When data is sent and lower DMA Base registers.
to the codec, adaptation will resume. It is critical
that all playback ADPCM samples are sent to the For the ADPCM data format, the contents of the
codec, since dropped samples will cause errors DMA Base registers is calculated differently
in adaptation. Whereas toggling PEN resets the from any other data format. The Base registers
accumulator and step size, the APAR bit (I17) must be loaded with the number of BYTES to be
only resets the accumulator without affecting the transferred between "DMA interrupts", divided
step size. by four, minus one. The same equation is used
whether the data format is stereo or mono
DMA Registers ADPCM. Symbolically:
The DMA registers allow easy integration of this
part into ISA systems. Peculiarities of the ISA DMA Base register16 = Nb/4 - 1
DMA controller require an external count
mechanism to notify the host CPU of a full Where Nb is the number of BYTES transferred
DMA buffer via interrupt. The programmable between interrupts and the "DMA Base regis-
DMA Base registers provide this service. ter16" consists of the concatenation of the upper
and lower DMA Base registers.
The act of writing a value to the Upper Base
register causes both Base registers to load the PLAYBACK DMA REGISTERS
Current Count register. DMA transfers are en- The playback DMA registers (I14/15) are used
abled by setting the PEN/CEN bit while for sending playback data to the DACs in
PPIO/CPIO is clear. (PPIO/CPIO can only be MODE 2 and 3. In MODE 1, these registers
changed while the MCE bit is set.) Once trans- (I14/15) are used for both playback and capture;
fers are enabled, each sample that is transferred therefore, full-duplex DMA operation is not pos-
by a DMA cycle will decrement the Current sible.
Count register (with the exception of the
ADPCM format) until zero is reached. The next When the playback Current Count register rolls
sample after zero generates an interrupt and re- under, the Playback Interrupt bit, PI, (I24) is set
loads the Current Count registers with the values causing the INT bit (R2) to be set. The interrupt
in the Base registers. is cleared by a write of any value to the Status
register (R2), or writing a "0" to the Playback
Interrupt bit, PI (I24).
DS215PP4 85
CS4238B
86 DS215PP4
CS4238B
The Interrupt Enable (IEN) bit in the Pin Control Reference Design Data Sheet contains all the
register (I10) determines whether the interrupt schematics, layout plots and a Bill of Materials;
assigned to the WSS Codec responds to the in- thereby providing a complete example.
terrupt event. When the IEN bit is low, the
interrupt is masked and the IRQ pin assigned to Bus Interface
the WSS Codec is held low. However, the INT The ISA bus interface is capable of driving a
bit in the Status register (R2) always responds to 24mA data bus load and therefore does not re-
the counter. quire any external data bus buffering. See the
Reference Design Data Sheet for a typical con-
Error Conditions nection diagram.
Data overrun or underrun could occur if data is
not supplied to or read from the WSS Codec in Volume Control Interface
an appropriate amount of time. The amount of Three hardware master volume control pins are
time for such data transfers depends on the fre- supported: volume up, volume down, and mute.
quency selected within the WSS Codec. Hardware volume control is enabled by setting
the VCEN bit in the Hardware Configuration
Should an overrun condition occur during data data, byte 7 (Misc. Config. Byte). Once VCEN
capture, the last whole sample (before the over- is set, the SCS/UP pin converts to the volume up
run condition) will be read by the DMA function and the XCTL1/SINT/ACDCS/DOWN
interface. A sample will not be overwritten while pin converts to the volume down function. The
the DMA interface is in the process of transfer- volume control pins affect the master volume
ring the sample. control output after the analog output mixer. The
UP and DOWN pins, when low, increment and
Should an underrun condition occur in a play- decrement the master volume. These two pins
back case the last valid sample will be output would use SPST momentary switches. The
(assuming DACZ = 0) to the digital mixer. This MUTE pin supports three options: push-on/push-
will mask short duration error conditions. When off, momentary (similar to the up/down
the next complete sample arrives from the host functions), and non-existent where pressing up
computer the data stream will resume on the and down simultaneously mutes the output vol-
next sample clock. ume. As shown in Figure 24, the three pins
require external pullups and are active low. The
The overrun and underrun error bits in the Alter- circuit also contains an optional RC for EMI and
nate Feature Status register, I24, are cleared by ESD protection.
first clearing the condition that caused the over-
run or underrun error, followed by writing the The volume control range is +12 to -36 dB in
particular bit to a zero. As an example, to clear 2 dB steps. Pressing the up button, increments
the playback underrun bit PU, first a sample the volume. Pressing the down button, decre-
must be sent to the WSS Codec, and then the PU ments the volume. Holding either of these
bit must be written to a zero. buttons in the low state causes the volume to to
continue changing.
DIGITAL HARDWARE DESCRIPTION
The best example of hardware connection for the The mute function is supported using three for-
different sections of this part such as joystick mats. These formats are selected using the VCF1
connector, ISA bus, and peripheral port connec- and VCF0 bits in the Hardware Configuration
tions is the Reference Design Data Sheet. The data, Global Config. byte.
DS215PP4 87
CS4238B
Up Up Up
88 DS215PP4
CS4238B
range that is four bytes. If the address range is Software low-power states are available through
specified to be eight bytes, then XA2 becomes bits in the Control logical device register space.
an output for SA2 from the ISA bus. This part supports the same power down bits
contained in the CS4232; however, new power
Pin XCTL1/SINT/ACDCS/DOWN is initially down modes are provided in CTRLbase+2 that
controlled by the VCEN bit in the Hardware allow for a more efficient power management
Configuration data. If VCEN is zero, this pin be- routine. This register allows individual blocks
comes an output for XCTL1 when the state of within the part to be powered down. See the
the XIOW pin is sampled high during a high to CONTROL INTERFACE section for more infor-
low transition of the RESDRV pin. This pin also mation.
becomes an output for ACDCS if ACDbase is
programmed to a non-zero value. If XIOW is Multiplexed Pin Configuration
sampled low and ACDbase is never programmed On the high to low transition of the RESDRV
to a non-zero value, SINT becomes an input for pin, the part samples the state of the XIOR and
the external Synthesizer interrupt. XIOW has an XIOW pins. Both of these pins have internal
internal pullup resistor. ACDCS takes prece- 100kΩ pullups to +5V. If either of these pins is
dence over the other two functions. The first pulled low externally, they must be buffered be-
time ACDbase is programmed to a non-zero fore connecting to a TTL input (as in a CDROM
value, the pin converts to ACDCS. The only way port) since TTL cannot be pulled low.
to convert back to XTAL1 or SINT is to reset
the part. VCEN has the highest precedence and The state of XIOR at the time RESDRV is
will cause this pin to convert to the DOWN brought low determines the function of the
function whenever VCEN is set. CDROM interface pins. If XIOR is sampled
high, then CDCS, CDACK, CDINT, CDRQ are
Reset and Power Down used to input SA12, SA13, SA14, SA15 respec-
A RESDRV pin places the part into maximum tively. If XIOR is sampled low (external
power conservation mode. When RESDRV goes pulldown) then CDCS, CDACK, CDINT, CDRQ
high, the PnP registers are reset - all logical de- become the standard CDROM interface pins.
vices are disabled, all analog outputs are muted, Since many CDROM drives do not use DMA,
and the voltage reference then slowly decays to the CDRQ and CDACK pins are further multi-
ground. When RESDRV is brought low, an in- plexed with MCS and MINT respectively. MCS
itialization procedure begins which causes a full is the Modem chip select that responds to COM-
calibration cycle to occur. When initialization is base addresses, and MINT is the modem
completed, the registers will contain their reset interrupt input. These two pins comprise logical
value and the part will be isolated from the bus. device 5. The first time COMbase is pro-
RESDRV is required whenever the part is pow- grammed to non-zero (assuming XIOR was
ered up. The initialization time varies based on sampled low), CDACK/MCS and CDRQ/MINT
whether an E2PROM is present or not and the switch to MCS and MINT respectively. Once
size of the data in the E2PROM. After RESDRV this switch occurs, the only way to revert to the
goes low, the CS4236 should not be written to CDROM DMA pins is to reset the part or re-
for approximately one and one half second to move power.
guarantee that the part is ready to respond to
commands. The exact timing is specified in the The XCTL1/SINT/ACDCS/DOWN pin state is
Timing Section in the front of this data sheet. first determined by VCEN. If VCEN is set this
pin is forced to the DOWN volume control pin.
DS215PP4 89
CS4238B
If VCEN is zero, then if ACDbase is ever pro- The analog input interface is designed to accom-
grammed to a non-zero value, this pin converts modate four stereo inputs and one mono input.
to the ACDCS pin and keeps this function until Four of these sources are mixed to the ADC.
the part is reset (or VCEN is set to one). If These inputs are: a stereo line-level input
ACDbase is never programmed non-zero, then (LINE), a stereo microphone input (MIC), a ste-
the state of XIOW at the time RESDRV is reo CD-ROM input (AUX2), and a stereo
brought low determines whether the pin is auxiliary line-level input (AUX1). The LINE
XCTL1 or SINT. If XIOW is sampled low (ex- and AUX1 inputs have two paths to the Input
ternal pulldown) then XCTL1/SINT/ Mixer. One path is direct with no volume con-
ACDCS/DOWN functions as an input for the trol. The other path goes through an inverting
synthesizer interrupt. If XIOW is sampled high amplifier, which enables volume control. Care
(pin left unconnected) then XCTL1/SINT/ should be taken to select only one of these dual
ACDCS/DOWN becomes an output for XCTL1. paths, because the inverting path will cancel the
signal of the non-inverting path at the Input
This part contains another multiplexed pin, Mixer. The LINE, MIC, AUX1, and AUX2 in-
SCS/UP. This pin provides the FM synthesizer puts have paths after their volume controls, to
chip select or the hardware volume control "vol- the output mixer. The output mixer has the addi-
ume up" feature. Since an internal FM tional input of a mono input channel. All audio
synthesizer exists, this pin would normally be inputs should be capacitively coupled.
used for the volume control feature. Setting
VCEN forces this pin to the UP volume control To obtain Sound Blaster mixer compatibility, the
function. When VCEN is clear, this pin is the mapping of external devices to analog inputs is
SCS chip select function. important. An external FM or Wavetable synthe-
sizer analog output must be connected to the
ANALOG HARDWARE DESCRIPTION LINE input. The internal FM’s volume control,
The analog hardware consist of an MPC when enabled, maps to the LINE analog mixer
Level 2-compatible mixer (four stereo mix registers. The CDROM analog outputs must be
sources), three line-level stereo inputs, a stereo connected to the AUX2 inputs, and the external
microphone input, a mono input, a mono output, Line Inputs must be connected to the AUX1 ana-
and a stereo line output. This section describes log inputs.
the analog hardware needed to interface with
these pins. Since some analog inputs can be as large as
2 VRMS, the circuit shown in Figure 26 can be
Line-Level Inputs Plus MPC Mixer used to attenuate the analog input to 1 VRMS
which is the maximum voltage allowed for the
The analog inputs consist of four stereo analog line-level inputs.
inputs, and one mono input. As shown in Fig-
ure 4, the input to the ADCs comes from the 6.8 kΩ 1.0 µF
Input Mixer that selects any combination of the R
following: LINE, AUX1, AUX2, MIC, the DAC 1.0 µF
output, and the output from the analog output L
mixer. Unused analog inputs should be con- 6.8 kΩ
nected together and then connected through a 6.8 kΩ 6.8 kΩ
capacitor to analog ground.
Figure 26. Line Inputs
90 DS215PP4
CS4238B
DS215PP4 91
CS4238B
MC34119
RESDRV
or LM4861
Figure 30. Mono Output
92 DS215PP4
CS4238B
interface due to transient currents during bus to the system digital power supply. VD1 can also
switching. SGND1-4 are the substrate grounds be connected to a 3.3V supply providing a 3.3V
and should also be connected to the digital ISA interface. When connected to a 3.3V supply,
ground plane to minimize coupling into the ana- all ISA bus input pins (SA15-0, SD7-0, DACKs,
log section. Figure 33 shows the recommended etc.) must be at 3.3V levels (not 5V), with the
positioning of the decoupling capacitors. The ca- exception of the DRQA pin. DRQA is internally
pacitors must be on the same layer as, and close connected to the VDF supplies and remains a
to, the part. The vias shown go through to the 5 Volt pin even when the ISA bus is run at
ground and power plane layers. Vias, power sup- 3.3 Volts. When the ISA bus is powered from
ply traces, and REFFLT traces should be as large 3.3 Volts, DRQA can be be used through a level
as possible to minimize the impedance. translator, or DRQA can remain used. If DRQA
is not used, all references to this pin should be
POWER SUPPLIES removed in the PnP Resource data. Even though
The power supply providing analog power the ISA bus is at 3.3V, the peripheral port is still
should be as clean as possible to minimize cou- at a 5V potential including XD7-0 and all chip
pling into the analog section and degrading select and address pins.
analog performance.
VDF1 through VDF4 provide power to internal
The VD1 is isolated from the rest of the power digital sections of the codec and should be qui-
supply pins and provide digital power for the eter than VD1. This can be achieved by using a
asynchronous parallel ISA bus (except for
DRQA). The VD1 pin can be connected directly
Di Crystal Analog
g it
al Part Ground
Gr
o un
d No
1
ise
Power
e
Nois Connector
d
un
G ro
al
igi t
D
DS215PP4 93
CS4238B
Speaker In
Analog Ground
Crystal
Part
1
Digital Ground
1µF
PIN 80 +
AGND PIN 79
PIN 98 .1µ F PIN 97 PIN 81
VDF3 SGND3 .1µ F REFFLT
VA .1µF
PIN 1
XD7
Analog PIN 71
TEST
PIN 66
SGND2
.1µF
Digital
PIN 17
VDF1 PIN 65
VDF2
= vias through to
power/ground plane
.1µF
PIN 54
VDF4
PIN 18
SGND1
.1µF
PIN 53
SGND4
PIN 45 PIN 46
VD1
DGND1
.1µ F
94 DS215PP4
CS4238B
-60
-70
-80
-90
-100
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
Input Frequency ( x Fs)
0.2 0
0.1 -10
0.0 -20
-0.1 -30
Magnitude (dB)
Magnitude (dB)
-0.2 -40
-0.3 -50
-0.4 -60
-0.5 -70
-0.6 -80
-0.7 -90
-0.8 -100
0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.40 0.45 0.50 0.55 0.60 0.65 0.70
Input Frequency ( x Fs) Input Frequency ( x Fs)
Figure 35. ADC Passband Ripple Figure 36. ADC Transition Band
DS215PP4 95
CS4238B
10 0.2
0 0.1
-10 0.0
-20
-0.1
Magnitude (dB)
Magnitude (dB)
-30
-0.2
-40
-0.3
-50
-0.4
-60
-0.5
-70
-80 -0.6
-90 -0.7
-100 -0.8
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50
Input Frequency ( x Fs) Input Frequency ( x Fs)
Figure 37. DAC Filter Response Figure 38. DAC Passband Ripple
0 2.0
-10
1.5
-20
1.0
-30
∆ Phase (degrees)
Magnitude (dB)
0.5
-40
-50 0.0
-60 -0.5
-70
-1.0
-80
-1.5
-90
-100 -2.0
0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50
Input Frequency ( x Fs) Input Frequency ( x Fs)
Figure 39. DAC Transition Band Figure 40. Deviation from Linear Phase
96 DS215PP4
CS4238B
PIN DESCRIPTIONS
SA13*/CDACK/MCS
SA15*/CDRQ/MIN T
SA14*/CDINT
SA12*/CDCS
RESDRV
CMAUX2
REFFLT
SGND3
RAUX2
LAUX2
XTALO
AGND
RFILT
RLINE
MOUT
MUTE
VREF
LLINE
VDF3
LFILT
RMIC
XTALI
LMIC
MIN
VA
94
98
97
96
95
93
92
90
99
91
89
88
87
85
84
83
81
86
82
76
100
77
80
79
78
XD7/SDATA 1 75 LAUX1
XD6/LRCLK 2 74 RAUX1
XD5/MCLK 3 73 LOUT
XD4/FSYNC 4 72 ROUT
CS4238B-KQ
XD3/SDOUT 5 71 TEST
XD2/SDIN 6 70 JAB1
XD1SCLK 7 69 JBB1*/FSYNC
SDA/XD0 8 68 JACX
SCS/UP 9 67 JBCX*/SDOUT
XIOR 10 66 SGND2
XIOW 11 65 VDF2
100-PIN
XCTL0*/XA2 12 64 JBCY*/SDIN
TQFP
XA1 13 63 JACY
SCL/XA0 14 62 JBB2*/SCLK
BRESET 15 61 JAB2
XCTL1*/SINT/ACDCS/DOWN 16 60 MIDOUT
VDF1 17 59 MIDIN
SGND1 18 58 DACKA (DACK0*)
(INT15*) IRQF 19 57 DACKC (DACK3*)
(INT12*) IRQE 20 56 DACKB (DACK1*)
(INT11*) IRQD 21 55 DRQA (DRQ0*)
(INT9*) IRQC 22 54 VDF4
(INT7*) IRQB 23 53 SGND4
(INT5*) IRQA 24 (TOP VIEW) 52 DRQC (DRQ3*)
SA0 25 51 DRQB (DRQ1*)
37
36
30
31
32
34
26
28
29
33
35
38
40
41
27
39
42
47
43
44
45
46
49
50
48
DGND1
SA1
SA2
SA3
SA4
SA5
VD1
AEN
SA11
IOW
IOR
SA10
SD0
SD3
SD4
SD5
SD6
SD7
SA6
SA7
SA8
SA9
SD2
SD1
IOCHRDY
DS215PP4 97
CS4238B
98 DS215PP4
CS4238B
Analog Inputs
DS215PP4 99
CS4238B
Analog Outputs
100 DS215PP4
CS4238B
MIDI Interface
DS215PP4 101
CS4238B
SDA/XD0 - External Data Bus bit 0/E2PROM Data Pin, Bi-directional, Open Drain,4mA sink
This open-drain pin must have an external pullup (3.3 kΩ) and is used to transfer data between
the ISA bus bit 0, SD0, and external devices such as a modem or CDROM. SDA/XD0 is also
used in conjunction with SCL/XA0 to access an external serial E2PROM. When an E2PROM is
used, the SDA/XD0 pin should be connected to the data pin of the E2PROM device and
provides a bi-directional data port. The E2PROM is used to set the Plug and Play resource data.
102 DS215PP4
CS4238B
DS215PP4 103
CS4238B
104 DS215PP4
CS4238B
CDACK/MCS - CDROM DMA Acknowledge, or Modem Chip Select, Output, 4mA drive
This pin can be used to output the ISA bus-generated DMA acknowledge signal to the CDROM
interface. Alternately, this pin can be used to output an active low Modem chip select, MCS.
The pin is switched to the modem chip select when the LD5 base address, COMbase, is first
programmed to non-zero through the PnP data or a hostload.
DS215PP4 105
CS4238B
Volume Control
The volume control pins are enabled by setting VCEN in the Hardware Configuration data,
Misc. Hardware Config. byte. The VCF1,0 bits in the Hardware Configuration data, Global
Configuration byte, set the format for the volume control pins. Each pin must have an external
pullup resistor (10kΩ) and either a momentary or toggle style switch based on format. Typically
a 100Ω series resistor and a capacitor to ground, capacitor on the switch side of the series
resistor, would be included on each pin for ESD protection and to help with EMI emissions.
UP - Volume Up
The SCS/UP pin is multiplexed with the external Synthesizer chip select. This pin is switched
to the UP function when VCEN is set. When UP is low, the master volume output for left and
right channels are incremented.
Miscellaneous
106 DS215PP4
CS4238B
TEST - Test
This pin must be tied to ground for proper operation.
Power Supplies
DS215PP4 107
CS4238B
PARAMETER DEFINITIONS
Resolution
The number of bits in the input words to the DACs, and in the output words in the ADCs.
Differential Nonlinearity
The worst case deviation from the ideal code width. Units in LSB.
Interchannel Isolation
The amount of 1 kHz signal present on the output of the grounded input channel with 1 kHz
0 dB signal present on the other channel. Units in dB.
Offset Error
For the ADCs, the deviation in LSBs of the output from mid-scale with the selected input
grounded. For the DACs, the deviation in volts of the output from VREF with mid-scale input
code.
108 DS215PP4
CS4238B
PACKAGE PARAMETERS
D
100-pin TQFP - Package Code ’Q’
D1 Symbol Description MIN NOM MAX
N Lead Count 100
A Overall Height 1.66
A1 Stand Off 0.00
b Lead Width 0.14 0.20 0.26
c Lead Thickness 0.077 0.127 0.177
D Terminal Dimension 15.70 16.00 16.30
D1 Package Body 14.0
E Terminal Dimension 15.70 16.00 16.30
E1 Package Body 14.0
e1 Lead Pitch 0.40 0.50 0.60
E E1 L1 Foot Length 0.30 0.50 0.70
T Lead Angle 0.0° 12.0°
Notes:
1) Dimensions in millimeters.
100
DS215PP4 109
CS4238B
110 DS215PP4
CS4238B
DB 047H, 001H, 034H, 005H, 0FCH, 00FH, 004H, 004H ;16b WSSbase: 534-FFC
DB 047H, 001H, 088H, 003H, 088H, 003H, 008H, 004H ;16b SYNbase: 388
DB 047H, 001H, 020H, 002H, 060H, 002H, 020H, 010H ;16b SBbase: 220-260
DS215PP4 111
CS4238B
This part is designed to be hardware and software backwards compatible with the CS4236 and will
drop into an existing CS4236 socket without any hardware modifications. Properly written code for the
CS4236 will run on the this Codec. However, the CS4238B has enhancements over the CS4236 that
provide extra functionality.
The differences are as follows:
1. CTRLbase+3 is redefined to be an indirect address register and CTRLbase+4 is redefined to be an
indirect data register. These registers allows access to C0 through C8 indirect registers.
2. CDSDD in the Global Configuration byte of the Hardware Configuration data has been renamed
SDD and its function expanded. On this part, setting SDD disables peripheral port reads from driv-
ing the ISA data bus for ALL peripheral port devices, e.g. CDROM and MODEM. On the CS4236,
setting CDSDD disables peripheral port reads for the CDROM device ONLY.
3. The Serial Port works continuously once enabled. CEN and PEN do not have any effect on the se-
rial port. On the CS4236, CEN and PEN disabled their respective part of the serial port when set to
zero.
4. The GAME Logical Device (Joystick) only aliases from GAMEbase+0 to GAMEbase+5. GAME-
base+6 and GAMEbase+7 are reserved. This Codec also contains support for Digital Assist of
analog joysticks to support the Microsoft Direct Input initiative.
5. I25 was defined as a Version and Chip ID register in the CS4236. This register is now redefined as
a Compatibility register and is identical to the CS4236 to allow software written to the CS4236 to
work properly on this part. The Version and Chip ID for this chip has been moved to Control indi-
rect register C1 and WSS indirect register X25 (Rev. C or greater).
6. I27 and I29 in the WSS space are reserved.
7. When IFM is enabled (and remapping is enabled) I18/I19 return the same value written when mute
is enabled. On the CS4236, I18/19 returns 0xBF when mute is enabled.
8 The OLB bit in I16 is no longer functional and internally is set as if OLB is on.
9. The MIC input impedance is now 8 kΩ minimum.
112 DS215PP4
CS4238B
DS215PP4 113