PB01 Resources - Audio

Frozen Content

The PB01's audio capabilities are provided by a CS4270 24-bit, 192kHz stereo audio CODEC (from Cirrus Logic). The CODEC caters for both analog and digital audio I/O.


Figure 1. CS4270 Stereo Audio CODEC
device.

Device Power and Reset

Power for the digital section of the device, as well as the signal level for the device's Control Port, is sourced direct from the PB01's 3.3V supply.

Power for the analog sections of the device is sourced from the output of an adjustable linear voltage regulator – a MAX8860 device, from Maxim. Powered by the PB01's 5V supply, the output level is determined by the resistance between the device's OUT and SET pins, and is calculated using the following formula:

VOUT = 1.25 * (1 + RA/100K)

Where,

VOUT is the voltage output of the device

RA is the resistance between the device's OUT and SET pins.

On the PB01, a resistance of 162KΩ is used, giving a nominal analog power supply of 3.28V to the CS4270 device.

Reset of the CS4270 is performed by taking its RST input Low. The reset signal to this input is sourced from the output of a supervisory reset circuit device – a MAX6315US26D1, from Maxim. This device will assert the reset signal to the CS4270 if its 3.3V supply voltage dips below 2.3V, thereby providing power-up reset of the CODEC. The reset signal will remain asserted for a minimum of 1ms (typically 1.4ms) after the supply voltage rises above this threshold.

Analog Audio I/O

Analog audio input to the CS4270 consists of a pair of stereo line inputs (LineIn_L, LineIn_R). These signals, derived from the NB2DSK01 motherboard's 'LINE IN' input, are fed into the device's AINA and AINB pins respectively.

There is also the ability to pass the signal from the motherboard's 'MICROPHONE' input, as input to the audio CODEC. The pre-amplified MicIn signal that arrives from the motherboard at the peripheral board connector, is fed in parallel through two FSA4157 low-voltage, 1Ω, SPDT Analog Switches (from Fairchild Semiconductor). The B1 outputs of these devices become the left and right channel inputs (LineIn_L, LineIn_R) to the audio CODEC.


Figure 2. Analog switches used to pass
the microphone signal through to the
audio CODEC.

An additional signal from the FPGA design – AUDIO_MIC_EN – is used to control whether the microphone signal is used or not. Wired to each FSA4157 device's control input (S pin), simply connect to VCC in the design to switch the A input pin through to the B1 output pin for each device, and therefore pass the mic-based signals through to the CS4270. Connect this signal to GND in the design, to switch the A input pin through to the B0 output pin for each device – which is subsequently connected to AUGND – and thereby disable use of the microphone signal on the PB01 altogether.
 

The outputs of the FSA4157 devices and the line input signals arriving from the motherboard are AC-coupled. They will be effectively 'mixed' if you try to use both sources as input to the audio CODEC concurrently. If you are using the motherboard's 'LINE IN' socket, ensure that the AUDIO_MIC_EN signal is tied to GND in the FPGA design.

 
Analog audio output is in the form of two signals – LineOut_L and LineOut_R. These signals are sourced from the CS4270's AOUTA and AOUTB pins. Both outputs are passed through low-pass filters – simple RC filtering providing a cut-off frequency of around 37kHz. The signals are then subsequently routed, via the peripheral board connector, to the analog mixer on the NB2DSK01 motherboard. From here they are mixed with other audio sources to provide the input signals to the motherboard's stereo audio power amplifier.

Each analog line output signal is obtained from the output of a 24-bit stereo audio DAC, capable of operating at sampling rates from 4kHz to 216kHz. The sampling rate is determined by the Speed mode setting, programmable through an internal register. The same selected speed mode applies to both DAC and ADC circuitry.

Digital volume control is also provided, under control of SPI-accessible control registers. The gain of each channel can be varied from 0dB to -127dB, in 0.5dB steps. Control bits can also be set to mute either channel independently.

Digital Audio I/O

Digital audio data samples are transferred between the CS4270 and a processor in the FPGA design over the 4-wire I2S bus. Both bit and word clock signals (AUDIO_I2S_BCLK and AUDIO_I2S_WCLK) are sourced from the FPGA design, specifically from an intermediate I2S Controller. They are wired to the CODEC's SCLK and LRCK inputs, respectively.

An additional clock signal from the FPGA design – AUDIO_I2S_MCLK – is used to provide the driving frequency for the delta-sigma modulator and digital filters. Wired to the CODEC's MCLK input, the frequency of the AUDIO_I2S_MCLK signal is fixed at 256 times the frequency of the AUDIO_I2S_WCLK signal.

Digital audio data from the processor is passed through the DAC for each channel, in order to produce the analog audio line output signals, for subsequent use as input to the NB2DSK01 motherboard's audio system.

