Texas Instruments TLV320AIC3253EVM-K Evaluation Module TLV320AIC3253EVM-K TLV320AIC3253EVM-K Scheda Tecnica

Codici prodotto
TLV320AIC3253EVM-K
Pagina di 42
Writing Scripts
For example, to write the values 0xAA 0x55 to an I
2
C device with a slave address of 0x30, starting at a
register address of 0x03, the user writes:
#example script
I i2cfast
w 30 03 AA 55
r 30 03 02
This script begins with a comment, specifies that a fast I
2
C bus will be used, then writes 0xAA 0x55 to the
I
2
C slave device at address 0x30, 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 I
2
C devices in the script; the read or write
commands does that.
If extensive repeated write commands are sent and commenting is desired for a group of bytes, the >
command can be used to extend the bytes to other lines that follow. A usage example for the command
follows:
#example script for '>' command
I i2cfast
# Write AA and BB to registers 3 and 4, respectively
w 30 03 AA BB
# Write CC, DD, EE and FF to registers 5, 6, 7 and 8, respectively
> CC DD EE FF
# Place a commented breakpoint
b "AA BB CC DD EE FF was written, starting at register 3"
# Read back all six registers, starting at register 3
r 30 03 06
The following example demonstrates usage of the Wait for Flag command, f:
I i2cfast
# Switch to Page 44
w 30 00 2C
# Switch buffers
w 30 01 05
# Wait for bit D0 to clear. 'x' denotes a don't care.
f 30 01 xxxxxxx0
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:
Once the script is written, it can be used in the command window by running the program, and then
selecting Open Script File... from the File menu. Locate the script and open it. The script is then displayed
in the command buffer. The user can also edit the script once it is in the buffer and save it by selecting
Save Script File... from the File menu.
Once the script is in the command buffer, it can be executed by pressing the Execute Command Buffer
button. If there are breakpoints 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.
34
Writing Scripts
SLAU317A – May 2010 – Revised October 2012
Copyright © 2010–2012, Texas Instruments Incorporated