Part Number Hot Search : 
C203JC25 ILC6377 KQB4P40 MMBZ20VA LTC35 3NB60 40174 M1010
Product Description
Full Text Search
 

To Download PICA93LVC Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  calibre pica93lv parallel i2c communications adapter user manual issue 1.3 22/07/1999 calibre uk limited cornwall house, cornwall terrace bradford, west yorkshire, bd87js, england tel no : (01274) 394125 fax no: (01274) 730960) e-mail: sales@calibreuk.com web-site www.calibreuk.com
calibre   issue 1.3 22/07/1999  welcome to the calibre parallel i 2 c interface. this interface is designed to allow users to run i 2 c bus operations via pc parallel port. if you have any queries relating to this or any other i 2 c product supplied by calibre please visit our web site www.calibreuk.com . for technical support please e-mail techsupport@calibreuk.com or send your queries by fax to (44) 1274 730960, for the attention of our i 2 c technical support department. copyright this document and the software described within it are copyrighted with all rights reserved. under copyright laws, neither the documentation nor the software may be copied, photocopied, reproduced, translated, or reduced to electronic medium or machine readable form, in whole or in part, without prior written consent of calibre uk ltd ("calibre"). failure to comply with this condition may result in prosecution. calibre does not warrant that this software package will function properly in every hardware/software environment. for example, the software may not work in combination with modified versions of the operating system or with certain network adapter drivers. although calibre has tested the software and reviewed the documentation, calibre makes no warranty or representation, either express or implied, with respect to this software or documentation, their quality, performance, merchantability, or fitness for a particular purpose. this software and documentation are licensed 'as is', and you, the licensee, by making use thereof, are assuming the entire risk as to their quality and performance. in no event will calibre be liable for direct, indirect, special, incidental, or consequential damages arising out of the use or inability to use the software or documentation, even if advised of the possibility of such damages. in particular, and without prejudice to the generality of the foregoing, calibre has no liability for any programs or data stored or used with calibre software, including costs of recovering such programs or data. copyright calibre uk ltd (c) 1999 cornwall house, cornwall terrace bradford, bd8 7js. uk. e-mail: sales@calibreuk.com web site www.calibreuk.com all world-wide rights reserved issue 1.3 22/07/1999 all trade marks acknowledged calibre operates a policy of continued product improvement, therefore specifications are subject to change without notice as products are updated or revised. e&oe.
calibre   issue 1.3 page i 22/07/99  contents introduction 1 1.1. general introduction 1 1.2. packing list 1 1.3. . configuring the adapter 1 1.4. bus termination and protection 1 1.5. installing the adapter 2 connecting the adapter to your system 3 2.1. connector pinout 3 2.2. bus capacitance limitations 3 2.3. power supply 3 2.4. resetting the adapter 3 software utilities 4 3.1. introduction 4 3.2. dos c library/programs 4 3.3. dos qbasic library/programs 5 3.4. windows lib/dll functions 6 using the utilities 7 4.1. introduction 7 4.2. c routines 7 4.3. qbasic routines 14 4.4. libraries for programming in microsoft windows environments 20 further information 27 appendix a parallel i2c communications adapter status codes 28 appendix b parallel i2c communications adapter control codes 29 the most commonly asked i2c questions 30 6.1. general questions 30 6.2. dos software questions 30 6.3. windows 95 and nt questions 30
calibre   issue 1.3 page 1 22/07/99 introduction 1.1. general introduction the parallel i2c communications adapter is designed to connect to any ibm pc compatible parallel port. it is based on the philips pcf8584 bus controller, it features full i 2 c bi-directional compatibility as either a master or slave. i 2 c connections are made via a 9 way "d" socket. 1.2. packing list your parallel i2c communications adapter is supplied with the following items:- a. i 2 c cd - rom b. the pica93lv unit (the actual adapter) c. a cable set 1 25 way parallel cable 2 6 pin mini din male -> 6 pin mini din male 3 5 pin din female -> 6 pin mini din male 4 6 pin mini din female -> 5 pin din male 1.3. . configuring the adapter note: many components on the adapter card are static sensitive. observe normal static sensitive precautions when handling the card! the adapter is supplied in a standard configuration which should suit most applications. however, the bus termination and protection are link selectable. read the following section to change the configuration. the standard configuration is bus termination and protection off 1.4. bus termination and protection normally the system to which the parallel i2c communications adapter is to be connected should already have master pull up resistors fitted to the scl and sda lines. if this is not the case, lk6 and lk7 can be used to connect 4.7k pull up resistors to the 5v supply on these lines. the standard configuration is with these resistors disconnected. the scl and sda lines are protected by 100r series resistors before exiting the adapter via the 9 way "d" socket. upstream of the series resistors, the scl and sda pins on the pcf8584 are pulled up with high value resistors (10k). these ensure that the i 2 c bus is in a defined state even if no other devices are connected. lk4 and lk5 connect optional protection diodes to the scl and sda lines. when selected, these lines are clamped to the 0v and + 5v lines giving protection against transients. if these diodes are connected, the external i 2 c system will not function if the adapter is connected but not powered up. the standard configuration is with these diodes disconnected.
calibre   issue 1.3 page 2 22/07/99 1.5. installing the adapter connect the pica93lv to your pc as shown in figure 1 ( the cable numbers correspond to the packing list above). figure 1.0 typical pc connection
calibre   issue 1.3 page 3 22/07/99 connecting the adapter to your system 2.1. connector pinout all external connections are made via a 9 way "d" socket: pin normal mode 10v 20v 30v 40v 5nc 6 sda (bi-directional) 7+5v 8 scl (bi-directional) 9nc 2.2. bus capacitance limitations the maximum allowable capacitance on the i 2 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 (see further information for references). care should be taken in choosing a length and type of interconnecting cable which will not exceed this limit. 2.3. power supply pin 7 on the "d" connector is connected to the pica93lv power supply. this supply is fitted with overload protection and up to 0.250ma can be drawn from here. when shipped to you the bus voltage was factory pre-set to 3.3v for use with low voltage memories. you can adjust the voltage by inserting a small screwdriver through the hole in the front panel. your pica93lv has been factory set for use on 3.3v i 2 c bus systems. use on 5v i 2 c bus systems without adjusting the voltage will cause permanent damage to the pica93lv. the fault is factory detectable and you will be charged for the repair. 2.4. resetting the adapter each time the pica93lv is re-configured via the setup function it is automatically reset by software.
calibre   issue 1.3 page 4 22/07/99 software utilities 3.1. introduction unpack the software from the cd-rom in accordance with the instructions provided with the licence. the software utilities contain simple dos routines in both c, qbasic and windows dll / lib (16bit only) for use with visual basic and microsoft c++. these utilities can be used for setup the pica and to perform basic communications. 3.2. dos c library/programs 3.2.1. files on disc \c\clib\spica.lib the library containing the low level functions (small memory model) \c\clib\cpica.lib the library containing the low level functions (compact memory model) \c\clib\mpica.lib the library containing the low level functions (medium memory model) \c\clib\lpica.lib the library containing the low level functions (large memory model) \c\libsourc\pica.c the source code for the libraries \c\inc\pica.h the include file for the library \c\source\i2cinc.c the i2c transfer functions \c\source\promread.c sample eeprom reading function \c\source\promwrit.c sample eeprom writing function \c\source\read.mak make file for promread.c \c\source\write.mak make file for promwrit.c 3.2.2. typical c project arrangement #include dos.h makelib i2cinc.c compile i2cinc.obj user application e.g. promread.c compile promread.obj link promread.exe pica.c pica.h #include pica.h xpica.lib figure 2.0 typical project arrangement. figure 2.0 shows a typical c project, calibre uk ltd have produced the library files, spica.lib, mpica.lib, cpica.lib and lpica.lib, which contains all the low level functions required to interface to the adapter via the parallel port. these libraries cover the standard memory models, the library appropriate to the memory model of your project will require linking with the object files.
calibre   issue 1.3 page 5 22/07/99 the i2cinc.c file contains all the functions required to build an i2c transfer. this will require compiling (note the include file) to produce an object file. once the object files have been created link them together with the library file to create your applications executable file. the functions contained in i2cinc.c are as detailed below:- subroutine name brief functional description setup sets user defined initial conditions. getstatus reads status register. sendaddress sends slave address, data transmission mode and start signal. sendstop sends stop signal. writebyte writes a byte of data to a previously specified address. readbyte reads a byte of data from a previously specified address. restart sends restart and slave address of device which is to be communicated with, without sending a stop. two sample programs are also supplied, these examples show how the functions provided in i2cinc.c are put together to provide a complete i2c transfer. the sample programs are:- promread.c reads a number of bytes from an i2c serial eeprom. promwrit.c writes a number of bytes to an i2c serial eeprom. these programs were compiled using the zortech c compiler the make files used are supplied. if you are using the zortech c compiler copy the desired make file to makefile then type make. editing the make files will reveal that the file i2cinc.c is compiled and linked with the application. the makefiles are:- read.mak the make file for promread.c write.mak the make file for promwrit.c if you are not using the zortech c compiler you will have to create a similar make file - see your compiler documentation for further information. 3.3. dos qbasic library/programs 3.3.1. files on disc \b\source\i2cinc.bas the i2c transfer functions \b\source\promread.bas sample eeprom reading function \b\source\promwrit.bas sample eeprom writing function the i2c functions contained in i2cinc.bas are detailed below:- subroutine name brief functional description setup sets user defined initial conditions. getstatus% reads status register. sendaddress% sends slave address, data transmission mode and start signal. sendstop% sends stop signal. writebyte% writes a byte of data to a previously specified address. readbyte% reads a byte of data from a previously specified address. restart% sends restart and slave address of device which is to be communicated with, without sending a stop. two sample programs are also supplied, these examples show how the functions provided in i2cinc.bas are put together to provide a complete i2c transfer. the sample programs are:- promread.bas reads a number of bytes from an i2c serial eeprom. promwrit.bas writes a number of bytes to an i2c serial eeprom.
calibre   issue 1.3 page 6 22/07/99 3.4. windows lib/dll functions 3.4.1. files on disc \readme.doc user information \win\c\i2cinc.h "c" function prototypes \win\c\lpti2c.lib i 2 c "c" library \win\vb30\lpti2c.bas visual basic 3.0 declarations \win\vb30\lpti2c.dll i 2 c visual basic dynamic link library the following functions are implemented in the windows libraries:- void far _pascal _export setup (int baseaddress, int ownaddress, int sclk, int statuswait); int far _pascal _export sendaddress (int slaveaddress, int setnack); int far _pascal _export restart (int slaveaddress, int setnack); int far _pascal _export getstatus (void); int far _pascal _export writebyte (int wrdata); int far _pascal _export readbyte (int setnack); int far _pascal _export sendstop (void); int far _pascal _export recover (void); int far _pascal _export sendbytes (int __far *transferarray); int far _pascal _export getbytes (int __far *transferarray); void far _pascal _export slavelastbyte (void);
calibre   issue 1.3 page 7 22/07/99 using the utilities 4.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. 4.2. c routines 4.2.1. i2c setup / initialisation routine function definition: void setup(int ownaddress, int sclk) usage: setup(ownaddress, sclk); function: procedure to set up parallel i2c communications adapter. parameters are: int ownaddress the 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 own = 0x57, the card will respond to a write to address 0xae and a read to address 0xaf. be sure not to select an address which is already in use by any other device in your i 2 c system. int sclk the scl clock rate (bit rate for i 2 c serial bus). value of sclk approximate scl (khz) 090 145 211 31.5 value returned: none. i2c status on exit: i 2 c status on exit from routine the parallel i2c communications adapter will have the serial interface enabled, also data reception acknowledge will be enabled. the status register will contain 0x81 (assuming that no other masters exist on the i 2 c system, if this is not the case then the contents of the status register will also depend on externally generated bus activity). example usage: (see also sample programs) main() { int ownaddress, sclk; ownaddress = 0x57; /* own slave address set to 0x57 (hex) */ sclk = 1; /* serial clock rate set to 45khz */ setup(ownaddress, sclk); printf("parallel i2c communications adapter initialised\n"); } /* this will set up the parallel i2c communications adapter with */ /*an i 2 c slave address of 0xae and a scl clock rate of approximately 45khz */
calibre   issue 1.3 page 8 22/07/99 4.2.2. i2c status checking routine function definition: int getstatus(void) usage: i2cstatus = getstatus(); function: function to read status register of the parallel i 2 c communications adapter. parameters are: none value returned: int i2cstatus where i2cstatus is an integer from 0x00 to 0xff which indicates the current status of parallel i2c communications adapter. see appendix a for details of the status values returned. i 2 c status on exit: the status of the parallel i2c communications adapter will not be affected by using the getstatus function. example usage: (see also sample programs) main() { int i2cstatus; i2ctatus = getstatus (); printf("parallel i2c communications adapter status = %x\n", i2cstatus); } /*this will read the parallel i2c communications adapter's current status*/ 4.2.3. i2c address and start sending routine function definition: int sendaddress (int slaveaddress, int setnack) usage: i2cstatus = sendaddress(slaveaddress, setnack) function: this is the procedure to send start and slave address of device which is to be communicated with. parameters are: int slaveaddress the 8 bit slave address of the device which is to be communicated with. this will be an even number if the adapter is to write to the slave, add 1 to get an odd number if the adapter is to read from the slave. int setnack this controls whether the parallel i2c communications adapter transmits an acknowledge down the i 2 c bus on reception of a byte. the last byte received during a transfer must not be acknowledged. if setnack = 0 then acknowledge is enabled, if setnack = 1 then acknowledge is disabled. therefore, if a read (odd numbered) address is being sent and only 1 byte is to be read, setnack should be set = 1; in all other cases it must be clear = 0. value returned: int i2cstatus the value returned depends on whether the start and address were sent. if the start and address have been sent then the status returned will either be 0x00 (bus busy data sent and acknowledged), or 0x08 (bus busy, data sent but not acknowledged). if the start or the address cannot be sent (either the bus remained busy or the address did not get sent) then the last status read iored with 0x8000 will be returned.
calibre   issue 1.3 page 9 22/07/99 the function will read the status a number of times before returning an error condition - this number is defined by the maxnumberofgoes constant defined in i2cinc.c, this value may be altered to suit your system. i 2 c status on exit 0x00 bus busy and address sent and acknowledged 0x08 bus busy and address sent but not acknowledged 0x80 bus busy and address not sent. (see appendix a for details of status codes). example usage: (see also sample programs) /* this will send a start and the i 2 c slave address of the device to be communicated with. */ main() { int slaveaddress, setnack, i2cstatus; slaveaddress = 0xa0; /* i 2 c address of slave, this is a typical */ /* write for an i 2 c static ram or eeprom */ setnack = 0; /* enable acknowledge (see parameter descriptions) */ i2cstatus = sendaddress(slaveaddress, setnack); switch i2cstatus { case 0x00: printf("start and i 2 c slave address sent and acknowledged\n"); case 0x08: printf("start and i 2 c slave address sent and not acknowledged\n"); default: printf("start not sent status is %x", i2cstatus); } } 4.2.4. i2c read data byte from slave routine function definition: int readbyte(int setnack) usage: i2cdata = readbyte(setnack); function: this is the function to read a byte of data from a slave device whose slave read address has already been sent by sendaddress (or restart). it can be used to disable acknowledge after reading data if it is the last but one byte to be read. note: first byte read after read-address is always that address and should be discarded. this byte should be ignored when working out when to acknowledge/not acknowledge.
calibre   issue 1.3 page 10 22/07/99 parameters are: int setnack this controls whether the parallel i2c communications adapter transmits an acknowledge down the i 2 c bus on reception of a byte. the last byte received during a transfer must not be acknowledged. if setnack = 0 then acknowledge is enabled, if setnack = 1 then acknowledge is disabled. therefore, if the last but one byte is to be read, setnack should be set to = 1; in all other cases it must be clear = 0. (in case of reading 1 byte only, acknowledge will have been disabled be sendaddress (or restart) and so should know be enabled again after reading the data. value returned: int i2cdata the value returned depends on whether the data was read successfully. if the data was read then the value is returned. if the data cannot be read (because there is none in the register) then the last status read iored with 0x8000 will be returned. the function will read the status a number of times before returning an error condition - this number is defined by the maxnumberofgoes constant defined in i2cinc.c, this value may be altered to suit your system. i 2 c status on exit : 0x00 bus busy and unread data in data register. 0x80 bus busy and no unread data in data register the value will depend on whether any more bytes of data have been transmitted by the slave device which is being read. (see appendix a for details status codes). example usage: (see also sample programs) /* 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. */ main() { int setnack, i2cdata; setnack = 0; /* enable acknowledge - only one byte it to */ /* be read (see parameter descriptions) */ i2cdata = readbyte(setnack); if (i2cdata & 0x8000) == 0x8000 { printf("data read fault i2c status %x", i2cdata); } else { printf("data read was %x\n", i2cdata); } }
calibre   issue 1.3 page 11 22/07/99 4.2.5. write data byte to slave routine function definition: int writebyte(int i2cdata) usage: i2cstatus = writebyte(i2cdata) function: this is the procedure to write a byte of data to a slave device whose slave address has already been sent by sendaddress. parameters are: int i2cdata the byte of data which is to be written to the slave device. value returned: the value returned depends on whether the data was written successfully. if the data was written then the status is returned. if the data cannot be written then the last status read iored with 0x8000 will be returned. the function will read the status a number of times before returning an error condition - this number is defined by the maxnumberofgoes constant defined in i2cinc.c, this value may be altered to suit your system. i 2 c status on exit: 0x00 bus busy and data transmitted and acknowledged successfully. 0x08 bus busy and data transmitted successfully but not acknowledged . 0x80 bus busy and data not transmitted (see appendix a for details of status codes). example usage: (see also sample programs) /* this will write a byte of data to a slave previously addressed by sendaddress. */ main() { int i2cdata, i2cstatus; i2cdata = 0x69; /* data byte which is to be transmitted */ i2cstatus = writebyte (i2cdata) ; if (i2cstatus & 0x8000) == 0x8000 { printf("data has not been transmitted status is %x\n", i2cstatus); } else { printf("data has been transmitted\n"); } }
calibre   issue 1.3 page 12 22/07/99 4.2.6. send an i2c stop routine function definition: int sendstop(void) usage: i2cstatus = sendstop(); function: this is the procedure to send a stop (end of communication signal) down the i 2 c bus, ending a transmission or reception with a slave which was addressed previously by sendaddress. parameters are: none. value returned: int i2cstatus . the value returned depends on whether the bus became free. if the bus became free then the status (0x81) is returned. if the bus does not became free then the last status read iored with 0x8000 will be returned. the function will read the status a number of times, waiting for the bus to become free, before returning an none free status - this number is defined by the maxnumberofgoes constant defined in i2cinc.c, this value may be altered to suit your system. i 2 c status on exit: the status of the parallel i2c communications adapter will be 0x81 - bus idle and no unread / untransmitted data in data register. note - this may not be the case in a system where there is another master as well as the parallel i2c communications adapter, since this other master may well have taken control of the bus by the time a program next uses getstatus to read the status register. (see appendix a for details of status codes). example usage: (see also sample programs) /* this will write a stop to the i 2 c bus */ main() { int i2cstatus; i2cstatus = sendstop(); printf("stop has been transmitted status is %x\n", i2cstatus); } 4.2.7. i2c restart and address sending routine function definition: int restart(int slaveaddress, int setnack) usage: i2cstatus = restart(slaveaddress, setnack) function: this is the procedure to send restart and slave address of device which is to be communicated with, without a stop having been sent at the end of last transmission/reception. this routine is particularly useful for reading memories which must first have a data pointer written to them to select where the read is to occur from, and must have their address sent a restart to proceed with the read operation.
calibre   issue 1.3 page 13 22/07/99 parameters are: int slaveaddress the slave address of the device which is to be communicated with. this will be an even number if the adapter is to write to the slave, add 1 to get an odd number if the adapter is to read from the slave. int setnack this controls whether the parallel i2c communications adapter transmits an acknowledge down the i 2 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. therefore, if a read (odd numbered) address is being sent and only 1 byte is to be read, setnack should be set to = 1; in all other cases it must be clear = 0. value returned: int i2cstatus the value returned depends on whether the start and address were sent. if the start and address have been sent then the status returned will either be 0x00 (bus busy data sent and acknowledged), or 0x08 (bus busy, data sent but not acknowledged). if the start or the address cannot be sent (either the bus remained busy or the address did not get sent) then the last status read iored with 0x8000 will be returned. the function will read the status a number of times before returning an error condition - this number is defined by the maxnumberofgoes constant defined in i2cinc.c, this value may be altered to suit your system. i 2 c status on exit 0x00 bus busy and address sent and acknowledged 0x08 bus busy and address sent but not acknowledged 0x80 bus busy and address not sent. (see appendix a for details of status codes). example usage: (see also sample programs) main() { int slaveaddress, setnack, trash; slaveaddress = 0xa1; /* i 2 c address of slave, this is a typical read */ /* address for an i 2 c static ram or eeprom */ setnack = 0; /* enable acknowledge (see parameter descriptions)*/ i2cstatus = restart(slaveaddress, setnack); trash = readbyte(setnack); /* read the address from the adapter and discard*/ }
calibre   issue 1.3 page 14 22/07/99 4.3. qbasic routines 4.3.1. i2c setup/initialisation routines function definition: setup (ownaddress as integer, sclk as integer) usage call setup(ownaddress as integer, sclk as integer) function: procedure to set up parallel i2c communications adapter. parameters are: ownaddress% i 2 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. this means that if ownaddress% = &h57, the card will respond to a write to address &haf. be sure not to select an address which is already in use by any other device in your i 2 c system. if ownaddress% &h00 the adapter will monitor all i 2 c bus information but will not affect any data transfers, thus acting as a bus monitor. sclk% the scl clock rate (bit rate for i 2 c serial bus). value of sclk% approximate scl (khz) 090 145 211 31.5 value returned: none. i2c status on exit: i 2 c status on exit from routine the parallel i2c communications adapter will have the serial interface enabled, also data reception acknowledge will be enabled. the status register will contain 0x81 (assuming that no other masters exist on the i 2 c system, if this is not the case then the contents of the status register will also depend on externally generated bus activity). example usage: (see also sample programs) ' this will set up the parallel i2c communications adapter with an i 2 c slave address of &hae and a scl clock rate of approximately 45khz sub main ownaddress% = &h57 ' own slave address set to &h57 (hex) sclk% = 1 ' serial clock rate set to 45khz call setup(ownaddress%, sclk%) print"parallel i2c communications adapter initialised" end sub 4.3.2. i2c status checking routine function definition: getstatus%() usage: i2cstatus% = getstatus function: function to read status register of parallel i2c communications adapter. parameters are: none. value returned: i2cstatus% where i2cstatus is an integer from &h00 to &hff which indicates the current status of the pica93lv.
calibre   issue 1.3 page 15 22/07/99 see appendix a for details of the status values returned. i 2 c status on exit: the status of the parallel i2c communications adapter will not be affected by using the fngetstatus% function. example usage: (see also sample programs) 'this will read the parallel i2c communications adapters current status sub main i2cstatus% = getstatus print"parallel i2c communications adapter status = " + hex$(i2cstatus) end sub 4.3.3. i2c address and start sending routine function definition: sendaddress(slaveaddress as integer, setnack as integer) usage: i2cstatus = sendaddress(slaveaddress%, setnack%) function: procedure to send start and slave address of device which is to be communicated with. parameters are: slaveaddress% the slave address of the device which is to be communicated with. this will be an even number if the adapter is to write to the slave, add 1 to get an odd number if the adapter is to read from the slave. setnack% this controls whether the parallel i2c communications adapter transmits an acknowledge down the i 2 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. therefore, if a read (odd numbered) address is being sent and only 1 byte is to be read, setnack% should be set to = 1; in all other cases it must be clear = 0. value returned: i2cstatus% the value returned depends on whether the start and address were sent. if the start and address have been sent then the status returned will either be &h00 (bus busy data sent and acknowledged), or 0x08 (bus busy, data sent but not acknowledged). if the start or the address cannot be sent (either the bus remained busy or the address did not get sent) then the last status read iored with &h8000 will be returned. the function will read the status a number of times before returning an error condition - this number is defined by the maxnumberofgoes constant defined in i2cinc.bas, this value may be altered to suit your system. i 2 c status on exit &h00 bus busy and address sent and acknowledged &h08 bus busy and address sent but not acknowledged &h80 bus busy and address not sent. (see appendix a for details of status codes). example usage: (see also sample programs) ' this will send a start and the i 2 c slave address of the device to be communicated with.
calibre   issue 1.3 page 16 22/07/99 sub main slaveaddress% = &ha0 ' ic address of slave, this is a typical write ' address for an i 2 c static ram or eeprom setnack% = 0 ' enable acknowledge (see parameter descriptions) i2cstatus% = sendaddress (slaveaddress%, setnack%) select case i2cstatus% case &h00 print "start and i 2 c slave address sent and acknowledged" case &h08 print "start and i 2 c slave address sent and not acknowledged" case else print "start not sent status is " + hex$( i2cstatus%) end select end sub 4.3.4. i2c read data byte from slave routine function definition: readbyte%(setnack as integer) usage: i2cdata% = readbyte%(setnack%) function: function to read a byte of data from a slave device whose slave address has already been sent by sendaddress. can be used to disable acknowledge after reading data if it is the last but one byte to be read. parameters are: setnack% this controls whether the parallel i2c communications adapter transmits and acknowledge down the i 2 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. therefore, if the last but one byte is to be read, setnack% should be set to =1; in all other cases it must be clear = 0. (in the case of reading 1 byte only, acknowledge will have been disabled by sendaddress and so should now be enabled again after reading the data.) value returned: i2cdata% the value returned depends on whether the data was read successfully. if the data was read then the value is returned. if the data cannot be read (because there is none in the register) then the last status read iored with &h8000 will be returned. the function will read the status a number of times before returning an error condition - this number is defined by the maxnumberofgoes constant defined in i2cinc.c, this value may be altered to suit your system. i 2 c status on exit : 0x00 bus busy and unread data in data register. 0x80 bus busy and no unread data in data register the value will depend on whether any more bytes of data have been transmitted by the slave device which is being read.
calibre   issue 1.3 page 17 22/07/99 (see appendix a for details status codes). example usage: (see also sample programs) ' 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. sub main setnack% = 0 ' enable acknowledge - only one byte is to be read ' (see parameter descriptions) i2cdata% = readbyte(setnack%) if i2cdata and &h8000 = &h8000 then print "data read fault i2c status " + hex$(i2cdata%) else print "data read was " + hex$(i2cdata%) end if exit sub 4.3.5. write data byte to slave routine function definition: writebyte%(i2cdata as integer) usage: i2cstatus% = writebyte(i2cdata%) function: procedure to write a byte of data to a slave device whose slave address has already been sent by sendaddress. parameters are: i2cdata% the byte of data which is to be written to the slave device. value returned: the value returned depends on whether the data was written successfully. if the data was written then the status is returned. if the data cannot be written then the last status read iored with &h8000 will be returned. the function will read the status a number of times before returning an error condition - this number is defined by the maxnumberofgoes constant defined in i2cinc.bas, this value may be altered to suit your system. i 2 c status on exit: &h00 bus busy and data transmitted and acknowledged successfully. &h08 bus busy and data transmitted successfully but not acknowledged . &h80 bus busy and data not transmitted (see appendix a for details of status codes).
calibre   issue 1.3 page 18 22/07/99 example usage: (see also sample programs) ' this will write a byte of data to a slave previously addressed by sendaddress. */ sub main i2cdata$ = &h69 ' data byte which is to be transmitted */ i2cstatus$ = writebyte (i2cdata$) if (i2cstatus and &h8000) = &h8000 then print "data has not been transmitted status is " + hex$( i2cstatus%) else print "data has been transmitted" end if end sub 4.3.6. send an i2c stop routine function definition: sendstop%() usage: i2cstatus% = sendstop function: procedure to send a stop (end of communication signal) down the i 2 c bus, sending a transmission or reception with a slave which was address previously by sendaddress. parameters are: none. value returned: i2cstatus% . the value returned depends on whether the bus became free. if the bus became free then the status (&h81) is returned. if the bus does not became free then the last status read iored with &h8000 will be returned. the function will read the status a number of times, waiting for the bus to become free, before returning an none free status - this number is defined by the maxnumberofgoes constant defined in i2cinc.bas, this value may be altered to suit your system. i 2 c status on exit: the status of the parallel i2c communications adapter will be &h81 - bus idle and no unread / untransmitted data in data register. note - this may not be the case in a system where there is another master as well as the parallel i2c communications adapter, since this other master may well have taken control of the bus by the time a program next uses getstatus to read the status register. (see appendix a for details of status codes). example usage: (see also sample programs) ' this will write a stop to the i 2 c bus sub main i2cstatus = sendstop print "stop has been transmitted status is " + hex$( i2cstatus%) end sub
calibre   issue 1.3 page 19 22/07/99 4.3.7. i2c restart and address sending routine function definition: restart%(slaveaddress as integer setnack as integer) usage: i2cstatus% = restart(slaveaddress%, setnack%) function: procedure to send restart and slave address of device which is to be communicated with, without a stop having been sent at the end of the last transmission/reception. this routine is particularly useful for reading memories which must first have a data pointer written to them to select where the read is to occur from, and must then have their read address sent with a restart to proceed with the read operation. parameters are: slaveaddress% the slave address of the device which is to be communicated with. this will be an even number if the communicated with. this will be an even number if the adapter is to write to the slave, add 1 to get an odd number if the adapter is to read from the slave. setnack% this controls whether the parallel i2c communications adapter transmits an acknowledge down the i 2 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. therefore, if a read (odd numbered) address is being sent and only 1 byte is to be read, setnack% should be set to = 1; in all other cases it must be clear = 0. value returned: i2cstatus% the value returned depends on whether the start and address were sent. if the start and address have been sent then the status returned will either be &h00 (bus busy data sent and acknowledged), or &h08 (bus busy, data sent but not acknowledged). if the start or the address cannot be sent (either the bus remained busy or the address did not get sent) then the last status read iored with &h8000 will be returned. the function will read the status a number of times before returning an error condition - this number is defined by the maxnumberofgoes constant defined in i2cinc.bas, this value may be altered to suit your system. i 2 c status on exit &h00 bus busy and address sent and acknowledged &h08 bus busy and address sent but not acknowledged &h80 bus busy and address not sent. (see appendix a for details of status codes). example usage: (see also sample programs) sub main slaveaddress% = &ha1 ' i 2 c address, this is a typical slave read address setnack% = 0 ' enable acknowledge (see parameter descriptions) i2cstatus% = restart(slaveaddress%, setnack%) trash% = readbyte(setnack%) ' read the address from the adapter and discard end sub
calibre   issue 1.3 page 20 22/07/99 4.4. libraries for programming in microsoft windows environments the library function descriptions in this section apply equally to both c++ and visual basic applications. 4.4.1. users of ica90 / 93 i2c adapters for those customers who have already used the ica90 or ica93 i2c adapters and are wishing to convert there windows applications to the parallel i2c adapter the following changes will have to be made:- c++ applications change the link option to c:\ your path \lpti2c.lib. the i2cinc.h file is identical for both the ica90 / 93 and the pica93lv applications. vb3.0 applications replace the project file cali2c.bas for the lpti2c.bas supplied. to simplify the conversion the setup function retains the base address parameter, this is not used by the pica93lv function and any integer value may be passed (even your existing 310 hex). 4.4.2. c functions - function prototypes to ensure the prototypes are added correctly copy the file i2cinc.h into the directory containing your project and add the line: #include "i2cinc.h" remember to add the library lpti2c.lib to your project make file. 4.4.3. visual basic 3.0 functions add the file lpti2c.bas to your project, this contains the declarations for the procedures within the dll. if the dll is not in the root directory change the path to the dll to suit your system. the sendbytes and getbytes functions pass the transfer array to the dll by reference, the following example indicates how to do this: redim transferarray(0 to 258) 'remember 3 locations are required for 'the slave write and word addresses so 'array allows 256 bytes of data. transferarray(0) = &ha0 'slave write address. transferarray(1) = &h00 'slave word address. transferarray(2) = 256 'the number of bytes. bytes_sent = sendbytes(transferarray(0)) 4.4.4. setup function specification void setup(int baseaddress, int ownaddress, int sclk, int statuswait) parameters are: int baseaddress this has no function and any value may be passed to setup, the baseaddress has been retained to enable applications written for the ica90 / ica93 to be rapidly ported to the pica93lv. 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. int statuswait
calibre   issue 1.3 page 21 22/07/99 this is a period of time (in micro seconds) to wait for the required bus status. if this time-out expires the i 2 c functions will exit returning an error code. int sclk this is the clock rate (bit rate for the i 2 c serial bus) when operating as a master. value of sclk approximate scl-khz 090 145 211 31.5 parameters returned none. prerequisites none. functional description this function characterises the pc and initialise adapter ready for i 2 c transfers. 4.4.5. sendaddress function specification int sendaddress(int slaveaddress, int setnack) parameters are: int slaveaddress this is the address to be accessed via the i2c, e.g. a0h. int setnack this controls whether the parallel i2c communications adapter transmits an acknowledge down the i 2 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. therefore, if a read (odd numbered) address is being sent and only 1 byte is to be read, setnack should be set to = 1; in all other cases it must be clear = 0. parameters returned int errcode . if the transfer time out occurs error code 8001h is returned otherwise the status is returned. prerequisites the adapter must be configured for pc and application by running setup . functional description the function waits for the bus to be free. then sends the slave address with the appropriate acknowledge. the acknowledge is set ready for the data transfer after the address and hence in read mode (odd address being sent) if only one byte is to be read the setnack parameter must equal 1. if more than one byte is to be read or if in write mode (even address being sent) then setnack must equal 0. the function waits for the address to be sent. should a time-out occur during the sending of an address then an error code 8001h is returned, otherwise the status is returned. 4.4.6. writebyte function specification int writebyte(int wrdata) parameters are: int wrdata this is the byte of data to be written.
calibre   issue 1.3 page 22 22/07/99 parameters returned int errcode . if the transfer time out occurs error code 8004h is returned otherwise the status is returned. prerequisites adapter must be configured using setup , start and write address sent by sendaddress . functional description the function writes the data to the adapter and then waits for it to be sent. should a time-out occur during the sending of the data then error code 8004h is returned, otherwise the status is returned. writebyte is compatible with both master write and slave write modes. 4.4.7. readbyte function specification int readbyte(int setnack) parameters are: int setnack this controls whether the parallel i2c communications adapter transmits an acknowledge down the i 2 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. therefore, if a read (odd numbered) address is being sent and only 1 byte is to be read, setnack should be set to = 1; in all other cases it must be clear = 0. parameters returned int i2cdata 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. the data is read from the adapter. should a time-out occur then an error code 8005h is returned, otherwise the data is returned. readbyte is compatible with both master read and slave read modes. 4.4.8. sendstop function specification int sendstop( ) parameters are: none. parameters returned int errcode . if the transfer time out occurs error code 8002h is returned otherwise the status is returned. prerequisites adapter must be configured using setup. should normally only be used at the end of a transmission. correct acknowledge sequence must have been applied if the transmission was a read. functional description instruct the adapter to send a stop code and wait for it to be sent. should a time-out occur during the sending of a stop then an error code 8002h is returned, otherwise the status is returned.
calibre   issue 1.3 page 23 22/07/99 4.4.9. restart function specification int restart(int slaveaddress, int setnack) parameters are: int slaveaddress the address to be accessed via the i2c, e.g. a1h. int setnack this controls whether the parallel i2c communications adapter transmits an acknowledge down the i 2 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. therefore, if a read (odd numbered) address is being sent and only 1 byte is to be read, setnack should be set to = 1; in all other cases it must be clear = 0. parameters returned int errcode if the transfer time out occurs error code 8003h is returned otherwise the status is returned. prerequisites adapter must be configured using setup. a start and slave address must have previously been sent using sendaddress . usually a data pointer would already have been written using writebyte. functional description sends a start code and the slave address specified and presets the acknowledge status depending on the value of setnack. the acknowledge is set ready for the data transfer after the address and hence in read mode (odd address being sent) if only one byte is to be read the setnack parameter must equal 1. if more than one byte is to be read or if in write mode (even address being sent) then setnack must equal 0. the function waits for the address to be sent. should a time-out occur during the sending of an address then an error code 8003h is returned, otherwise the status is returned. 4.4.10. getstatus function specification : int getstatus(void) parameters are: none. parameters returned int i2cstatus 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. 4.4.11. recover function specification int recover(void) parameters are: none. parameters returned int errcode. if the bus recovery failed error code 8006h is returned otherwise the status is returned. prerequisites adapter must be configured using setup.
calibre   issue 1.3 page 24 22/07/99 functional description this function issues two consecutive stop commands on the bus, with a delay in between. it then clears the adapter registers and reads the status. this should normally set the adapter into a known idle state when a bus error or other problem has occurred. if the status does not indicate bus free or the bus error bit is still set then 8006h is returned otherwise the status is returned. 4.4.12. sendbytes function specification int sendbytes(int far *transferarray) parameters are: 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. element no element name description 0 slaveaddress slaveaddress is the address to be accessed via the i 2 c bus, this is in hexadecimal e.g. a0h. 1 wordaddress wordaddress is the offset within the slave to which the first byte of data is to be written, see transmission format for more detail. 2 nobytes the number of bytes (n) to be sent. min value 1. 3 byte 0 first byte to be sent. " " byte n last byte to be sent. parameters returned int bsent the number of bytes actually sent. prerequisites adapter must be configured using setup. array elements 0, 1 and 2 must be initialised. usually elements 3 to n would also be initialised. array must be pre-defined to a size at least large enough to hold all the parameters and data concerned. transmission format there are two transmission formats, these are : i. start-slaveaddress-byte(s)-stop if transmission format i) is required set the wordaddress to a number greater than ffh. ii. start-slaveaddress-wordaddress-byte(s)-stop if transmission format ii) is required set the wordaddress to a number less than or equal to ffh. functional description the function determines the required transmission format and then sends a start code and the slave address. if transmission format ii) has been selected the wordaddress is sent. the data bytes are then transmitted sequentially. should a time-out occur or the slave not acknowledge a transfer the transmission is terminated by a stop and the number of bytes actually transmitted is returned.
calibre   issue 1.3 page 25 22/07/99 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. 4.4.13. getbytes function specification int getbytes(int far *transferarray) parameters are: 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. element no element name description 0 slaveaddress slaveaddress is the address to be accessed via the i 2 c bus, this is in hexadecimal e.g. a0h. 1 wordaddress wordaddress is the offset within the slave to which the first byte of data is to be written, see transmission format for more detail. 2 nobytes the number of bytes (n) to be sent. min value 1. 3 byte 0 first byte read. " " byte n last byte read. parameters returned int nobytesread the number of bytes actually read. prerequisites adapter must be configured using setup. array elements 0, 1 and 2 must be initialised. elements 3 to n do not need to be initialised since they are where the read data is returned. the array must be pre-defined to a size at least large enough to hold all the parameters and data concerned. transmission forma t if the slaveaddress has the least significant bit set (1) then this forms a read address, if the least significant bit is clear (0) then this forms the write address e.g. a0h is the write address and a1h is the associated read address. getbytes supports two transfer formats these being: i. start-slavereadaddress-byte(s)-stop to select transfer format i) pass the read address as slaveaddress. the wordaddress is not used in this format and is ignored by getbytes. ii. start-slavewriteaddress-wordaddress-restart-slavereadaddress-byte(s)- stop to select transfer format ii) pass the write address as slaveaddress. in this format the wordaddress must be valid. wordaddress is pointer to the first byte of data to be read. nobytestoread is the number of bytes to be read. the minimum value allowable is 1.
calibre   issue 1.3 page 26 22/07/99 functional description the function determines the required transfer format, sends the appropriate sequence of start(s) and slave address(es) and checks for acknowledges where necessary. if the slave fails to acknowledge then a stop is sent and nobytesread is returned equal to 0. the first data byte read is the slave read address sent (see readbyte description). this is discarded, it is not returned in the transfer array. the data bytes are then read and stored in the transfer array. at the appropriate point acknowledges are ceased - for the last and the last but one byte to be transferred. a stop is sent after the last byte has been read. on completion the number of bytes read is returned. should a time-out occur the transfer is terminated by a stop and the number of bytes successfully read is returned. getbytes can only be used in master read mode. 4.4.14. 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. functional description this function is used when the adapter is a slave being read by a master elsewhere on the bus - the adapter is in slave write mode. the function must be called immediately after the master indicates the last byte has been read (by not acknowledging that byte). this function is required to clear the i 2 c data lines so that the master can send a stop signal.
calibre   issue 1.3 page 27 22/07/99 further information a) philips semiconductors technical handbook book 4 parts 12a and 12b. these give details of the i 2 c compatible ics, and the i 2 c bus specification. the pcf8584p used on the adapter is included in later editions. where the data sheet and this manual disagree, this manual should always be followed when using the adapter. b) philips components data sheet for pcf8584 c) philips application note no eie/an90001 interfacing pcf8584 i 2 c bus controller to 80(c)51 family micro controllers. this gives some useful code but is not written directly for the pc. please note - the hardware information on the pcf8584 given in this application note sometimes contradicts the data sheet referenced in 8.2, in general the data sheet is correct; the only exception is that a stop should be sent as c3 (hex) - as shown in the application, not 43 (hex) - implied in the data sheet ) see appendix b of this manual for details of control codes. where in doubt, follow this manual.
calibre   issue 1.3 page 28 22/07/99 appendix a parallel i2c communications adapter status codes this is an eight bit register, read using the getstatus routine. the bit definitions are as follows: bit 7 (msb) - the pending interrupt not (pin) bit the pin bit is a read-only flag which is used to synchronise serial communication. each time a serial data transmission is initiated (by sendaddress routine or setting sta bit) the pin will be set (= 1) automatically. after successful transmission of one byte (9 clock pulses, including acknowledge), this bit will be automatically reset (= 0) indicating a complete transmission. when the eni bit (enable interrupt) is also set, the pin triggers an external interrupt via the selected irq line when pin is reset. when in receiver mode, the pin is also reset on completion of each received byte. in polled applications, the pin bit is tested (using the getstatus routine) to determine when a serial transmission has been completed. in receiver mode, the pin bit is tested (using the readbyte function). when the pin becomes set all other status bits will be reset, with the exception of the bb (not bus busy) bit. in short, when transmitting data, if pin = 0 then the data has been sent, if pin = 1 then it has not. when receiving data, if pin = 0 then there is unread received data ready to read, if pin = 1 then either the data received has already been read, or no data has yet been received. bit 6 - not used this bit is not currently used and will always = 0. bit 5 - the sts bit when in slave-receiver mode (i.e. transmission initiated by a master elsewhere on the i 2 c bus), the flag sts = 1 when an externally generated stop condition is detected, otherwise sts = 0. this flag is used only in slave-receiver mode. bit 4 - the bus error (ber) bit ber = 1 when a misplaced start or stop has been detected, otherwise ber = 0. this can be quite serious since the i 2 c devices on the bus may be left in an undefined state after a bus error has occurred - in some circumstances the only way to get the bus going again may be to reset all the i 2 c devices on it. bit 3 - the last received bit /address 0 "general call" address received (lrb/ad0) bit this dual function status bit holds the value of the last received bit over the i 2 c bus when aas (bit 2) = 0. normally this will be the value of the slave acknowledge; thus checking for slave acknowledgement is done via testing of the lrb bit. when aas (bit 2) = 1 ("addressed as slave"), the parallel i2c communications adapter has been addressed as a slave and the ado bit will = 1 if the slave address received was the "general call" address. for further information on the "general call" address, see the philips data books referenced in further information section of this user manual. bit 2 - the addressed as slave (aas) bit when acting as a slave-receiver, this flag is set = 1 when an incoming address over the i 2 c bus matches the value defined by the setup routine, or if the slave address received was the i2c bus "general call" address (00 hex). in all other circumstances, aas = 0. bit 1 - the lost arbitration bit (lab) this bit is set = 1 when, in multimaster operation (more than one master present on the i 2 c bus) arbitration is lost to another master on the i 2 c bus. in all other circumstances, lab = 0. bit 0 - the busy bit (bb) this is a read-only flag indicating when the i 2 c bus is in use. bb = 0 indicates that the bus is busy, and access is not possible (unless of course it is busy because the parallel i2c communications adapter itself has control of the bus). this bit is set = 1 by stop conditions and reset = 0 by start conditions. in short, bb = 1 means that the bus is free and a new transmission can be started.
calibre   issue 1.3 page 29 22/07/99 appendix b parallel i2c communications adapter control codes the control register should normally be written using the setup, sendaddress and sendstop routines. to implement more advanced functions for example, enabling hardware interrupt generation these routines may need to be modified or the users own routines used in their place. the control register is accessed using the controloutp() and controlinp() functions. the function definitions for these are as follows: void controloutp(int controldata); int controlinp(void); the data register is accessed using the dataoutp() and datainp() functions. the function definitions for these are as follows: void dataoutp(int controldata); int datainp(void); e.g. in c, controloutp(0xc3); would cause an parallel i2c communications adapter to generate a stop condition on the i 2 c bus. for detailed information on these codes, the philips data sheet on the pcf8584 device (see further information section). 0x00 read/write own address register (followed by a data byte to the data register). 0x20 read/write clock register (followed by a data byte to the data register). after either of the above operations, 0x41 must be written to the control register to re-enable the i 2 c interface. 0xc3 send a stop signal over the i 2 c bus. 0x41 i 2 c nop (no operation) instruction, acknowledge enabled. (use 0x41 and 0x40 to turn on and off acknowledge) 0x45 (while bus is free) - send start & slave address, acknowledge enabled. the address to be sent must have first been written to the data register before sending the start code. 0x45 (while already master on the bus) - send repeated start & slave address (restart). the address to be sent is placed in the data register after sending the start code. 0x47 send stop, start, slave address (i.e. restart transmission without releasing control of the i 2 c bus). the address to be sent is placed in the data register after sending the start code. to execute the last four instructions with acknowledge disabled, i.e. negative acknowledge - nack, send the control code - 1, e.g. 0x40, 0x44, 0x46.
calibre   issue 1.3 page 30 22/07/99 the most commonly asked i2c questions 6.1. general questions 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 as a master and 100khz as a slave. question will my adapter work under windows nt4* or windows 95*? answer the adapter will work under both these systems without problems. if you need to access the windows nt and windows 95 dlls please contact our sales team for further information. * all trade marks acknowledged question i get corrupted transfers why is this? answer the most likely reason for corrupted transfers is either incorrect bus termination or excessive capacitance - see the manual for details. question do you have software to talk to my........? answer unfortunately there are too many i2c devices for us to be able to offer complete solutions - although we can supply a windows based application called wini2c which is designed for those just starting i2c or wishing to perform simple i2c tasks, please contact our sales team or look on our web site, www.calibreuk.com for further information. question i am trying to read from a device, the first time my software works fine but when i try again i can't get anything what's wrong? answer please check that you are changing the value of setnack in accordance with the manual, it is likely that you have not made setnack 1 for the last and last but one bytes being read. 6.2. dos software questions question my i2c adapter locks up with a constant status - why? answer if you are using either the 'c' or basic library functions supplied with the adapter on a fast pc it is possible that the pc is polling the status register too quickly, the simplest way to prevent this is to add a small delay prior to reading the status in the getstatus routine. alternatively use the windows dll supplied as these automatically allow for speed of the pc at run-time. 6.3. windows 95 and nt questions question my software cannot find the adapter. your windows software reports that it cannot configure the adapter. why is this? answer have you registered the device driver as detailed in the software manual? if so check that the address links (see adapter manual for details) are correct for the location at which you registered the driver. question i think i have registered the driver how can i find out if i have? answer you need to inspect the registry as follows
calibre   issue 1.3 page 31 22/07/99 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. why? answer check the syntax of the setup function, this problem is most usually caused by swapping the status wait and sclk parameters. the correct syntax is i2cstatus = setup (baseaddress, ownaddress, sclk, statuswait) question i have read the manual and still cannot get the communications to run. what do i do next? answer check that you have fully implemented the protocol between the adapter and the other i2c devices see the device manufacturers data sheet for details. check that the software you have written is logically and syntactically correct - this is probably the most common cause of software faults we have to deal with. send us the following details:- 1)the link settings of the adapter. 2)a sketch of the relevant i2c hardware including the location of bus termination. 3)the type and speed of processor within your pc and which operating system, you are running.
calibre   issue 1.3 page 32 22/07/99 4)brief software listings, or which calibre software you are running. 5)the serial number of your i2c adapter, or when you purchased it. please email your query to: techsupport@calibreuk.com or fax your query to: 44-1274-730960 we will endeavour to help you.


▲Up To Search▲   

 
Price & Availability of PICA93LVC

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X