Texas Instruments USB2ANY: Is there an easy way to repeat I2C Bus accesses?
Depending on the GUI (Graphical User Interface) for the target IC, for example, SigCon Architect can use Python scripts.
Below is an example Python script.
Display 1 byte contents of Register Address 0x05 of I2C Device Address 0x7A
Furthermore, write 0xA0 to the same register of the same device,
This is to make sure that what you wrote is reflected.
When displaying, examples of decimal notation and hexadecimal notation are also shown.
| import time import math Rdata = board.ReadI2C(0x7A, 0x05, 1) print "Device 0x7A, Reg 0x05 = ", Rdata board. Write I2C (0x7A, 0x05, 0xA0) Rdata = board.ReadI2C(0x7A, 0x05, 1) print "Device 0x7A, Reg 0x05 = ", Rdata print "Device 0x7A, Reg 0x05 = ", hex(Rdata) |
****** Execution result ********
>*** Running PY-test.py ***
Device 0x7A, Reg 0x05 = 1
Device 0x7A, Reg 0x05 = 160
Device 0x7A, Reg 0x05 = 0xa0
*** Script execution time 0 min 0.040 sec ***
Experienced FAE
Free consultation is available.
From specific product specifications to parts selection, the Company FAE will answer your technical concerns free of charge. Please feel free to contact us.