
www.ti.com
Writing Scripts
7 Writing Scripts
A script is simply a text file that contains data to send to the serial control buses.
Each line in a script file is one command. No provision is made for extending lines beyond one line, except
for the > command. 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
wWrite to the serial control bus
>Extend repeated write commands to lines below a w
#Comment
bBreak
dDelay
fWait for Flag
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
For example, if a fast mode I2C bus is to be used, the script begins with:
I i2cfast
A double-quoted string of characters following the bcommand can be added to provide information to the
user about each breakpoint. When the script is executed, the software's command handler halts as soon
as a breakpoint is detected and displays the string of characters within the double quotes.
The Wait for Flag command, f, reads a specified register and verifies if the bitmap provided with the
command matches the data being read. If the data does not match, the command handler retries for up to
200 times. This feature is useful when switching buffers in parts that support the adaptive filtering mode.
The command f syntax follows:
f [i2c address] [register] [D7][D6][D5][D4][D3][D2][D1][D0]
where 'i2c address' and 'register' are in hexadecimal format
and 'D7' through 'D0' are in binary format with values of 0,
1 or X for don't care.8
Anything following a comment command #is ignored by the parser, provided that it is on the same line.
The delay command dallows the user to specify a time, in milliseconds, that the script pauses before
proceeding. Note: The delay time is entered in decimal format.
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
TAS1020B by the program.
The first byte following an r(read) or w(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 will be written to (again, with I2C; SPI varies.
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 0x30, starting at a
register address of 0x03, the user writes:
19
SLOU294B–July 2010–Revised October 2012 TLV320AIC3256EVM-U Evaluation Module
Submit Documentation Feedback Copyright © 2010–2012, Texas Instruments Incorporated