Texas Instruments | LM4935 I2C/SPI INTERFACE SOFTWARE | User Guides | Texas Instruments LM4935 I2C/SPI INTERFACE SOFTWARE User guides

Texas Instruments LM4935 I2C/SPI INTERFACE SOFTWARE User guides
LM4935 I2C/SPI INTERFACE SOFTWARE MANUAL v1.4
National Semiconductor Audio
1
TABLE OF CONTENTS
Introduction………………………………………………………………………………3
Installation………………………………………………………………………………..3
Overview…………………………………………………………………………………4
Default Button……………………………………………………………………………5
BASIC TAB………………………………………………………………………………5
PLL TAB………………………………………………………………………………….9
SAR TAB………………………………………………………………………………..11
INTERFACES TAB…………………………………………………………………….12
AGC TAB……………………………………………………………………………….13
ADVANCED TAB………………………………………………………………………15
Common Configurations………………………………………………………………16
References……………………………………………………………………………..19
2
INTRODUCTION:
The LM4935 Software provides easy read/write access to the data registers of the LM4935 audio
subsystem through an I2C/SPI control interface. This manual will provide instruction on how to
use this software with the LM4935 Demoboard and associating USB interface card. Furthermore,
examples will be provided on using the software to program the headphone and high efficiency
loudspeaker outputs, setting the PLL, and other features of the LM4935 audio subsystem.
INSTALLATION:
The LM4935 software is built on a new Microsoft® .NET Framework. It may require that
Microsoft® .NET Framework Software Development Kit (SDK) version 1.1 be installed in your
1
computer, which is downloadable through the Microsoft® website . The LM4935 software setup
file will automatically install Microsoft® .NET Framework Software Development Kit (SDK) version 1.1
if your PC requires it. An internet connection is not required since Microsoft® .NET Framework
Software Development Kit (SDK) version 1.1 is already included in the LM4935 software package.
Installation of the SDK may take a few minutes. Once that is completed the rest of the installation
process is fast.
The following steps should be followed:
Step 1: Uninstall any previous version, if any, from Control Panel/Add Remove Program/ LM4935
I2C SPI interface.
Step 2: Unzip the LM4935 software.
Step 3: Run the Setup.exe file.
Step 4: The LM4935.exe file will be installed to your desktop as well as the folder you specified
during the installation process.
Step 5: Please make sure that the LM4935 Demoboard and USB Interface Card are properly
connected to your PC and that proper power is applied to the LM4935 Demoboard. Please refer
to the LM4935 Evaluation Package Instructions for details on how to accomplish this.
Step 6: Run the LM4935.exe file. The LM4935 software will run properly ONLY if Step 5 is
completed.
3
OVERVIEW:
The LM4935 Software is divided up into three main sections: Menu Bar, Tabs Control, and Status
Register and Bar. (please refer to Figure 1)
1) The Menu Bar contains File, Control, Settings and Help Options:
File: Exits program
Control: Switches between I2C and SPI mode. Switching between I2C and SPI will
initialize all of the data registers back to their default settings of zero.
Settings: Sets the USB interface board’s regulated output voltage to 3V or 3.8V. The
Disable Polling option can be activated to disable continuous polling on the I2C/SPI
interface bus. Continuous polling is desirable whenever constant feedback from the
Status Register or the SAR is required. Enabling the Disable Polling option increases
the efficiency of the LM4935 software program. Note: If Disable Polling is activated the
Status Register can still be read in by clicking the Read button located in the Status
Register section.
Help: Contains the About box, which can be used to check Version number of the
software.
2) Tabs Controls are further divided up to following:
Basic: Contains the main functionality of the LM4935 chip.
Interface: Contains I2S and PCM options.
AGC: Contains Automatic Gain Control settings.
PLL: Contains PLL control settings.
SAR: Provides SAR options and triggering capability.
Advanced: Provides read/write access to any register using brute force.
3) The Status Register and Bar provide feedback on the communication status between the USB
interface card/LM4935 Demoboard to the LM4935 software. The Status Bar has useful messages
that provide feedback on the communication status of the I2C/SPI control interface.
Status Messages (please refer to Figure 1):
1) If there is a proper connection between the PC and the LM4935 Demoboard/USB interface
card, the message ‘USB Connected’ will appear. If there is no proper connection than ‘USB I/O
error’ will appear.
2) For I2C mode, an ‘All ACK’ message indicates a successful I2C read/write, an ‘I2C ACK
missing’ message indicates. For SPI mode the message ‘SPI Mode’ appears.
4
3) Shows two hex numbers. The first number shows the data register address (0x3h) and the
second number shows the data byte (0x00h). (Figure1)
1
2
3
Figure 1: A main View of LM4935 Software (BASIC tab).
5
DEFAULT BUTTON:
Pressing this button will reset the software back to its default state and will initialize all of the data
registers back to their default setting of zero.
BASIC TAB:
i) BASIC OPERATIONS:
1
2
3
4
Figure 2: Basic operations
Register (BASIC 0x00h)
1) The LM4935 can be placed in one of four modes which dictate its basic operation.
2) The headphone amplifier can be set to OCL or SE Mode. Please make sure that the position of
the OCL/SE switch (Y3) on the demoboard corresponds to the HP setting on the software.
3) Enabling the Stereo Mode (bit 6 of register 0x00h) reduces the gain of the Left and Right
signal by 6dB to allow enough headroom for them to be summed. This may be useful when
summing both the Left and Right audio signal to a mono output like the earpiece or loudspeaker.
4) Programs the turn-on time of the LM4935 to accommodate the size of the bypass capacitor,
C20.
ii) OUTPUT OPERATIONS:
1
3
5
2
1) CP_OUTPUT: (Register 0x12h). The Microphone, Left,
and/or Right inputs can be mixed to the Cell Phone Output
by checking the corresponding box(es). Enabling the mute
will mute all the inputs.
4
2) HP_OUTPUT: (Register 0x15h). The Sidetone, Cell
Phone, Left, and/or Right inputs can be mixed to the stereo
Headphone Output by checking the corresponding box(es).
Enabling the mute will mute all the inputs.
6
3) AUX_OUTPUT: (Register 0x13h). The Cell Phone, Left,
and/or Right inputs can be mixed to the Auxiliary Output by
checking the corresponding box(es). Enabling the mute will
mute all the inputs.
Figure 3: LM4935 outputs
4) EP_OUTPUT: (Register 0x16h). The Sidetone, Cell Phone, Left, and/or Right inputs can be
mixed to the Earpiece Output by checking the corresponding box(es). Enabling the mute will mute
all the inputs.
5) LS_OUTPUT: (Register 0x14h). The Cell Phone, Left, and/or Right inputs can be mixed to the
Loudspeaker Output by checking the corresponding box(es). Enabling the mute will mute all the
inputs.
6
6) ADC_1: (Register 0x06h). The Microphone, Cell Phone, Left, and/or Right inputs can be mixed
to the input of the ADC by checking the corresponding box(es). Enabling the mute will mute all
the inputs.
iii) VOLUME CONTROL AND GAIN OPERATIONS:
1) AUX LEFT (0x0Fh). Controls the
volume of the AUX Left analog input.
Activating BOOST increases the gain
by 12dB. Enabling MUTE will mute the
AUX Left analog input.
2) AUX RIGHT (0x10h). Controls the
volume of the AUX Right analog input.
Activating BOOST increases the gain
by 12dB. Enabling MUTE will mute the
AUX Right analog input.
3) DAC (0x11h). Controls the level of the
DAC Output. Activating BOOST
increases the gain by 12dB. Enabling
MUTE will mute the output of the DAC.
4) CP_INPUT (0x0Eh) Controls the
volume of the Cell Phone analog input.
Enabling MUTE will mute the Cell
Phone analog input.
5) MIC_1 (0x0Bh) Controls the volume of
the Cell Phone analog input. Enabling
MUTE will mute the Cell Phone input.
1
2
3
4
5
6
8
7
9
Figure 4:
6) SIDETONE (0x0Dh) Controls the analog sidetone volume.
7) Max DC Volume Level (0x21h) This sets the maximum attainable level of the DC Volume
Control.
8) ENABLE DCVOL (0x21h) This enables the DC Volume control of the LM4935.
9) You can select which volume control (AUX/DAC or CPI) is altered by the DC Volume Control.
Click on the AUX button once to get CPI, click twice to get DAC.
7
iii) AUX/DAC INPUT SOURCES
Figure 5:
1) If AUX is selected then AUX input is passed to the mixer, the default is for the
DAC output to be passed to the mixer.
2) If DAC USE AUX LEVEL is enabled then the gain of the DAC inputs is controlled
by the AUX_LEFT and AUX_RIGHT registers, allowing a stereo balance to be
applied.
Figure 6:
3) ADC_1 HPF_MODE (0x06h). Sets the high pass filter of the ADC.
The corner frequencies are computed as followed:
Corner 1 = ((sample rate of ADC) * 3 / 80)
Corner 2 = (Corner 1) / 2
*Please refer to more info on the datasheet ADC_1 (0x06)
8
PLL TAB:
This tab programs the settings of the Phase Lock Loop (PLL).
1
5
2
PLL Register
Fields
4
3
f
Figure 7: PLL TAB
i) MCLK Drop Down Menu Mode
1)In the drop down combo box of MCLK (which is based on common
system clock values) the user can select from a list of pre-programmed
MCLK inputs. Based on the value of MCLK that is chosen from the
drop down menu, the LM4935 software will automatically update the M,
N, N_MOD and P values according to the MCLK input value and the
frequency of the PLL OUTPUT will be calculated in real time. The
LM4935 runs optimally with a PLL OUTPUT of 12 MHz or 11.025 MHz.
2)In the PLL_OUTPUT drop down combo box, a 12 MHz (Fs = 48kHz)
or 11.0250 MHz (Fs = 44.1kHz) target value can be selected and again
the M, N, N_MOD and P values will be calculated based on the value
chosen in the PLL OUTPUT and MCLK drop down combo boxes.
3)The Program PLL Registers button should be clicked after the
correct PLL register fields have been set.
Figure 8: MCLK Dropdown
9
4)The audio DAC and ADC input sources must be set for PLL OUTPUT if the PLL is to be used.
5)The PLL must then be enabled.
ii) User Defined MCLK or I2S CLK Mode
The user can also choose their own MCLK or I2S CLK value by simply entering that value into the
corresponding input field. The M, N, N_MOD and P values are not automatically updated as they
were when using the MCLK Drop Down Menu Mode. The M, N, N_MOD and P should be
adjusted manually by the user to achieve a PLL OUTPUT calculated value of 12 MHz (Fs =
48kHz) or 11.0250 MHz (Fs = 44.1kHz). The only time that the M, N, N_MOD and P values are
automatically calculated is when MCLK is chosen from the pre-programmed list of values on the
drop down menu for MCLK.
10
SAR TAB:
This Tab programs the SAR ADC and its triggers.
2
3
1
4
5
Figure 9: SAR TAB
1) The sample rate for each SAR channel can be adjusted through these slider controls.
2) The ENABLE buttons activate the corresponding SAR channel.
3) The output of the 4 SAR data registers are converted into voltage by the LM4935 software.
The maximum voltage that can be displayed is 2.5V since the SAR data resolution is only 8 bits
per channel.
4) The SAR Trigger option is used for triggering the IRQ pin based specific condition. Users
specify their own Trigger 1 and Trigger 2 Voltage. The maximum trigger voltage is 2.5V. Once
the trigger condition is met then SARTRIG1 and/or SARTRIG2 is set on the Status Register if
Trigger 1 and/or Trigger 2 is enabled.
5) DETECT (0x17h) is programmed through the bottom portion of SAR TAB. Please refer to
datasheet for more information.
11
INTERFACE TAB:
The Interface Tab controls the I2S / PCM interfaces and the GPIO pins. Please refer to GPIO
Configuration Register (0x1Ah) and Audio Interface Configuration Register (0x19h) in datasheet
for further detail.
1
2
3
5
4
Figure 10: INTERFACE TAB
1) The I2S/PCM audio data interface can be adjusted through these settings.
2) GPIO SELECT can be used to configure the GPIO pins of the LM4935. GPIO1 can be
programmed as either READABLE, LS_AMP_ENABLE, GPIO_DATA or ZERO and GPIO2 could
programmed as either SPI_SDO or SAR_SDO. Please refer to GPIO configuration register
(0x1A) in datasheet for further detail. Both GPIO1 and GPIO2 pull down menus have to be set in
order to properly program the GPIOs.
3) The Internal On-Chip Oscillator can be enabled or disabled through these settings. The
Internal On-Chip Oscillator should be enabled in applications where the LM4935 uses its analog
audio inputs only.
4) The LEFT and/or RIGHT words of I2S SDO DATA can be configured to read back data from
the SAR or ADC.
5) The PCM audio data interface can be adjusted through these settings.
12
AGC TAB:
The Automatic Gain Control is programmed in this tab.
Figure 11: AGC TAB:
GATE CP OUT: If enabled and AGC noise is enabled, the MIC to CPO path
will be gated if the signal is determined to be noise.
AGC NOISE GATE: If enabled, signals below the noise gate threshold are
muted; the noise gate is only activated after a set period of signal absence.
AGC PEAK TIME AND AGC HOLD TIME options are provided by LM4935 Software.
SPEECH SEGMENT is calculated by:
(AGC PEAK TIME) x (AGC HOLD TIME) = SPEECH SEGMENT
13
Others AGC Options are following:
1) AGC Enable or Disable
2) AGC MAX MIC GAIN
3) AGC TARGET with AGC TIGHT button
4) ADC SAMPLE RATE
5) AGC DECAY
6) AGC ATTACK
Please refer to the AGC_1 (0x08h), AGC_2 (0x09h), AGC_3 (0x0Ah) register pages in the
datasheet for further detail.
14
ADVANCED TAB:
This tab allows the user to directly program a specific data register of their choosing. This tab is
useful for system debug.
1
3
2
4
1) This drop down menu allows the user to select a specific data register to read/write to.
2) This row of 8 buttons sets the bit7 to bit0 data of the specified register. Each button press will
trigger an I2C/SPI write.
3) This will write the current data field to the specified register.
4) Pressing the Read button will read the contents of the specified data register into the text box
below the button.
15
COMMON CONFIGURATIONS:
The following examples will provide a simple walk through to run LM4935 software. Proper
connection between the LM4935 Demoboard/USB Interface Card and PC is required. The
LM4935 Demoboard must be properly powered on.
Setting up the Headphone and High Efficiency Loudspeaker Mode (Analog Input):
a) A stereo input source should be connected to the AUX_LEFT and AUX_RIGHT inputs of the
LM4935 demoboard.
b) A Loudspeaker and a headset should be connected the LM4935 demoboard.
i) Using Analog AUX inputs and Internal on chip oscillator
Hit the default Button on the BASIC Tab.
1) From the INTERFACE TAB Enable the Internal Oscillator.
.
2) Bring Part to Active w/o HP Detect on BASIC TAB
3) Check RIGHT AND LEFT on LS_OUTPUT and HP_OUTPUT on BASIC TAB
4) Since DAC is bypassed in Analog inputs use LEFT AND RIGHT SOURCE TO AUX MODE ON
BASIC TAB,
5) Turn up the volume level for AUX LEFT AND RIGHT on BASIC TAB, you can hit boost for gain
up the volume assuming you have enough headroom.
16
ii) Using the S/PDIF Input and MCLK from the S/PDIF Receiver
a) S11 of the LM4935 Demoboard should be closed.
b) Switch Y2 of the Demoboard should be placed in the ‘int I2S’ position.
c) An S/PDIF input signal should be connected to either the Optical or Coax input of the LM4935
Demoboard.
d) Switch S12 on the LM4935 Demoboard should correspond to the S/PDIF input being used.
e) S18 should be placed in the ‘S/PDIF Receiver Master’ position.
f) At this point the S13 ‘S/PDIF Receiver RESET’ button should be pressed.
g) Loudspeaker and a headset should be connected the LM4935 Demoboard.
Hit the default Button on the BASIC Tab.
1) Click on PLL TAB
2) If using CD audio source, use 11.2896 MHz for MCLK. If running audio from a DVD then use
12.288 MHz (Default).
3) Program the PLL by hit the ‘Program PLL REGISTERS’ button.
4) Enable the PLL on PLL TAB.
5) DAC CLK set for PLL OUTPUT
6) Bring Part to Active w/o HP Detect on BASIC TAB
17
7) Check RIGHT and LEFT on LS_OUTPUT and HP_OUTPUT on BASIC TAB
8) Turn up the DAC Volume; you can enable BOOST for increased gain assuming that there is
enough headroom.
18
References:
1) Microsoft framework .net 1.1 Direct download link
http://www.microsoft.com/downloads/details.aspx?FamilyId=9B3A2CA6-3647-4070-9F41A333C6B9181D&displaylang=en
19
IMPORTANT NOTICE
Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements,
and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should
obtain the latest relevant information before placing orders and should verify that such information is current and complete. All products are
sold subject to TI’s terms and conditions of sale supplied at the time of order acknowledgment.
TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI’s standard
warranty. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except where
mandated by government requirements, testing of all parameters of each product is not necessarily performed.
TI assumes no liability for applications assistance or customer product design. Customers are responsible for their products and
applications using TI components. To minimize the risks associated with customer products and applications, customers should provide
adequate design and operating safeguards.
TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right, copyright, mask work right,
or other TI intellectual property right relating to any combination, machine, or process in which TI products or services are used. Information
published by TI regarding third-party products or services does not constitute a license from TI to use such products or services or a
warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual
property of the third party, or a license from TI under the patents or other intellectual property of TI.
Reproduction of TI information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied
by all associated warranties, conditions, limitations, and notices. Reproduction of this information with alteration is an unfair and deceptive
business practice. TI is not responsible or liable for such altered documentation. Information of third parties may be subject to additional
restrictions.
Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids all
express and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice. TI is not
responsible or liable for any such statements.
TI products are not authorized for use in safety-critical applications (such as life support) where a failure of the TI product would reasonably
be expected to cause severe personal injury or death, unless officers of the parties have executed an agreement specifically governing
such use. Buyers represent that they have all necessary expertise in the safety and regulatory ramifications of their applications, and
acknowledge and agree that they are solely responsible for all legal, regulatory and safety-related requirements concerning their products
and any use of TI products in such safety-critical applications, notwithstanding any applications-related information or support that may be
provided by TI. Further, Buyers must fully indemnify TI and its representatives against any damages arising out of the use of TI products in
such safety-critical applications.
TI products are neither designed nor intended for use in military/aerospace applications or environments unless the TI products are
specifically designated by TI as military-grade or "enhanced plastic." Only products designated by TI as military-grade meet military
specifications. Buyers acknowledge and agree that any such use of TI products which TI has not designated as military-grade is solely at
the Buyer's risk, and that they are solely responsible for compliance with all legal and regulatory requirements in connection with such use.
TI products are neither designed nor intended for use in automotive applications or environments unless the specific TI products are
designated by TI as compliant with ISO/TS 16949 requirements. Buyers acknowledge and agree that, if they use any non-designated
products in automotive applications, TI will not be responsible for any failure to meet such requirements.
Following are URLs where you can obtain information on other Texas Instruments products and application solutions:
Products
Applications
Audio
www.ti.com/audio
Automotive and Transportation www.ti.com/automotive
Amplifiers
amplifier.ti.com
Communications and Telecom www.ti.com/communications
Data Converters
dataconverter.ti.com
Computers and Peripherals
www.ti.com/computers
DLP® Products
www.dlp.com
Consumer Electronics
www.ti.com/consumer-apps
DSP
dsp.ti.com
Energy and Lighting
www.ti.com/energy
Clocks and Timers
www.ti.com/clocks
Industrial
www.ti.com/industrial
Interface
interface.ti.com
Medical
www.ti.com/medical
Logic
logic.ti.com
Security
www.ti.com/security
Power Mgmt
power.ti.com
Space, Avionics and Defense
www.ti.com/space-avionics-defense
Microcontrollers
microcontroller.ti.com
Video and Imaging
www.ti.com/video
RFID
www.ti-rfid.com
OMAP Mobile Processors
www.ti.com/omap
Wireless Connectivity
www.ti.com/wirelessconnectivity
TI E2E Community Home Page
e2e.ti.com
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright © 2012, Texas Instruments Incorporated
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising