Appendix B – I C Communications Adapter Control Codes Appendix C - The Most Commonly Asked I C Questions Calibre UK Limited Cornwall House, Cornwall Terrace Bradford, West Yorkshire, BD8 7JS, England Tel No: (01274) 394125 Fax No: (01274) 730960 Email sales@calibreuk.com...
EEC Directive 89/336 for EMC and is CE marked. 1.1. Packing List Your I C Communications Adapter is supplied with the following items:- C CD ROM The ICA90 plug-in card (the actual adapter) Revision 2.9 Page 1 of 27 09/12/1999...
The ICA90 operates correctly in all 'well behaved' faster machines. In most cases just one wait state will be fine in even the fastest of machines. However, some rogue PCs that do not obey correct I/O timing may cause problems occasionally.
Important Note: Due to the internal operation of the ICA90, it must not be accessed over the PC bus (read or written) more than once every nine of its own clock cycles. The ICA90 is clocked at 12MHz; therefore it MUST NOT be accessed more than once every 0.75 microseconds. If this requirement is not observed operation may become erratic.
Such drivers are under consideration for future development by Calibre UK Ltd. If you wish to experiment with this mode, observe the long distance connections. Bear in mind that the adapter cannot support interrupts in long distance mode, and LK5 should be in the “NONE”...
Getting Started 4.1. Resetting the Adapter A reset forces the adapter into a well defined state, ready for initialisation. The card uses the same reset line as the PC so either a power up or hard reset (press the <RESET> button on your PC) will suffice. 4.2.
Using the Utilities Each utility is documented in a standard format, which lists its name, usage, function, and effect on the adapter is given. Following a reset, the adapter should be setup prior to any data transfer. 5.1. C Routines 5.1.1.
Page 8
Parameters are: int controladdress address of I C control register. This is equal to 1+(base address of adapter set by links on circuit board). Value Returned: int <status> where status is an integer from 0x00 to 0xFF which indicates the current status of I C Communications Adapter.
Page 9
int base, slv, setnack; base = 0x310; /* Adapter’s bas address = 0x310 (hex) */ slv = 0xa0; /* I C Address of slave, this is a typical */ /* write for an I C static RAM or EEPROM */ setnack = 0;...
Page 10
/* This will read a byte of data from a slave previously addressed */ /* by and with acknowledge already disabled by sendaddress. */ /* After reading the data, acknowledge will be re-enabled. */ 5.1.5. Write Data Byte to Slave Routine Name: writebyte(base, data) Usage:...
#include <dos.h> /* Optional, but recommended if your compiler */ /* supports DOS I/0 functions */ /* This Contains the I 2 C routines */ #include <i2c.h> main int base, controladdress; base = 0x310; /* Adapter’s base address = 0x310 (hex) */ controladdress = base + 1;...
Page 12
Name: setup (baseaddr%, own%, sclk%) Usage: call setup(baseaddr%, own%, sclk%) Function: procedure to set up I C Communications Adapter. Parameters are: baseaddr% base address of adapter set by links on circuit board. own% C 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.
Page 13
baseaddr% = &h310 ‘* adapter’s base address = 0x310 (hex) * controladdress% = baseaddr% + 1 status% = FNgetstatus%(controladdress%) print”I C Communications Adapter Status = “;status% ‘* This will read the I C Communications Adapter’s current status * 5.2.3. C Address and Start Sending Routine Name: sendaddress(baseaddr%, slv%, setnack%) Usage:...
Page 14
setnack% this controls whether the I C Communications Adapter transmits and Acknowledge down the I C 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. If setnack% = 0 then acknowledge is enabled, if setnack% = 1 then acknowledge is disabled.
Page 15
Function: procedure to send a Stop (end of communication signal) down the I C Bus, ending a transmission or reception with a slave that was address previously by sendaddress. Parameters are: controladdress% The address of the I C Communications Adapter control register, equal to 1+(base address set by links on circuit board).
slv% = &ha1 ‘* I C Address of slave, this is a typical read address * ‘* for an I C static RAM or EEPROM* setnack% = 0 ‘* Enable Acknowledge (see parameter descriptions) * call restart(baseaddr%, slv%, setnack%) print”Restart and I C Slave Address sent”...
Page 17
baseaddress is the address at which the adapter has been installed, e.g. 310H ownaddress 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.
Page 18
Setnack 1 for no acknowledge 0 for acknowledge. Parameters returned Cdata, the data read, if a time-out occurs the ErrCode 8005H is returned. Prerequisites Adapter must be configured using setup, start and read address sent by sendaddress. Functional Description If setnack is 1 the function writes 40H to the control register to establish the correct acknowledge procedure.
Page 19
getstatus Function specification: Int getstatus ( ) Parameters returned Cstatus, the current value of the bus status. Prerequisites Adapter must be configured using setup. Functional description The function reads status word from the adapter and returns it. recover Function specification: Int recover Parameters returned ErrCode.
Page 20
When all the bytes have been transmitted a stop is issued and the total number of bytes is returned. Sendbytes can only be used in master write mode. getbytes Function specification Int getbytes (int far *transferarray) The far pointer must point to a single dimensional array the format of which is detailed below. The calling function must have initialised elements 0, 1 and 2 prior to calling the function.
Page 21
Getbytes can only be used in master read mode. slavelastbyte Function specification void slavelastbyte( ) Parameters returned none. Prerequisites Adapter must be configured using setup. This function would normally only be called following the end of a transmission in slave write mode – when the adapter is being read as a slave, by another master, not when writing to a slave using the adapter.
Further Information The following references may be found useful when using the adapter: Philips Semiconductors Technical Handbook Book 4 Parts 12a and 12b. These give details of the I2C compatible ICs, and the I C Bus specification. The PCF8584P used on the adapter is included in later editions.
If this is not the case please refer to Section 3 of the User Manual for details of the correct link positions. The one exception is the bus pull-ups. These may be on or off on the ICA90;...
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 PIN Bit The PIN bit “Pending Interrupt Not” is a read-only flag which is used to synchronize serial communication. Each time a serial data transmission is initiated (by sendaddress routine or setting STA bit) the PIN will be set (= 1) automatically.
Appendix B – I C Communications Adapter Control Codes The Control Register should normally be written using the setup, sendaddress and sendstop routines. To implement more advanced functions such as enabling hardware interrupt generation or implementing long distance mode, these routines may need to be modified or the users own routines used in their place.
Appendix C - The Most Commonly Asked I C Questions General Questions Question Will my adapter work in a Pentium PC? Answer Yes and there is no need to alter LK 4 from the position in which your adapter was shipped. Question Will my adapter run I2C clock speeds greater than 90KHz? Answer At the moment your adapter is limited by the Bus Controller chip fitted, to a maximum of 90KHz...
Page 27
Windows 95 START - Run regedit HKEY_LOCAL_MACHINE |--SYSTEM |--CurrentControlSet |--Services |--Class |--WinRT |--WinRTdev0 |--Parameters |--Section0 |--Section1 Windows NT START - Run regedit HKEY_LOCAL_MACHINE |--SYSTEM |--CurrentControlSet |--Services |--WinRT |--WinRTdev0 |--Parameters |--Section0 |--Section1 Question I am using your Windows 95 / NT DLL and I am always getting a time out error code.
Need help?
Do you have a question about the ICA90 and is the answer not in the manual?
Questions and answers