Texas Instruments TLV320AIC12KEVMB-K appendix Writing Scripts, I2cstd, I2cfast, Spi8, Spi16, Gpio

Page 26

Kit Operation

www.ti.com

6.9.2Writing Scripts

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

Each line in a script file is one command. There is no provision for extending lines beyond one line. A line is terminated by a carriage return.

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

i = = = = = = =

Set interface bus to use

r = = = = = = =

Read 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 would begin 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 will pause 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 6.9.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 will vary with the device being addressed on the SPI bus). The second byte is the starting register address that data will be written to (again, with I2C; SPI varies—see Section 6.9.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).

26

TLV320AIC12KEVMB-K and TLV320AIC14KEVMB-K User's Guide

SLAU229B–October 2007–Revised August 2008

Submit Documentation Feedback

Image 26
Contents SN74LVC1G07 EVM-Compatible Device Data SheetsSN74LVC125A Power Supply Pinout List of Jumpers USB-MODEVM SW2 Settings Introduction FeaturesEVM Overview Analog InterfaceDigital Interface Pinout Alternate Analog ConnectorsDigital Interface SDA AIC12K/14K ResetSCL SclkPower Supply Pinout Power SuppliesUSB-MODEVM Interface Power Stand-Alone OperationAnalog Input Default Jumper LocationsTLV320AIC12KEVMB-K/14KEVMB-K Block Diagram Analog OutputTLV320AIC12KEVMB-K/14KEVMB-K Block Diagram Installation USB-MODEVM SW2 SettingsUSB-MODEVM Interface Board Program DescriptionIndicators and Main Screen Controls Information TabInformation Tab Preset Configurations Tab Sounds and Audio Devices PropertiesPreset Configurations Device Controls TabDevice Controls Tab Control Register 1 Tab Control Register 1 Tab Control Register 2 Tab Control Register 2 Tab Control Register 3 Tab Control Register 4 Tab Control Register 5 Tab Command Line Interface Tab Command Line Interface Tab File Menu Setreport USB-MODEVM ProtocolUSB Control Endpoint Hidsetreport Request Data Packet Configuration 0x01 0x80 0x02 Gpio Capability Gpio Pin AssignmentsI2cfast Writing ScriptsI2cstd Spi8#example script i i2cfast 80 01 45 A0 r 80 01 Here is an example of a script EVM Bill of Materials TLV320AIC12KEVMB/14KEVMB Bill of MaterialsUSB-MODEVM Bill of Materials JMP5, JMP6 JMP1-JMP4JMP8-JMP14 JMP7Appendix a TLV320AIC12KEVMB/14KEVMB Schematic Schematic diagram is provided as a referenceTLV320AIC12K14KDBTEVMB Ti a Appendix B USB-MODEVM Schematic Untitled USB-MODEVM Interface Rick Downs FCC Warnings Evaluation BOARD/KIT Important NoticeDSP Rfid