Texas Instruments TLV320AIC3107EVM-K quick start Writing Scripts

Page 53

www.ti.com

Writing Scripts

This script begins with a comment, specifies that a fast I2C bus is used, then writes 0xAA 0x55 to the I2C slave device at address 0x90, writing the values into registers 0x03 and 0x04. The script then reads back two bytes from the same device starting at register address 0x03. Note that the slave device value does not change. It is unnecessary to set the R/W bit for I2C devices in the script; the read or write commands does that.

Here is an example of using an SPI device that requires 16-bit register addresses:

#setup TSC2101 for input and output

#uses SPI16 interface

#this script sets up DAC and ADC at full volume, input from onboard mic

#Page 2: Audio control registers

w 10 00 00 00 80 00 00 00 45 31 44 FD 40 00 31 C4

w 13 60 11 20 00 00 00 80 7F 00 C5 FE 31 40 7C 00 02 00 C4 00 00 00 23 10 FE 00 FE 00

Note that blank lines are allowed. However, be sure that the script does not end with a blank line. Although ending with a blank line does not cause the script to fail, the program does execute that line, and therefore, may prevent the user from seeing data that was written or read back on the previous command.

In this example, the first two bytes of each command are the command word to send to the TSC2101 (0x1000, 0x1360); these are followed by data to write to the device starting at the address specified in the command word. The second line may wrap in the viewer being used to look like more than one line; careful examination shows, however, that only one carriage return is on that line, following the last 00.

Any text editor can be used to write these scripts; Jedit is an editor that is highly recommended for general usage. For more information, go to: http://www.jedit.org.

Once the script is written, it can be used in the command window by running the program, and then selecting Open Command File... from the File menu. Locate the script and open it. The script then is displayed in the command buffer. The user can also edit the script once it is in the buffer, but saving of the command buffer is not possible at this time (this feature may be added at a later date).

Once the script is in the command buffer, it may be executed by pressing the Execute Command Buffer button. If breakpoints are in the script, the script executes to that point, and the user is presented with a dialog box with a button to press to continue executing the script. When ready to proceed, push that button and the script continues.

Here an example of a (partial) script with breakpoints using the AIC33EVM as an example:

# setup AIC33 for input and output

# uses I2Cinterface I i2cfast

#reg 07 - codec datapath w 30 07 8A

r 30 07 1 d 1000

#regs 15/16 - ADC volume, unmute and set to 0dB w 30 0F 00 00

r 30 0F 2 b

This script writes the value 8A at register 7, then reads it back to verify that the write was good. A delay of 1000 ms (one second) is placed after the read to pause the script operation. When the script continues, the values 00 00 is written starting at register 0F. This output is verified by reading two bytes, and pausing the script again, this time with a break. The script does not continue until the user allows it to by pressing OK in the dialog box that is displayed due to the break.

SLAU261–November 2008

USB-MODEVM Protocol

51

Submit Documentation Feedback

Image 53
Contents TLV320AIC3107EVM-K EVM-Compatible Device Data SheetsUSB-MODEVM SW2 Settings TLV320AIC3107EVM-K Block Diagram FeaturesEVM Overview IntroductionUSB-MODEVM Interface Board TLV320AIC3107EVM-K Block DiagramUSB-MODEVM SW2 Settings Default Configuration and Connections2 TLV320AIC3107EVM Jumpers and Switches List of Stand-alone JumpersPower Connections EVM Connections TLV320AIC3107EVM-K Setup and InstallationSoftware Installation Quick Start Tabs Quick Start USB-MODEM ConfigurationsTLV320AIC3107EVM Software Quick Start Preset Configurations Tab Quick Start Preset ConfigurationsMain Software Screen Main Software Screen With Indicators and FunctionsDetailed TLV320AIC3107 Block Diagram Audio Input/ADC Tab Audio Input/ADC TabBypass Paths Tab Bypass Paths TabAudio Interface Tab Audio Interface TabClocks Tab Configuring the Codec Clocks and Fsref CalculationUse With PLL Setting ADC and DAC Sampling RatesUse Without PLL GPIO1 Tab GPIO1 TabAGC Tab AGC TabLeft AGC Settings Filters Tab Filters TabDigital Effects Filter ADC ADC FiltersHigh-Pass Filter DAC Digital Effects Filter DAC FiltersDe-emphasis Filters Shelf Filters Digital Effects FiltersAnalog Simulation Filters EQ FiltersUser Filters Preset Filters3.6 3D Effect 10 DAC/Line Outputs TabLine Output Mixers DAC ControlsOutput Stage Configuration Tab HP Output Stage Configuration TabHP Outputs Tab High Power Outputs TabClass-D Output Tab Class-D Output TabCommand Line Interface Tab Command Line Interface TabFile Menu Analog Interface Connectors Appendix a EVM Connector DescriptionsAnalog Input/Output Connectors Table A-1. Analog Input/Output ConnectorsTable A-2. Block a and Block B Digital Interface Pinout Block a and Block B Digital Interface Connectors J16 and J17Table A-3. Power Supply Pinout Power Supply Connector Pin Header, J15TP4 Avdd DAC Appendix B TLV320AIC3107EVM SchematicAppendix B Appendix C TLV320AIC3107EVM Layout Views Figure C-1. Assembly layerFigure C-3. Layer Figure C-5. Bottom Layer Table D-1. TLV320AIC3107EVM Bill of Materials Appendix D TLV320AIC3107EVM Bill of MaterialsNot Appendix E USB-MODEVM Schematic Ti a HIGH-PERFORMANCE Analog Division Table F-1. USB-MODEVM Bill of Materials Appendix F USB-MODEVM Bill of MaterialsDesignators Description Manufacturer Appendix G USB-MODEVM Protocol Table G-2. Data Packet ConfigurationUSB-MODEVM Protocol Table G-1. USB Control Endpoint Hidsetreport Request0x12 0xA0 0x02 0x05 0xAA 0x55 0x01 0xA0 0x02 0x05 Table G-3. Gpio Pin Assignments Gpio CapabilityWriting Scripts Writing Scripts FCC Warning Evaluation BOARD/KIT Important NoticeImportant Notice