www.ti.com

Kit Operation

For example, to write the values 0x45 0xA0 to an I2C device with a slave address of 0x80, starting at a register address of 0x01, one would write:

#example script i i2cfast

w 80 01 45 A0 r 80 01 02

This script begins with a comment, specifies that a fast I2C bus will be used, then writes 0x45 0xA0 to the I2C slave device at address 0x80, writing the values into registers 0x01 and 0x02. The script then reads back two bytes from the same device starting at register address 0x01. Note that the slave device value does not change. It is not necessary to set the R/W bit for I2C devices in the script; the read or write commands will do that for the user.

Any text editor may 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 Command File... from the File menu. Locate the script and open it. The script will then be displayed in the command buffer. The user may also edit the script once it is in the buffer and save it as specified in Section 6.9.

Once the script is in the command buffer, it may be executed by pressing the Execute Command Buffer button. If the user has placed breakpoints in the script, it will execute to that point, and a dialog box will show up with a continue button to continue executing the script.

Please refer to sections 3.1 (Power Down and Reset) and section 3.2 (AIC12 Control Register Programming Procedures) on the TLV320AIC12/13/14/15 Codec Operating In Stand-Alone Slave Mode application note for important details on programming the codec.

Special care must be taken when writing subregisters (4A-4B and 5A-5D).

Example: w 80 01 45 A0 01 20 B8 00

The previous command writes registers 1, 2, 3, 4A, 5C and 6. It will not increment from 3 to 4A and then to 4B. The subregister to be written will depend on the data.

SLAU229B–October 2007–Revised August 2008

TLV320AIC12KEVMB-K and TLV320AIC14KEVMB-K User's Guide

27

Submit Documentation Feedback

Page 27
Image 27
Texas Instruments TLV320AIC12KEVMB-K appendix #example script i i2cfast 80 01 45 A0 r 80 01