Digital audio data destined for the processor is obtained by passing the analog audio input signals (LineIn_R, LineIn_L) through a 24-bit stereo audio ADC. Supported sampling rates are the same as for the DACs. The Speed mode, programmable through an internal register, is the same for both ADC and DAC circuitry.

Control bits can also be set to mute each channel independently.

Audio Control Registers

Internal registers for the CS4270, which are used to determine the required functionality of the device, are accessed by a processor in the FPGA design over the SPI bus. These registers, referred to as the Control Port registers, can only control the device provided it is set to operate in Control Port mode. This is achieved after power-up of the NB2DSK01 by initiating SPI communications within 10ms of the device's RST line going High. The recommended start-up procedure after RST goes High is:

  • Set the PDN bit in the Power Control register (at address 02h)
  • Wait 1ms
  • Clear the PDN bit in the Power Control register
  • Wait a further 1ms
  • Then continue reading/writing other Control Port registers over the SPI bus.


Control Port registers retain their settings during power-down.

 
The following registers should be written, as a minimum, when initializing the device for operation:

  • Mode Control register (address 03h) – should be written with the required functional mode and MCLK clocking ratios. The default value for this register is 30h which will select Slave Mode, with divide-by-1 for the clocking ratios.
  • ADC and DAC Control register (address 04h) – should be written with the required digital interface formats for both ADC and DAC. A value of 09h, for example, will set both the DAC digital interface format and the ADC digital interface format to be I2S, up to 24-bit data.
  • Transition Control register (address 05h) – should be written with the required transitional control functionality. The default value for this register is 60h, which enables both soft ramp and zero cross functions.
  • Mute Control register (address 06h) – should be written with the required muting functionality. The default value for this register is 20h, which will enable the CODEC's auto-mute function. In this state, the DAC output will be muted automatically following the reception of 8192 consecutive audio samples of static 0 or -1. The mute will be released on detection of a single non-static sample of audio.
  • DAC Channel A Volume Control register (address 07h) – should be written with the volume gain required for the Right channel audio DAC. The default value for this register is 00h, which sets the gain to 0dB.
  • DAC Channel B Volume Control register (address 08h) – should be written with the volume gain required for the Left channel audio DAC. The default value for this register is 00h, which sets the gain to 0dB.

For detailed information on all audio control registers, including bit descriptions, refer to the Register Description section of the device's data sheet.

Location on Board

The CS4270 device (designated U1AC) is located on the component side of the board, to the top-left of the DS2406 1-Wire ID device (U1).

The MAX6315 device (designated U1T) is located on the component side of the board, to the top-left of the audio CODEC device.

The MAX8860 device (designated U11) is located on the component side of the board, to the left of the audio CODEC device.


Figure 3. MAX6315 (U1T)
and MAX8860 (U11).

The FSA4157 devices (designated U1M and U2M) are located on the component side of the board, below the audio CODEC device.

Schematic Reference

The audio codec circuitry can be found on the following sheets of the peripheral board schematics:

  • PB01_AUDIO_CODEC.SchDoc (entitled Audio CODEC)
  • AUDIO_CODEC_CS4270.SchDoc (entitled Audio CODEC)
  • PSU_MAX8860_ADJ.SchDoc (entitled Power Supply MAX8860 (2V5))
  • AUDIO_MICROPHONE.SchDoc (entitled Microphone Amplifier)
  • PB01_Top.SchDoc (entitled Top Level) – which includes the MAX6315 device.

Design Interface Component

Table 1 summarizes the available design interface component that can be placed from the FPGA PB01 Port-Plugin.IntLib, for communications with the stereo audio codec over the I2S bus.

Table 1. Audio Codec port-plugin component.
Component Symbol
Component Name
Description

AUDIO_CODEC

Place this component to interface to the CS4270 device and transfer digital audio data over the I2S bus.

To enable a host processor in your FPGA design to control operation of the CS4270 device, you need to place the design interface component that allows communications with the device over the SPI bus, as summarized in Table 2.

Table 2. Audio CODEC SPI Bus port-plugin component.
Component Symbol
Component Name
Description

AUDIO_CODEC_CTRL

Place this component to interface to and control the CS4270 device, over the SPI bus.

If your design involves communications with multiple SPI-based devices, you will need to place the generic SPI_BUS device. For more information, see Using Multiple SPI and I2C Devices in a Design.

Further Device Information

For more information on the CS4270 device, refer to the datasheet (CS4270_PP1.pdf) available at www.cirrus.com.

For more information on the MAX6315 and MAX8860 devices, refer to the datasheets (MAX6315.pdf and MAX8860.pdf) available at www.maxim-ic.com.

For more information on the FSA4157 device, refer to the datasheet (FSA4157.pdf) available at www.fairchildsemi.com.

You are reporting an issue with the following selected text and/or image within the active document: