Author: Matthias Weingart (matthias@penthouse.boerde.de) 
        http://www.boerde.de/~matthias/delphi

                        IIC-Bus Universal
                        =================

IIC-Bus Universal is a program for I2C-bus chips. Freeware
- for various passive parallel port interfaces (you can choose the portpins)
- own simple syntax for the i2c-commands
- hexdump for EEPROMS or EEPROM arrays
- for win3.1 or win95 or win98 NOT winNT (no direct hardware access possible in NT :(
- PC is master, only single master mode possible
- supports all specified i2c-conditions (like 'repeated start', 'clock stretching')
- written in Delphi 1; source available
- circuit diagram of LPT I2C-interface of Philips is in i2cintf.gif

The main window
===============

There are two edit windows. The upper for the input of commands (command editor); 
the lower for the responses from the bus. Use "enter" to send the string; Ctrl-Enter
to insert a line.

Up-Down-Buttons: increment-decrement the value under the cursor in the command editor
                 useful if you select "repeated send". You can change parameters on the fly
 
'Send All':     if activated, sends all lines in the command editor; otherwise only the 
                line under the cursor

BaseAdr+0
BaseAdr+2
Set-Button:     direct modify of the parallel port output ports (for testing)
                BaseAdr+0 is the 8 bit data output
                BaseAdr+2 is for control signals
                BaseAdr+1 is input and not changeable by software

Port-Editfeld:  Angabe des Parallelports (LPT1..LPT4) oder einer
                beliebigen Hex-Adresse, an der sich das Interface befindet
I2C-Brake:      you need it to slow down the bus to 100kHz (or lower) on fast machines
                "Auto" will set it to 100kHz (I hope so)

HexDump
-------

For Hexdumps of I2C-EEPROMs. For EEPROM up to 16kBit select 8bit-adressing;
for >=32kBit select 16bit. Choose a valid deviceadr. (0A0h). if the address shown 
is too big for one EEPROM (e.g. greater than 256 bytes (8bit addressing)) the
deviceadr is automatically incremented (0A0h -> 0A2h -> 0A4h ...) So you can read
EEPROM-arrays once.
You can load or store the contents of an EEPROM to a file. The data are stored binary.
The file load process stores the bytes to the EEPROM byte per byte (no use of write
cache). So it can take 30 seconds for a 24C65 (64 kbit)

Pin settings
------------

You can select the parallel port pins for your i2c-signals. 
SdaOut, SdaIn, SclOut are required for the function
SclIn is only needed for the detection of "clock stretching"
The "Chargepump" pin toggles each 50 ms. Useful for chargepumps,
but not required 

The delivered profiles are for a interface described in philips databooks
and for a chipcard reader (mirtronic)

Attention! Some Signals at the printer port are inverted by nature.
The Standard-Inversions at the printer-port (SUB-D25) are:
BaseAdrOffset   Register    Pin     Inversion
                bits

Outputs:
BaseAdr+0:      bit 0..7:   (Pin 2..9) NORMAL

BaseAdr+2:      bit 0:      Pin 1   INVERTED
                bit 1:      Pin 14  INVERTED
                bit 2:      Pin 16  NORMAL
                bit 3:      Pin 17  INVERTED

Inputs:
BaseAdr+1:      bit 3:      Pin 15  NORMAL
                bit 4:      Pin 13  NORMAL
                bit 5:      Pin 12  NORMAL
                bit 6:      Pin 10  NORMAL
                bit 7:      Pin 11  INVERTED

No warranty for these data. Send me an email if you find a mistake.

syntax of the i2c commands:
------------------------------
(without the quotation marks)

start condition                         's'
hex byte to send (e.g.)                 'a0'
hex byte to receive                     'x' or 'r'
stop condition                          'p'
separation of commands                  ',' or new line (ctrl-enter)
comment                                 ';'
You can leave out 's' and 'p' at the beginning and end of a line.

Editor keys:
insert new line                        Ctrl-Enter
send the line                          Enter

add. chars in the receive window (output):
acknowledged                            '+'
not acknowledged                        '-'

samples:
-------

Write one byte to I2C-Bus EEPROM
input:
A0 00 55
         A0 deviceaddress,
         00 Subaddress,
         55 value for memory position 0
Output if EEPROM is available:
sA0+ 00+ 55+p
         s  startcondition
         A0 deviceadresse sended
         +  acknowledge from the EEPROM
         .....
Output if EEPROM is NOT available:
sA0- 00- 55-p
         -  no acknowledge from the EEPROM

Read one byte from EEPROM with 'repeated start'
Input:
a0 00 s a1 x ;Read one byte Bytes
         A0 deviceadresse (for write)
         00 subaddress
         s  new start condition (so called repeated start)
         A1 is deviceadres (for read)
         x  for the received byte
         ;  for the comment
Output:
sA0+ 00+ sA1+ r55-p
         r55- no ackowledge by the master
         corresponding to the i2c-spec the master (PC) sends a "no ackn"
         after the last byte sent

Read 8 bytes at once
Input:
a0 00 s a1 x x x x x x x x

Output:
sA0+ 00+ sA1+ r55+ rFB+ r08+ rFF+ rFF+ rFF+ rFF+ rFF-p
        entsprechend der I2C-Busspezifikation gibt der Master (der PC)
        nach jedem gelesenen Byte ein Ack aus bis auf das letzte byte,
        diesem folgt ein nAck


sources
=======

Delphi 1.02 sources are included. You should install the component WHexGrid first.

I am glad to hear from you about my program -> mailto:matthias@penthouse.boerde.de

