CALIBRE UCA93 I2C Communications Adapter Issue 1.
CALIBRE 2 Welcome to the Calibre UCA93 adjustable voltage I2C Adapter. This Adapter provides full I C bi-directional compatibility as either a master or slave from within a Windows 98 2000 or Windows XP environment. If you have any queries relating to this or any other I2C product supplied by Calibre please visit our web site www.calibreuk.com. For technical support please e-mail techsupport@calibreuk.
CALIBRE Contents INTRODUCTION 1.1. General Introduction 1.2. Packing List 1.3. Configuring the Adapter 1.4. Bus Termination and Protection 1.5. Connecting the Adapter to your System 1.6. Bus Capacitance Limitations/Cable Choice 1.7. Variable Voltage Bus Power Supply INSTALLING THE ADAPTER UNDER WINDOWS 2.1. Introduction 2.2. Installing the Adapter LIBRARIES FOR PROGRAMMING IN MICROSOFT WINDOWS ENVIRONMENTS 3.1. Introduction 3.2. Function Prototypes 3.3. Function Description 3.3.1. Setup 3.3.2.
CALIBRE INTRODUCTION 1.1. General Introduction 2 The UCA93 is a USB V1.1 to I C Adapter based on the PIC 16F874 microcontroller using a Philips 2 PCF8584 for the bus monitor function. It features full I C bi-directional compatibility as either a master or 2 slave. I C connections are made via a 9 way “D” socket. This product complies with the requirements of EEC Directive 89/336 for EMC and is CE marked. 2 The UCA93 provides full software control of the I C bus voltage, bus speed and pull up resistors.
CALIBRE IO 1 is a 5V TTL input and can only be used on 5V tolerant systems. Pin 1 2 3 4 1.6. Function NC – DO NOT CONNECT IO 0 IO 1 0V Bus Capacitance Limitations/Cable Choice 2 The maximum allowable capacitance on the I C bus in normal mode depends on the value of the SCL and SDA master pull-ups, but never exceeds 400pF. Refer to Phillips Technical Handbook Book 4 Parts 12a and 12b for further details.
CALIBRE INSTALLING THE ADAPTER UNDER WINDOWS 2.1. Introduction This section details the installation of the UCA93 I2C communications Adapter under Windows 98® / Windows2000® and Windows XP®. The appearance of the dialog boxes during the installation of new hardware varies depending on the version of Windows. The Adapter supports plug and play via the USB port. 2.2. Installing the Adapter Connect the Adapter to the PC using the USB cable, the power light will illuminate.
CALIBRE LIBRARIES FOR PROGRAMMING IN MICROSOFT WINDOWS ENVIRONMENTS 3.1. Introduction Each utility is documented in a standard format which lists its name, usage, function and effect on the Adapter is given. The Adapter should be setup prior to any data transfer. Within the DLL there are two versions of some functions e.g. SendAddress and SendAddressNoStatus, the first provides legacy support for software written for other Calibre UK Ltd I2C products, the second format does not return the status. 3.1.1.
CALIBRE 3.2. Function Prototypes If you are using ‘C’ or ‘C++’ copy the file CALUCA.H into the directory containing your project and add the line: #include " CALUCA.
CALIBRE If you are using Visual Basic copy the file UCA93LV.BAS into the directory containing your project and add the file UCA93LV.BAS to your project: The following functions are implemented in the windows libraries:Public Declare Function Setup% Lib "USBDLL_XP.dll" (ByVal OwnAddress%, ByVal Sclk%, ByVal BusVoltage%, ByVal PullUpsOn%, ByVal SlaveBlockTimeout%) Public Declare Function SendAddress% Lib "USBDLL_XP.dll" (ByVal SlaveAddress%, ByVal setnack%) Public Declare Function Restart% Lib "USBDLL_XP.
CALIBRE 3.3. Function Description 3.3.1. Setup Function specification SlaveBlockTimeout) Parameters are: Parameters returned Prerequisites Functional description 3.3.2. int ownaddress This is the I2C address to which the Adapter is to respond in slave mode. This forms the upper 7 bits of the 8 bit address, the lowest bit being the read(1) or write(0) bit. This means that if ownaddress = 57H the card will respond to a write address of AEH and a read address of AFH.
CALIBRE WriteByte Function specification Parameters are: Parameters returned Prerequisites Functional description 3.3.3. ReadByte Function specification Parameters are: Parameters returned Prerequisites Functional description 3.3.4. Prerequisites Functional description Int SendStop(void) None int ErrCode. If the transfer time out occurs error code 8006H is returned otherwise the status is returned. Adapter must be configured using Setup. Should normally only be used at the end of a transmission.
CALIBRE Functional description 3.3.6. Usually a data pointer would already have been written using WriteByte. Sends a start code and the slave address. The function waits for the address to be sent. Should a time-out occur during the sending of an address then an error code 8004H is returned, otherwise the status is returned. GetStatus Function specification: Int GetStatus(void) Parameters are: None Parameters returned int I2Cstatus The current value of the bus status is returned.
CALIBRE 3.3.9. BlockWrite Function specification Parameters are: Parameters returned Prerequisites Functional description 3.3.10. void BlockWrite(int SlaveWriteAddress, int MSB_WordAddress, int LSB_WordAddress,int NoBytesToSend, int NoTries ) int SlaveAddress This is the address to be accessed via the I2C, e.g. A0H int MSB_WordAddress, int LSB_WordAddress This is the location within the slave for the data. The use of two bytes allows users to communicate with devices requiring two byte pointers e.g.
CALIBRE Parameters returned Prerequisites Functional description 3.3.13. GetBlockData Function specification Parameters are: Parameters returned Prerequisites Functional description 3.3.14. Prerequisites Functional description int BlockReadStatus (void)) None int TransferStatus. Returns 0 if the transfer has not been completed. Returns the I2C Bus status if the transfer is completed. Returns 900AH if the transfer time out. Adapter must be configured using Setup.
CALIBRE 3.3.16. BlockSlaveTransmitterStatus Function specification Parameters are: Parameters returned Prerequisites Functional description 3.3.17. BlockSlaveReceiver Function specification Parameters are: Parameters returned Prerequisites Functional description Issue 1.0 01/07/03 int BlockSlaveTransmitterStatus (void)) None int TransferStatus. Returns 0 if the transfer has not been completed. Returns the a status if the transfer is completed (see below).
CALIBRE 3.3.18. BlockSlaveReceiverStatus Function specification Parameters are: Parameters returned Prerequisites Functional description 3.3.19. CheckBusVoltage Function specification Parameters are: Parameters returned Prerequisites Functional description 3.3.20. int CheckBusVoltage (void)) None int BusVoltage Returns the I2C bus output voltage multiplied by 100. Returns 0x800C if the transfer timed out. Adapter should be configured using Setup.
CALIBRE 3.3.21. Write_IO_Pin Function specification int Write_IO_Pin (int IONumber, int IOState) Parameters are:int IONumber The number of the IO pin (0 or 1) to be driven int IOState The required state (0 or 1) of the selected IO pin Parameters returned int Returns a 0 if function successful. Returns 0x800D if the transfer timed out. Prerequisites None Functional description Two spare IO pins are available to drive external logic. IO0 is on PL1 pin 2 and is an open drain driver.
CALIBRE 3.3.23. SendAddressNoStatus Function specification Parameters are: Parameters returned Prerequisites Functional description 3.3.24. WriteByteNoStatus Function specification Parameters are: Parameters returned Prerequisites Functional description 3.3.25. Parameters returned Prerequisites Functional description Int ReadByte(int SetNack) int SetNack This controls whether the Adapter transmits an acknowledge down the I2C bus on reception of a byte.
CALIBRE 3.3.27. RestartNoStatus Function specification Parameters are: Parameters returned Prerequisites Functional description Issue 1.0 01/07/03 void RestartNoStatus(int SlaveAddress, int SetNack, int NoTries) int SlaveAddress The address to be accessed via the I2C, e.g. A1H. int SetNack This controls whether the Adapter transmits an acknowledge down the I2C bus on reception of a byte. The last byte received during a transfer must not be acknowledged, in all other cases acknowledge must be enabled.
CALIBRE The Real-Time Bus Monitor To install the monitor run the setup program located in the \CD_USB\USB_Monitor folder, follow the instructions given by the installation wizard. Before attempting to run the monitor program ensure that the device drivers are installed correctly in accordance with this manual. The program UI2C_MONITOR.EXE is a windows based non-invasive real-time bus monitor which 2 records activity on an I C-bus.
CALIBRE 2 Appendix A I C Communications Adapter Status Codes This is an eight bit register, read using the GetStatus routine. Each individual bit has its own meaning as follows: Bit 7 (MSB) - The (old) PIN Bit To all intents and purposes, this bit is now redundant. Previous Calibre I2C products used this bit to synchronise data transfers between the I2C bus and the host PC.
CALIBRE Appendix B Migration Notes for Existing Calibre I2C Customers These notes are intended for customers who have code working on one or more of Calibre UK’s existing AT or PCI based adapters and wish to convert it to work with the new UCA93 Adapter. The fundamental differences are a much reduced reliance on polling the status register, a new way of calling slave functions and the introduction of new block transfer functions. USB Bus Characteristics The USB V1.
CALIBRE The slave functions of the UCA93 differ most from traditional Calibre AT and PCI bus based products. A user must make a pre-determined decision whether to put the adapter into master, slave transmitter or slave receiver modes. The adapter’s own address is established as part of the Setup function. If the adapter is in master mode (the default) , it will not respond to its own address if this is generated by another master on the system.
CALIBRE When the master terminates the transfer, the adapter completes sending the data block to the host together with a single status byte indicating how the transfer went, and the data is put into a global variable. The BlockSlaveReceiverStatus function waits for this status byte and the byte can be interpreted as in the function definition.
CALIBRE When the THE MOST COMMONLY ASKED I2C QUESTIONS General Questions Question Answer I get corrupted transfers why is this? The most likely reason for corrupted transfers is either incorrect bus termination or excessive capacitance - see the manual for details. Question Answer Do you have software to talk to my........