Texas Instruments TLV320AIC3107EVM-K quick start Writing Scripts

Page 52

Writing Scripts

www.ti.com

G.3 Writing Scripts

A script is simply a text file that contains data to send to the serial control buses. The scripting language is simple, as is the parser for the language. Therefore, although the program is not forgiving about mistakes made in the source script file, the formatting of the file is simple. Consequently, mistakes are rare.

Each line in a script file is one command. Lines cannot be extended beyond one line. A line is terminated by a carriage return.

The first character of a line is the command. Commands are:

ISet interface bus to use

rRead from the serial control bus w Write to the serial control bus

# Comment b Break

d Delay

The first command, I, sets the interface to use for the commands to follow. This command must be followed by one of the following parameters:

i2cstd

Standard mode I2C bus

i2cfast

Fast mode I2C bus

spi8

SPI bus with

8-bit register addressing

spi16

SPI bus with

16-bit register addressing

gpio

Use the USB-MODEVM GPIO capability

For example, if a fast mode I2C bus is to be used, the script begins with:

I i2cfast

No data follows the break command. Anything following a comment command is ignored by the parser, provided that it is on the same line. The delay command allows the user to specify a time, in milliseconds, that the script pauses before proceeding.

Note: Unlike all other numbers used in the script commands, the delay time is entered in a decimal format. Also, note that because of latency in the USB bus as well as the time it takes the processor on the USB-MODEVM to handle requests, the delay time may not be precise.

A series of byte values follows either a read or write command. Each byte value is expressed in hexadecimal, and each byte must be separated by a space. Commands are interpreted and sent to the TAS1020 by the program using the protocol described in Section G.1.

The first byte following a read or write command is the I2C slave address of the device (if I2C is used) or the first data byte to write (if SPI is used—note that SPI interfaces are not standardized on protocols, so the meaning of this byte varies with the device being addressed on the SPI bus). The second byte is the starting register address that data is written to (again, with I2C; SPI varies—see Section G.1 for additional information about what variations may be necessary for a particular SPI mode). Following these two bytes are data, if writing; if reading, the third byte value is the number of bytes to read, (expressed in hexadecimal).

For example, to write the values 0xAA 0x55 to an I2C device with a slave address of 0x90, starting at a register address of 0x03, one would write:

#example script I i2cfast

w 90 03 AA 55 r 90 03 2

50

USB-MODEVM Protocol

SLAU261–November 2008

Submit Documentation Feedback

Image 52
Contents EVM-Compatible Device Data Sheets TLV320AIC3107EVM-KUSB-MODEVM SW2 Settings Features TLV320AIC3107EVM-K Block DiagramEVM Overview IntroductionTLV320AIC3107EVM-K Block Diagram USB-MODEVM Interface BoardDefault Configuration and Connections USB-MODEVM SW2 Settings2 TLV320AIC3107EVM Jumpers and Switches List of Stand-alone JumpersPower Connections Software Installation TLV320AIC3107EVM-K Setup and InstallationEVM Connections TLV320AIC3107EVM Software Quick Start USB-MODEM ConfigurationsQuick Start Tabs Quick Start Preset Configurations Quick Start Preset Configurations TabMain Software Screen With Indicators and Functions Main Software ScreenDetailed TLV320AIC3107 Block Diagram Audio Input/ADC Tab Audio Input/ADC TabBypass Paths Tab Bypass Paths TabAudio Interface Tab Audio Interface TabConfiguring the Codec Clocks and Fsref Calculation Clocks TabUse Without PLL Setting ADC and DAC Sampling RatesUse With PLL GPIO1 Tab GPIO1 TabAGC Tab AGC TabLeft AGC Settings Filters Tab Filters TabHigh-Pass Filter ADC FiltersDigital Effects Filter ADC De-emphasis Filters DAC FiltersDAC Digital Effects Filter Digital Effects Filters Shelf FiltersEQ Filters Analog Simulation FiltersPreset Filters User Filters10 DAC/Line Outputs Tab 3.6 3D EffectDAC Controls Line Output MixersHP Output Stage Configuration Tab Output Stage Configuration TabHigh Power Outputs Tab HP Outputs TabClass-D Output Tab Class-D Output TabCommand Line Interface Tab Command Line Interface TabFile Menu Appendix a EVM Connector Descriptions Analog Interface ConnectorsAnalog Input/Output Connectors Table A-1. Analog Input/Output ConnectorsBlock a and Block B Digital Interface Connectors J16 and J17 Table A-2. Block a and Block B Digital Interface PinoutPower Supply Connector Pin Header, J15 Table A-3. Power Supply PinoutAppendix B TLV320AIC3107EVM Schematic TP4 Avdd DACAppendix B Figure C-1. Assembly layer Appendix C TLV320AIC3107EVM Layout ViewsFigure C-3. Layer Figure C-5. Bottom Layer Appendix D TLV320AIC3107EVM Bill of Materials Table D-1. TLV320AIC3107EVM Bill of MaterialsNot Appendix E USB-MODEVM Schematic Ti a HIGH-PERFORMANCE Analog Division Appendix F USB-MODEVM Bill of Materials Table F-1. USB-MODEVM Bill of MaterialsDesignators Description Manufacturer Table G-2. Data Packet Configuration Appendix G USB-MODEVM ProtocolUSB-MODEVM Protocol Table G-1. USB Control Endpoint Hidsetreport Request 0x12 0xA0 0x02 0x05 0xAA 0x55 0x01 0xA0 0x02 0x05 Gpio Capability Table G-3. Gpio Pin AssignmentsWriting Scripts Writing Scripts Evaluation BOARD/KIT Important Notice FCC WarningImportant Notice