Hide thumbs Also See for I2CDriver:

Advertisement

Quick Links

Contents
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2
I
CDriver User Guide
Last updated on May 31, 2019
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . 11
. . . . . . . . . . . . . . . . . . . . 16
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
. . . . . . . . . . . . . . . . . . . . . . . . 18
©2019 Excamera Labs
1
3
3
4
5
5
7
7
9
9
15

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

    ......18 5.5.2 GUI ......19 ©2019 Excamera Labs...
  • Page 2 ......26 7.6 Specifications ......28 8 Support information Index ©2019 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 ©2019 Excamera Labs...
  • Page 4: Getting Started

    The top two signals carry power, the VCC line supplies 3.3 volts. Across the top of the display I CDriver continuously measures the USB bus voltage and the current output. ©2019 Excamera Labs...
  • Page 5: 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: ©2019 Excamera Labs...
  • Page 6 C device and write and read data. The command line utility i2ccl is also installed. For example to display status information: c:\>"c:\Program Files\Excamera Labs\I2CDriver\i2ccl.exe" COM6 i uptime 8991 4.957 V 30 mA 25.8 C SDA=1 SCL=1 speed=100 kHz ©2019 Excamera Labs...
  • Page 7: 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 8 CDriver User Guide For the command-line tool, clone the repository , then do: cd i2cdriver/c make -f linux/Makefile sudo make -f linux/Makefile install i2ccl /dev/cu.usbserial-DO00QS8D i (substituting your actual I CDriver’s ID for DO00QS8D) and you should see some- thing like: uptime 1651 4.971 V 5 mA 21.2 C SDA=1 SCL=1 speed=100 kHz...
  • Page 9: 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 10 CDriver User Guide which depending on your distribution looks something like this: There are more examples in the samples folder in the repository. The module has extensive help strings: >>> help(i2cdriver) displays the API documentation. ©2019 Excamera Labs...
  • Page 11: Reference

    • product – product code e.g. i2cdriver1 • serial – serial string of I2CDriver • uptime – time since I2CDriver boot, in seconds • voltage – USB voltage, in V • current – current used by attached device, in mA •...
  • Page 12 Start an I2C transaction Parameters • dev – 7-bit I2C device address • rw – read (1) or write (0) To write bytes [0x12,0x34] to device 0x75: >>> i2c.start(0x75, 0) >>> i2c.write([0x12,034]) (continues on next page) ©2019 Excamera Labs...
  • Page 13 *vv ) Write a devices register. Parameters • dev – 7-bit I2C device address • reg – register address 0-255 • vv – sequence of values to write To set device 0x34 byte register 7 to 0xA1: ©2019 Excamera Labs...
  • Page 14: C/C

    Parameters s – True to enter monitor mode, False to leave getstatus() Update all status variables 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. ©2019 Excamera Labs...
  • Page 15: Using I

    (write) or left arrow (read). There are gray lines connecting 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) ©2019 Excamera Labs...
  • Page 16: The Gui

    (TBD: describe how each button in the GUI works) 5.3 The command-line tool i2ccl is the same on all platforms. The first parameter to the command is the serial port, which depends on your operating system. All following parameters are control commands. These are: ©2019 Excamera Labs...
  • Page 17: Monitor Mode

    To show that it is in monitor mode, the I CDriver changes the character in the top-left of the display from D to M. There are several ways of entering monitor mode: • use the command-line tool: ©2019 Excamera Labs...
  • Page 18: Capture Mode

    D to C. $ python samples/capture.py /dev/ttyUSB0 Now capturing traffic to standard output (human-readable) log.csv Hit CTRL-C to leave capture mode <START 0x14 WRITE ACK> <WRITE 0x02 ACK> <WRITE 0x22 ACK> <STOP> ©2019 Excamera Labs...
  • Page 19: Gui

    The GUI also supports capture to CSV file. 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. ©2019 Excamera Labs...
  • Page 20: 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. ©2019 Excamera Labs...
  • Page 21: 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. ©2019 Excamera Labs...
  • Page 22: Technical Notes

    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 I C traffic by up to 10X. On Linux do: setserial /dev/ttyUSB0 low_latency On Windows and Mac OS follow these instructions. ©2019 Excamera Labs...
  • Page 23: Temperature Sensor

    CDriver User Guide 7.3 Temperature sensor The temperature sensor is located in the on-board EFM8 microcontroller. It is calibrated at manufacture to within 2 C. ©2019 Excamera Labs...
  • Page 24: Raw Protocol

    I C mode set pullup control lines u byte start analog voltage measurement read voltage measurement result So for example to send this sequence: ©2019 Excamera Labs...
  • Page 25 SDA line state, 0 or 1 SCL line state, 0 or 1 speed C bus speed, in KHz pullups pullup state byte 16-bit CRC of all input and output bytes (CRC-16-CCITT) The sample confirm.py shows the CRC-16-CCITT calculation. ©2019 Excamera Labs...
  • Page 26: Pull-Up Resistors

    4.7K 4.3K 2.2K pull-up strength 0 (i.e. no pull-up) 2.2K 4.3K 1.5K 4.7K 1.5K 2.2K 1.1K Ordering this by useful resistances, the 3-bit combinations are: 3-bit value Resistance 2.2K 4.3K 4.7K 1.5K 1.1K ©2019 Excamera Labs...
  • Page 27 In Python, the pullups are controlled by the setpullups() method, and the state can be read from the pullups variable. Both are 6-bit values as above. The GUI has a control for the pull-up resistors. It sets the same pull-up strength for both SDA and SCL. ©2019 Excamera Labs...
  • Page 28: Specifications

    CDriver User Guide 7.6 Specifications DC characteristics units Voltage accuracy 0.01 Current accuracy Temperature accuracy SDA,SCL low voltage high voltage Output current Current consumption AC characteristics units C speed Kbps Uptime accuracy Uptime rollover 31.7 years Startup time ©2019 Excamera Labs...
  • Page 29: Support Information

    CDriver User Guide 8 Support information Technical and product support is available at support@i2cdriver.com CDriver is built and maintained by Excamera Labs. ©2019 Excamera Labs...
  • Page 30: Index

    (i2cdriver.I2CDriver method), Example Beeper, scan() (i2cdriver.I2CDriver method), Compass, LM75B, 9, setpullups() (i2cdriver.I2CDriver Magnetometer, method), Potentiometer, setspeed() (i2cdriver.I2CDriver RGB, method), speed, getstatus() (i2cdriver.I2CDriver start() (i2cdriver.I2CDriver method), method), GUI, stop() (i2cdriver.I2CDriver method), heat-map, symbols, I2CDriver (class in i2cdriver ), temperature sensor,...
  • Page 31 CDriver User Guide uptime, latency, ports, write() (i2cdriver.I2CDriver method), ©2019 Excamera Labs...

Table of Contents