Thread View: comp.arch.embedded
3 messages
3 total messages
Started by Peter Jakacki
Thu, 06 Mar 1997 00:00
I2C BUS FACTS
Author: Peter Jakacki
Date: Thu, 06 Mar 1997 00:00
Date: Thu, 06 Mar 1997 00:00
90 lines
3875 bytes
3875 bytes
I've been using the I2C bus (or Inter IC bus as it used to be called when it came out in the early 80's) for over a decade now. From some of the communication I've seen on newsgroups I see there is a lot of interest in it and yet a certain amount of misunderstanding about it. Because of this and my own experience with the bus I feel I may be able to help answer some questions and set matters straight. __________________ OTHER BUSES MICROWIRE BUS Requires clock, data in, data out, and individual chip selects. Better than a parallel bus for certain devices but only the first step in serial control. SPI BUS Fast if hardware is built into the micro but inherently point-to-point so limited to master+slave. Great though for two micros to communicate with one another directly. __________________ I2C BUS LICENSE The I2C was created by Philips but to the best of my knowledge any chipmaker that uses it only has to comply with the standard, they do not have to pay Philips for the privilege. This way the I2C standard remains a standard. SPEED I2C can be slower than micro-wire or SPI or any other dedicated point-to-point 'bus'. It's maximum speed is limited to 400K bps. You can perform a random read fom a 24C04 in about 80us. MULTIDROP Only I2C offers true multidrop and multimaster capability. All chips on the I2C bus are addressable. No special chip select signals are needed, it is truely a 2 wire bus (plus ground of course). CONTENTION Most configurations require only a single master so there is no need to have complicated software to handle contentions. Otherwise, it is available for those who require it. DRIVE I2C bus lines are 'open-drain' type with an external pull-up required usually back at the processor end. If you are using single-master mode (that is, only one processor controlling the bus) the clock pin only needs to be an output (no pullup required) as it never needs to relinquish control. If you are trying to drive the I2C bus from an output only port such as a PC printer port you only need insert a diode such as a BAT85 and a 4K7 pull-up resistor in the SDA line. output ------------------ SCL output --|--|<|----|----- SDA |-/\/\/---| input ------------| DEVICES AVAILABLE Besides the ability to interface processors to the bus the real advantage is being able to interface 'dumb' chips to the bus. Some of the more common chips available are; PCF8574 16 pin 8-bit I/O, 30 ma sink passive pullup PCF8591 16 pin 4 channel 8-bit ADC + 8-bit DAC PCF8583 8 pin RTC + 256 bytes RAM 24CXX 8 pin Range of serial EEPROMs SAA1064 24 pin 4-digit LED driver TDA8444 16 pin octal 6-bit DAC MY OWN EXPERIENCE I always like to leave two I/O lines available on any design I do and run them out to a 4-pin strip on the edge of the board. The number of times a customer has required that extra little widget and I've been able to accommodate it using the I2C bus for expansion. My favourite chip for this is the PCF8574 which is an 8-bit I/O chip with weak pull-ups. With a single chip I can interface directly to an LCD module, or a 4X4 keypad, LEDs, etc. Most drivers I write are rarely more than 90 lines of assembler to create a byte write, byte read, start, and stop subroutines. If you want some examples or how-to then just ask me. MY CONNECTOR (MOSTLY) A single 4 pin 0.1" header. 1 SDA 2 SCL 3 GND 4 V+ CORRECTIONS WELCOME /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/ Peter Jakacki \/ /\ Cybertronics /\ \/ Brisbane, Australia \/ /\ Email: cyb@ozemail.com.au, cybert@aai.com.au /\ \/ WWW: http:/www.ozemail.com.au/~cyb/ \/ /\ ph: 61 7 3273-1409 fax: 61 7 3272-2449 /\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Re: I2C BUS FACTS
Author: simon@tk.uni-lin
Date: Mon, 10 Mar 1997 00:00
Date: Mon, 10 Mar 1997 00:00
30 lines
1339 bytes
1339 bytes
Peter Jakacki (cyb@ozemail.com.au) wrote: [...] > MY OWN EXPERIENCE > I always like to leave two I/O lines available on any design I do and run them out to a 4-pin strip on the edge > of the board. The number of times a customer has required that extra little widget and I've been able to > accommodate it using the I2C bus for expansion. > My favourite chip for this is the PCF8574 which is an 8-bit I/O chip with weak pull-ups. > With a single chip I can interface directly to an LCD module, or a 4X4 keypad, LEDs, etc. > Most drivers I write are rarely more than 90 lines of assembler to create a byte write, byte read, start, and stop > subroutines. If you want some examples or how-to then just ask me. BTW, there is also a Linux driver for it that I have written. It can be found on ftp://ftp.tk.uni-linz.ac.at/pub/simon/i2c also on ftp.funet.fi, sunsite & mirrors. Cheers, Simon ------------------------------------------------------------------------------ simon@tk.uni-linz.ac.at +43-732-614893 ------------------------------- kernel panic: out of coffeine - system halted. As a service, I provide analysis for viruses and poor grammar to senders of unsolicited commercial e-mail at a rate of US$250 per hour. Delivery of said correspondence constitutes a request for the aforementioned services at said price.
Re: I2C BUS FACTS
Author: w.huerttlen@kfa-
Date: Wed, 12 Mar 1997 00:00
Date: Wed, 12 Mar 1997 00:00
15 lines
353 bytes
353 bytes
Peter Jakacki <cyb@ozemail.com.au> wrote: >Most drivers I write are rarely more than 90 lines of assembler to create a byte write, byte read, start, and stop >subroutines. If you want some examples or how-to then just ask me. do you have code for the 8051-cpu ? Would you give it as an example, I am up to control an I2C-PLL device.... Werner
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads