MCC i2cStick User manual

User’s Guide
USB to I2C Bus
Host Adapter
with iPort Utility Pack Software
www.mcc-us.com

Introduction
The MCC i2cStick™ USB to I2C Host Adapter (#MIIC-207) allows any Windows
2000, XP, Vista(x86/x64), or 7(x86/x64) PC, with a free USB port or self-powered
USB hub, to become an I2C Master or Slave device, transmitting or receiving I2C
messages between the PC and one or more I2C devices across an I2C Bus.
What’s New!
• Compact shirt-pocket size for on-the-go developers, application engineers,
field service engineers, and technicians.
• Fixed-speed communications (115.2K baud).
• Master Transmit Packet-Error Checking (PEC) detection.
• Low-cost I2C Bus connector and cabling.
This user’s guide describes the installation and operation of the i2cStick host
adapter, Virtual Communication Port (VCP) driver, the iPort Utility Pack Software
for Windows, and includes the Programmer’s Reference for creating custom
applications.
Are you new to I2C? Want to know more? We suggest you review “What is I2C?” at
www.mcc-us.com/I2CBusTechnicalOverview.pdf.
This MCC product uses NXP (Philips) components and is licensed to use the I²C
Bus.
“Purchase of Philips I²C components conveys a license under the Philips’ I²C
patent to use the components of the I²C system, provided the system conforms to
the I²C specifications defined by Philips.”
I²C is a trademark of NXP (Philips) Corporation.
05-JAN-11

Copyright© 2011 by Micro Computer Control Corporation. All rights are reserved.
No part of this publication may be reproduced by any means without the prior
written permission of Micro Computer Control Corporation, PO Box 275,
Hopewell, New Jersey 08525 USA.
DISCLAIMER: Micro Computer Control Corporation makes no representations or
warranties with respect to the contents hereof and specifically disclaims any implied
warranties of merchantability or fitness for any particular purpose. Further, Micro
Computer Control Corporation reserves the right to revise the product described in
this publication and to make changes from time to time in the content hereof
without the obligation to notify any person of such revisions or changes.
WARNING - Life Support Applications: MCC products are not designed for use
in life support appliances, devices, or systems where the malfunction of the product
can reasonably be expected to result in a personal injury.
WARNING - Radio Frequency Emissions: This equipment has been tested and
found to comply with the limits for a Class A digital device, pursuant to part 15 of
the FCC rules. These limits are designed to provide reasonable protection against
interference when the equipment is operated in a commercial environment. This
equipment generates, uses, and can radiate radio frequency energy and, if not
installed and used in accordance with the instruction manual, may cause
interference to radio communications. Operation of this equipment in a residential
area is likely to cause interference, in which case the user will be required to correct
the interference at his own expense.
WARNING - Electrostatic Discharge (ESD) Precautions: Any damage caused by
Electrostatic Discharge (ESD) through inadequate earth grounding is NOT covered
under the warranty of this product. See the “Electrostatic (ESD) Precautions”
section of this guide for more information.
Printed in the United States of America

Table of Contents
Part 1 - i2cStick USB to I2C Bus Host Adapter ..........................1
1 Overview .......................................................2
i2cStick USB to I2CBusHostAdapter ................................2
i2cStickVirtualCommunicationsPort(VCP)...........................2
iPort Utility Pack Software .........................................3
i2cStickProgrammer’sReference....................................3
PackingSlip.....................................................3
SystemRequirements .............................................3
2 Interconnects ....................................................3
USBConnector ..................................................4
VirtualCommunicationsPort(VCP) ...............................4
I2C Interface Connector ............................................4
3 HardwareConfiguration ...........................................6
Pull-upResistors .................................................6
Connectinga5Vi2cSticktoa3.3VoltTargetSystem....................6
ConnectingtoanSMBusTargetSystem...............................6
4 ESD (Electrostatic Discharge) Precautions .............................7
Host Computer Grounding .........................................7
Grounding Solutions ..............................................8
5 DriverSoftwareSet-Up............................................8
DriverInstall ....................................................8
DriverUpdate ...................................................9
DriverUninstall..................................................9
6.HardwareSet-Up.................................................9
USBConnection .................................................9
I2CBusConnection ..............................................10
Part 2 - iPort Utility Pack for Windows ...............................11
1 iPort Utility Pack for Windows .....................................13
iPortMessageCenter.............................................13
iPortMessageManager ...........................................14

2 SystemRequirements ............................................15
3 iPort Utility Pack Installation ......................................15
InstallingfromCD...............................................15
InstallingfromtheWeb...........................................15
4 iPortMessageCenter ............................................16
MessageCenterOperations........................................17
StartingtheMessageCenter .....................................17
SelectingtheAdapter ..........................................17
SelecttheCommunicationsPort ..................................18
OptionsMenu ................................................18
EstablishAdapterCommunicationsLink ...........................18
Entering or Editing I2CMessages .................................18
Set I2CAddress ...............................................19
SetMessageRead/WriteDirection ................................19
SpecifyRepeatedStartMessages .................................19
SetTimeDelay ...............................................20
Specify Write Data or Read Byte Count ............................20
InsertingandDeletingMessages..................................21
SavingorLoadingMessageLists .................................21
SendtheMessageList..........................................21
SpecialEventHandling.........................................21
Slave Not Acknowledging ......................................22
CommandLineArguments ........................................23
SetAdapterType..............................................24
Set RS-232 Communication Port .................................24
Set RS-232 Baud Rate ..........................................24
Set I2CBusClockRate .........................................24
Enable/INTSignalMonitor .....................................25
StopOnBusy ................................................25
StopOnArbitrationLoss .......................................25
Stop On Slave Negative Acknowledgment ..........................25
BeepOnBusy ................................................25
BeepOnArbitrationLoss .......................................26
Beep On Slave Negative Acknowledgment .........................26
BeepOn/INTAssert...........................................26
Load I2CMessageListFile......................................26
Saved I2CMessageListFile .....................................27
AutoOpen...................................................27

AutoSend ...................................................27
AutoExit....................................................27
5 iPort MessageManager ..........................................28
MessageManagerOperations ......................................29
StartingtheMessageManager ...................................29
SelecttheAdapter.............................................29
EstablishAdapterCommunicationsLink ...........................30
BasicSetup ..................................................30
AdvancedSetup ..............................................31
Adapter’s Own I2CSlaveAddress ..............................31
GeneralCallEnable .........................................31
I2CBusMasterBitRate ......................................31
I2CBusTime-Out...........................................31
EnableINTSignalMonitor ...................................31
Diagnostic Setup ..............................................32
LogFileLevel .............................................32
LogFileName .............................................32
LogFileSize...............................................32
Sending I2CMessages..........................................33
MasterOperations.............................................33
SpecifyingtheDestinationAddress ...............................33
RepeatedStartMessages........................................33
AutoRepeat..................................................34
Master Transmitting Data .......................................34
SpecifyingMasterTxMessageBytes ...........................34
Sending Master Transmit Messages .............................35
Master Receive Data ...........................................35
SpecifyingDatatoRead......................................35
Negative Acknowledge Last Byte ..............................36
Master Transmit and Receive ....................................36
SlaveOperations ..............................................36
Slave Transmit Data ...........................................36
Slave Receive Data ............................................36
6 Uninstalling Software Components ..................................37
Uninstalling iPort Utility Pack for Windows ...........................37
UninstallingVCPDeviceDriver....................................37
Part 3 - i2cStick Programmer’s Reference ............................39

QuickStart .......................................................40
ASCIICommandInterface ..........................................41
Synchronous Interface Events ......................................42
i2cStickReset ................................................42
StatusDisplay ................................................43
SerialCommunicationsBaudRate ................................43
Close I2CConnection ..........................................44
Set Destination I2CSlaveAddress ................................44
Echo/PromptControl ..........................................44
SerialCommunicationsFlowControl..............................44
I2CGeneralCallControl........................................45
HexOnlyDisplayControl.......................................45
Set i2cStick’s Own I2CSlaveAddress .............................46
I2CBusClockRateControl .....................................46
CommandMenuDisplay .......................................46
InterruptSignalControl/Status ...................................47
Open I2CConnection ..........................................48
MasterReadMessage ..........................................48
Slave Transmit Message ........................................49
Master Transmit Message .......................................50
Set I2CBusTime-oUtinmsec ...................................51
DisplayFirmwareVersion ......................................51
eXtendedCommands ..........................................52
Display Tx bYte Count .........................................54
Asynchronous Interface Events ....................................55
Slave Transmit Request .........................................55
Slave Receive Complete ........................................55
General Call Receive Complete ..................................55
i2cStickReady ...............................................56
Slave Not Acknowledging ......................................56
i2cStickBusy ................................................56
I2CBusArbitrationLoss........................................56
I2CBusErrorDetected .........................................56
I2CBusTime-outDetected ......................................57
i2cStickConnectionClosed .....................................57
InvalidCommandArgument.....................................57
Slave Transmit Request Not Active ...............................57
Invalidi2cStickCommand ......................................57
i2cStick Receive Buffer Overflow ................................58

ExampleCode ....................................................59
i2cStickReset ..................................................59
i2cStick Initialization ............................................59
Master Transmit Message .........................................59
Master Receive Message .........................................59
CommunicationEventProcessing...................................60
i2cStick Revision Report ...........................................63
Additional Information ............................................63
Appendix A - I2C Connector Information .............................64


1
Part 1 - i2cStick USB to I2C Bus Host Adapter
Part 1
USB to I2C Bus
Host Adapter
User’s Guide
Model: MIIC-207

2
1 Overview
The MCC i2cStick USB to I2C Bus Host Adapter (#MIIC-207) allows any
Windows 2000, XP, Vista, or 7 PC with a free USB port or self-powered USB hub,
to become an I2C Master or Slave device, transmitting or receiving I2C messages
between the PC and one or more I2C devices across an I2C Bus.
i2cStick Product Features:
• Add an I2C port to ANY Windows 2000, XP, Vista(x86/x64), 7(x86/x64) PC.
• Compatible with USB 2.0 Specifications.
• Works with USB Full or High-Speed systems.
• Supports I2C Bus Master and Slave, Transmit and Receive operations.
• Four I2C bit rates up to 400 KHz.
• Compatible with 3.3V to 5V I2C Bus pull-up voltages.
• Switch-enabled internal I2C Bus pull-up resistors.
• Based on a High Performance I2C Bus Co-Processor.
• Optimized for High Bus Throughput, and Low Inter-byte overhead.
• Free I2C Message Center, Message Manager, and iBurner EEPROM
Programming utility software.
• Easy to use Virtual Communications Port (VCP) driver.
• Build custom I2C Bus applications using our simple ASCII Text Commands, or
our free MS.NET Class Library.
• Compatible with iPort/AI, iPort/AFM, iPort/USB applications. No software
changes required.
The i2cStick package includes the following items:
1.1 i2cStick USB to I2C Bus Host Adapter
The i2cStick adapter is a bus-powered USB device that plugs into a host computer’s
USB port or self-powered USB hub and generates I2C Bus signals.
1.2 i2cStick Virtual Communications Port (VCP)
The i2cStick Virtual Communications Port (VCP) driver creates a virtual serial port
within the i2cStick device. To a Windows software application, the VCP looks just
like a legacy RS-232 serial communications port (COMn), allowing standard serial
communication programming methods to work unchanged. No special USB
programming is required.

3
1.3 iPort Utility Pack Software
This free software package includes the iPort Message Center and Message
Manager applications to help you easily send and receive I2C Bus messages.
1.4 i2cStick Programmer’s Reference
This section of the i2cStick User’s Guide provides a programmer’s guide to creating
custom I2C Bus applications. Find additional sample programs and complete
projects on our web site’s Sample Program page.
1.5 Packing Slip
This package includes the following items:
• i2cStick USB to I2C Bus Host Adapter (#MIIC-207).
• i2cMini Interface 1x5 2.54 mm (.100") or i2cMini Clip-Lead cable (optional).
• i2cStick User’s Guide (this document).
• iPort Utility Pack for Windows CD.
1.6 System Requirements
a. A host computer with one free USB port or self-powered USB hub.
b. Windows 2000 (x86), XP, Vista, 7 (x86/x64).
2 Interconnects
The i2cStick includes two interconnections:
2.1 USB Connector
The USB Type A connector provides connection from the I2C adapter to a USB port

4
on the host computer or self-powered USB hub. The i2cStick operates as a
low-power (<100 mA) bus-powered USB device.
2.1.1 Virtual Communications Port (VCP)
The i2cStick provides a Virtual Communications Port (VCP) interface via a host
computer driver. Install the iPort Utility Pack (available on CD or online) and plug
the i2cStick into a USB port. Windows will automatically load the driver and
instantly create a new com port (COMn) on your computer. The VCP hides the
complexities of a USB physical interface. Application programs running on the host
computer communicate with the i2cStick via the standard Windows
Communications Application Program Interface (API).
The i2cStick includes the following communication signals VCP interface:
• TX - Transmit Data from the Host Computer to the i2cStick.
• RX - Receive Data from the i2cStick to the Host Computer.
• RTS - Request to Send from the Host Computer to i2cStick.
• CTS - Clear to Send from the i2cStick to the Host Computer.
2.2 I2C Interface Connector
The i2cStick includes a five wire (1x5) 2.54 mm (.100"), positive locking, shrouded
header connector for interfacing to an external I2C Bus. Lines provided in this
connector include I2C Bus Clock (SCL), I2C Bus Data (SDA), Ground (GND),
Shield (SHD) (optional), and Power (+V) (optional).
Minimum wiring for I2C Bus communications include I2C Bus Clock, Data, and
Ground. Use of the Power and Shield wires in the I2C Interface connector are user
optional.
Connect the Power (+V) wire to the target system to power the target system from
USB bus power. The maximum available I2C Bus power is 50 mA at +5V (or +3.3V
with 3.3V option).

5
I2C Bus Connector
I2C Bus Pinout
An i2cMini Interface Cable 1x5 2.54 mm (.100") is provided to connect the I2C
adapter to an external I2C Bus.
An optional i2cMini Clip-Lead cable is available to connect the I2C adapter to a
target system.
Each cable wire is color-coded or clearly marked (SCL=C=White, +V=V=Red,
SDA=D=Green, Ground=G=Black). +V and Shield (SHD) use are user optional.

6
3 Hardware Configuration
3.1 Pull-up Resistors
I2C Bus systems are based on open-collector technology requiring pull-up devices
on each signal wire. These pull-up devices usually take the form of pull-up resistors
connected to bus power.
The I2C adapter includes a side-mounted slide switch used to enable or disable
internal 5V (or 3.3V) I2C Bus 1.8K ohm pull-up resistors attached to the SCL and
SDA lines. Every I2C Bus system must have at least one pull-up on the signal lines.
Use this switch to configure the pull-up resistors for your system.
3.2 Connecting a 5V i2cStick to a 3.3 Volt Target System
If you are connecting a 5 volt I2C adapter to a 3.3 volt target system, you should
follow these steps BEFORE applying power:
• Shut off the I2C adapter’s internal pull-ups (See Pull-up Resistor section). Use
external pull-ups to the target system’s 3.3V power. These pull-ups may already
be present in the target system.
• Disconnect the I2C connector +5V wire from the target system. The I2C adapter
will be powered from its USB interface, and the target system will be powered
by its own 3.3V power supply.
The I2C adapter is a 5-volt device. Any signal above 3.3V on the SCL or SDA lines
is high enough for the adapter to see a Logical 1.
3.3 Connecting to an SMBus Target System
If you are connecting the I2C adapter to a SMBus target system, you should follow
these steps BEFORE applying power:
• Shut off the I2C adapter’s internal pull-ups (See Pull-up Resistor section).
• Use external SMBus rated (appoximately15k ohms) pull-up resistors. These
pull-ups may already be present in the target system.
• Visit our I2C versus SMBus FAQ page (www.mcc-us.com/I2CSMBusFAQ.htm).
• See the SMBus Specification for additional details.
Special Note for SMBus Users: MCC’s I2C adapters are designed to be I2C Bus

7
compatible, not SMBus compatible. Some features of the SMBus protocol not
supported include time-outs, device reset, and Packet Error Check byte processing.
The non-supported SMBus features may, or may not, permit the use of the I2C
adapter in your SMBus application. Consult the MCC FAQ web page and SMBus
Specification for details.
4 ESD (Electrostatic Discharge) Precautions
Electrostatic discharge is defined as the transfer of charge between bodies at
different electrical potentials. Electrostatic discharge can change the electrical
characteristics of a semiconductor device, degrading or destroying it. Electrostatic
discharge also may upset the normal operation of an electronic system, causing
equipment malfunction or failure.
When connecting the I2C adapter to a host computer and a target system, extreme
care must be taken to avoid electrostatic discharge. Failure to follow ESD protection
procedures when using the I2C adapter could damage the host computer, I2C
adapter, or the target system, and void product warranty coverage.
4.1 Host Computer Grounding
Case 1 - Desktop and Single-board Computers. The chassis on a desktop or
single-board host computer must be connected to earth ground to comply with
safety regulations. If the computer chassis is NOT connected to earth ground for
some reason (i.e., use of a two-prong power mains plug), the host computer power
supply ground will float to some unknown voltage potential.
Case 2 - Laptop Computers. Laptop computers present special ESD problems. Most
laptop computers use an external double-insulated mains power supply which is
NOT connected to the mains earth ground. This means that the laptop chassis is
floating at some unknown voltage potential.
In either case, upon connection to the I2C adapter and the target system, the host
computer will discharge energy through its serial port to the I2C adapter, and on to
the target system. This discharge could damage the host computer, I2C adapter, and
the target system.

8
4.2 Grounding Solutions
To avoid damage to the host computer, I2C adapter, or target system, follow these
instructions:
• Wear an earth grounded wrist strap, or discharge any static charge build-up,
when handling the I2C adapter or any target system devices.
• Ensure that both the host computer and target system are connected to a common
earth ground point.
• Make sure that all interconnections are made BEFORE applying power to the
host computer, I2C adapter, and target system.
• If you are using a laptop computer or host computer that is NOT connected to
mains earth ground, make a hard-wired connection from the host computer (i.e.,
port connector shell) and the target system ground connector to a common earth
ground point.
• Avoid plugging and unplugging system components while the host computer or
target system is powered.
• Ensure that any devices connected to the target system are properly grounded to
the common earth ground point.
• If unsure how to properly ground system components, seek electrical expert help.
WARNING: Any damage caused by Electrostatic Discharge (ESD) through
inadequate earth grounding is NOT covered under the warranty of this product.
5 Driver Software Set-Up
This section provides information on how to install, update, and uninstall the
i2cStick software driver.
1. Driver Install
The i2cStick uses a Virtual Communications Port (VCP) driver that is pre-
installed with the iPort Utility Pack CD (See the installation instructions in
“Part 2 - iPort Utility Pack for Windows” of this User’s Guide). Pre-
installation places the VCP driver into the Windows Driver Store, ready for
installation when the i2cStick is first plugged into the host computer.
After iPort Utility Pack installation, the VCP driver may also be pre-installed
with the Driver Install short-cut on the iPort Utility Pack Start menu.

9
For backup, VCP driver files can be found on the iPort Utility Pack CD, and
after iPort Utility Pack software installation, in the Program Files installed
i2cStick Driver folder on the host computer.
2. Driver Update
i2cStick VCP drivers are posted on the MCC website
(http://www.mcc-us.com/SoftwareUpgrades-Updates.htm#i2cstick). Use
Windows Device Manager (Start | Settings | Control Panel | System | Device
Manager | Ports (COM & LPT)) to see the current version of the i2cStick
driver installed on your computer, and determine if new driver is available. If
a new VCP driver is available, follow website instructions to download and
install a driver update on your computer.
3. Driver Uninstall
i2cStick VCP drivers can be uninstalled using Windows Device Manager
(Start | Settings | Control Panel | System | Device Manager | Ports (COM &
LPT)), or the Driver Uninstall short-cut on the iPort Utility Pack Start menu.
6. Hardware Set-Up
This section provides information on connecting the i2cStick to your host computer
and I2C Bus target system.
1. USB Connection
After completing the Driver Installation instructions above, plug the i2cStick
adapter into a free USB port on your host computer or self-powered USB hub.
If this is the first time the i2cStick is connected to the host computer,
Windows will automatically install the VCP driver from the Windows Driver
Store and assign the i2cStick to a communications port number (COMn). You
can find the ComPort number assigned to the i2cStick by running the iPort
Utility Pack Message Center or Message Manager software, and selecting the
i2cStick device.
You can use Windows Device Manager (Start | Settings | Control Panel |
System | Device Manager | Ports (COM & LPT)) to find or reassign the
ComPort number assigned to the i2cStick.

10
2. I2C Bus Connection
Connect the I2C Bus cable to the I2C adapter and your I2C device. You can
make this connection with the i2cMini Interface or i2cMini Clip-Lead cable.
The I2C interconnect includes a +5V (or 3.3V) wire. You may not need to, or
want to, connect the +V wire to your target system. Refer to the “Hardware
Configuration” section for details on pull-up resistors and connecting the
optional +V wire.
If you have any questions on I2C adapter setup and configuration, please visit our
FAQ page (http://www.mcc-us.com/faq.htm), or contact our technical support team

11
Part 2 - iPort Utility Pack for Windows
Part 2
iPort Utility Pack
for
Windows
Table of contents
Other MCC Adapter manuals