www.ti.com
Writing Scripts
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
:
#example script for 'wait for flag' command
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:
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 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.
SLAU282 – April 2009
USB-MODEVM Protocol
33
Submit Documentation Feedback