Hide thumbs Also See for I2CDriver:

Advertisement

Quick Links

Last updated on February 10, 2021
Contents
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2
2
I
CDriver and I
CMini User Guide
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
. . . . . . . . . . . . . . . . . . . . 19
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
. . . . . . . . . . . . . . . . . . . . . . . . 21
©2021 Excamera Labs
1
3
3
4
6
6
8
9
10
13
23

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the I2CDriver and is the answer not in the manual?

Questions and answers

Summary of Contents for Excamera I2CDriver

  • Page 1: Table Of Contents

    ......21 5.5.2 GUI ......21 6 Examples ©2021 Excamera Labs...
  • Page 2 7.8 Specifications ......39 8 Troubleshooting 9 Support information Index ©2021 Excamera Labs...
  • Page 3: Overview

    • Sturdy componentry: uses an FTDI USB serial adapter, and Silicon Labs automotive-grade EFM8 controller • Open hardware: the design, firmware and all tools are under BSD li- cense • Flexible control: GUI, command-line, C/C++, and Python 2/3 host soft- ware provided for Windows, Mac, and Linux ©2021 Excamera Labs...
  • Page 4: Getting Started

    Connect the three sets of colored hookup wires as shown, following the same sequence as on the colored label: black signal ground 3.3 V supply blue C data yellow C clock Across the top of the display I CDriver continuously shows the USB bus voltage and the current output. ©2021 Excamera Labs...
  • Page 5 CDriver and I CMini User Guide CMini also has a micro USB connector. Its Qwiic connector is polarized; it at- taches as shown. The color coding for the signals is the same as for I CDriver. ©2021 Excamera Labs...
  • Page 6: Software Installation

    • Windows/Mac/Linux C/C++ bindings Installation of the GUI and command-line utilities varies by platform. 3.1 Windows This installer contains the GUI and command-line utilities. The GUI shortcut is installed on the desktop: launching it brings up the control window: ©2021 Excamera Labs...
  • Page 7 The command line utility i2ccl is also installed, and added to the Windows PATH. For example to display status information: c:\>i2ccl COM6 i uptime 8991 4.957 V 30 mA 25.8 C SDA=1 SCL=1 speed=100 kHz ©2021 Excamera Labs...
  • Page 8: Linux

    See below for more information on the command-line syntax. 3.2 Linux The GUI is included in the i2cdriver Python package, compatible with both Python 2 and 3. To install it, open a shell prompt and do: sudo pip install i2cdriver Then run it with i2cgui.py...
  • Page 9: Macos

    CDriver and I CMini User Guide 3.3 MacOS The GUI is included in the i2cdriver Python package, compatible with both Python 2 and 3. To install it, open a shell prompt and do: sudo pip install i2cdriver Then run it with i2cgui.py...
  • Page 10: Apis

    The I CDriver bindings can be installed with pip like this: pip install i2cdriver then from Python you can read an LM75B temperature sensor with: >>> import i2cdriver >>> i2c = i2cdriver.I2CDriver("/dev/ttyUSB0") >>> d=i2cdriver.EDS.Temp(i2c) >>> d.read() 17.875 >>> d.read() 18.0 You can print a bus scan with: >>>...
  • Page 11 There are more examples in the samples folder in the repository. The module has extensive help strings: >>> help(i2cdriver) displays the API documentation, and the Python module is documented in full https://i2cdriver.readthedocs.io/en/latest/index.html. ©2021 Excamera Labs...
  • Page 12: C/C

    CDriver and I CMini User Guide 4.2 C/C++ CDriver is contained in a single source file with a single header. Both are in this subdirectory. Usage follows the Python API and is fairly self-explanatory. ©2021 Excamera Labs...
  • Page 13: Using I

    (write) or left arrow (read). The gray lines connect the address byte to its heat-map indicator. Following this is a series of data bytes. Each byte is shown in hex, with either a green dot (ACK) or red dot ©2021 Excamera Labs...
  • Page 14 The above sequence is very typical for reading registers from an I C Device. Note that the final NACK (red dot) is not an error condition, but the standard way of handling the last byte of read transaction. ©2021 Excamera Labs...
  • Page 15: The Gui

    C peripherals: an LM75B temperature sensor and two 7-segment display modules. Starting the GUI and connecting to the I CDriver on COM16 shows the temper- ature sensor at address 48 and the two display modules at addresses 14 and ©2021 Excamera Labs...
  • Page 16 Selecting address 48 and clicking on read reads a single byte from the temper- ature sensor. The I CDriver display shows the traffic immediately. This LM75B sensor reports temperature in Celcius, so the hex byte 1A repre- sents a temperature of 26 C. ©2021 Excamera Labs...
  • Page 17 CDriver and I CMini User Guide Selecting the left-hand display (address 14) and entering the hex values 01 19 then clicking on write sets the first LED to the digits 19. ©2021 Excamera Labs...
  • Page 18 CDriver and I CMini User Guide Similarly selecting address 15 and entering the hex values 01 85 then clicking on write sets the second LED to 85. ©2021 Excamera Labs...
  • Page 19: The Command-Line Tool I2Ccl

    0x25,0x26 to register 2 is: i2ccl /dev/ttyUSB0 w 0x48 2,0x25,0x26 p To read register 3 of the LM75B, first write the register address 3, then read two bytes as above: i2ccl /dev/ttyUSB0 w 0x48 3 r 0x48 2 0x50,0x00 ©2021 Excamera Labs...
  • Page 20: Monitor Mode

    5.5 Capture mode In capture mode, the I CDriver does not write any data to the I C bus. Instead it monitors bus traffic and transmits it via USB for recording on the PC. ©2021 Excamera Labs...
  • Page 21: Command Line

    When run, it displays any traffic on standard output. It also writes a traffic summary to log.csv which can be examined and processed by any tool that can accept CSV files. 5.5.2 GUI The GUI also supports capture to CSV file. ©2021 Excamera Labs...
  • Page 22 CMini User Guide Clicking “Capture mode” starts the capture and prompts for a destination CSV file. The character in the top-left of the display changes from D to C. Capture continues until you click “Capture mode” again. ©2021 Excamera Labs...
  • Page 23: Examples

    LED. As you twist the module, the color changes. For example there is a particular direction for pure red, as well as all other colors. The code reads the magnetic field direction, scales the values to 0-255, and sets the LED color. ©2021 Excamera Labs...
  • Page 24: Egg Timer

    MOTE, DIG2 and BEEP modules. It shows 2-digit “now serving” number, and each time ’+’ is pressed on the remote it increments the counter and makes a beep, so the next customer can be served. Pressing ’-’ turns the number back one. ©2021 Excamera Labs...
  • Page 25: Technical Notes

    7.2 Decreasing the USB latency timer CDriver performance can be increased by setting the USB latency timer to its minimum value of 1 ms. This can increase the speed of two-way traffic by up to 10X. On Linux do: setserial /dev/ttyUSB0 low_latency ©2021 Excamera Labs...
  • Page 26: Temperature Sensor

    CDriver and I CMini User Guide On Windows and Mac OS follow these instructions. 7.3 Temperature sensor The temperature sensor is located in the on-board EFM8 microcontroller. It is calibrated at manufacture to within 2 C. ©2021 Excamera Labs...
  • Page 27: Raw Protocol

    112 status bytes enter monitor mode enter capture mode enter bitbang mode leave bitmang, return to I C mode set pullup control lines reboot I CDriver So for example to send this sequence: ©2021 Excamera Labs...
  • Page 28: Transmit Status Info

    STOP 7.4.1 ?: transmit status info ? (0x3f) The response is always 80 bytes, space padded. For example:: [i2cdriver1 DO01JUOO 000000061 4.971 000 23.8 I 1 1 100 24 ffff The fields are space-delimited: ©2021 Excamera Labs...
  • Page 29: E: Echo Byte

    This command is normally used when first connecting to the I CDriver to check the serial channel. 7.4.3 1: set speed to 100 KHz 1 (0x31) Sets the I C bus speed to 100 KHz. There is no reponse. ©2021 Excamera Labs...
  • Page 30: 4: Set Speed To 400 Khz

    7.4.6 0x80-bf : read 1-64 bytes, NACK the final byte count-1 count is the number of bytes to read. CDriver ACKs each read byte, except the last which is NACKed. The response is count bytes of I C bus data. ©2021 Excamera Labs...
  • Page 31: 0Xc0-Ff : Write 1-64 Bytes

    64 bytes from an I C device. The response is count bytes of I C bus data. 7.4.9 p: send STOP p (0x70) Send an I C STOP symbol, ending the current transaction. There is no re- sponse. ©2021 Excamera Labs...
  • Page 32: X: Reset I 2 C Bus

    • START, select address dev for writing • write a single byte addr • START, select address dev for reading • read count bytes item STOP The response is count bytes of I C bus data. ©2021 Excamera Labs...
  • Page 33: D: Scan Devices, Return 112 Status Bytes

    CDriver updates the graphical display with any traffic on the I C bus. To exit monitor mode, send byte 0x20: 0x20 7.4.14 c: enter capture mode 7.4.15 b: enter bitbang mode b (0x62) Enters bitbang mode. See section 7.6 Bitbang mode. ©2021 Excamera Labs...
  • Page 34: I: Leave Bitmang, Return To I C Mode

    CDriver has 6 programmable pull-up resistors, 3 each for SDA and SCL. 6 control bits each enable or disable a pull-up resistor. These bits are: resistor 2.2K to SDA 4.3K to SDA 4.7K to SDA 2.2K to SCL 4.3K to SCL 4.7K to SCL ©2021 Excamera Labs...
  • Page 35: Bitbang Mode

    In bitbang mode, the SCL and SDA signals are driven as bidirectional IO sig- nals. Following the ’b’ command, the host sends a bitbang control sequence where each sent byte controls the state of the SCL and SDA signals. Each byte is a ©2021 Excamera Labs...
  • Page 36 SDA state SCL state The special value 0x40 ends the bitbang control sequence, but does not exit bitbang mode. To exit bitbang mode and re-enter I C mode, send command ’i’. ©2021 Excamera Labs...
  • Page 37: Capture Mode

    ACK/NAK. Hence each I C byte results in three triples being sent. The first 8 bits are the big-endian I C byte. The final bit is the ACK/NAK. Note that I represents ACK as 0, and NAK as 1. ©2021 Excamera Labs...
  • Page 38 1 0 1 bit triple 0 0 0 bit triple 1 0 1 read byte 0xa2, NAK STOP Hence the bytes sent from the I CDriver for this sequence are: 0x1c, 0xac, 0xbe, 0xc1, 0xca, 0xe8, 0x88, 0xd8, 0xd2 ©2021 Excamera Labs...
  • Page 39: Specifications

    7.8 Specifications CDriver DC characteristics units Voltage accuracy 0.01 Current accuracy Temperature accuracy SDA,SCL low voltage high voltage Output current Current consumption CMini DC characteristics units Temperature accuracy SDA,SCL low voltage high voltage Output current Current consumption ©2021 Excamera Labs...
  • Page 40: Troubleshooting

    Check target circuit for logic shorts CDriver reports USB voltage below 4.0 V Check USB cable and port 9 Support information Technical and product support is available at support@spidriver.com CDriver is built and maintained by Excamera Labs. ©2021 Excamera Labs...
  • Page 41: Index

    Index bitbang, jumpers, bitbang control sequence, Monitor mode, bus scan, 10, protocol, capture, pull-ups, Capture mode, capture.py, Qwiic, COM port, register read, COM10 etc., 8, Remote control, CRC, speed, display, symbols, drivers C/C++, temperature sensor, Linux, uptime, Mac, Python, latency, Windows, ports, Example...
  • Page 42 Mouser Electronics Authorized Distributor Click to View Pricing, Inventory, Delivery & Lifecycle Information: Excamera Labs cs-i2cdriver-01 cs-i2cdriver-02 CS-I2CDRIVER-03 CS-I2CMINI-01 CS-I2CMINI-02 CS-I2CMINI-03...

This manual is also suitable for:

I2cmini

Table of Contents