[lm-sensors] External sensor and i2c/parallel adapters

Jean Delvare khali at linux-fr.org
Sat May 28 16:38:31 CEST 2005


Hi Fred,

> I need to connect a compass having an i2c bus to a computer.  The
> current plan is to use one of these i2c/parallel port adapters. 
> However, I'm not sure if it will indeed work.  Here is what I think at
> the moment.
> 
> Many kernel drivers do support e.g. the Philips adapters.  However, it
> seems that this is not to use the adapter externally.  This would
> however work with the i2c-pcf-epp driver, but it hasn't been ported
> yet to linux 2.6 (I saw a more than 1 year old message on that on this
> list, but no follow up).

There are two kinds of parallel port adapters which can be used to
control an I2C bus.

The first kind uses the parallel port to address an external I2C master,
such as the Philips PCF8584. What goes through the parallel port in this
case are commands for the external master (and data bytes, of course).
That's what the i2c-pcf-epp driver does.

The second, more popular kind controls the lines of an I2C bus directly
through the parallel port pins. In other words, the parallel port is the
I2C master itself. There are various implementations, some use the same
pin to read and write, others use different pins. That's what the new
i2c-parport drivers does.

In almost all cases you need to wire some electronic components between
the parallel port and the i2c client chip(s), except for the i2c-pport
driver (*not* the same as i2c-parport).

> The doc for the i2c-parport kernel module gives the schematics of a
> diy "i2c-over-parallel-port" adapter.  Anybody knows how easy it is to
> use?

I'm not sure I get what your question really means. If you are able to
build the adapter as described, you get a fully controllable I2C bus.
The hard part is to build it. Once it's done, using it is just as easy
as using any other I2C or SMBus adapter under Linux.

> Any suggestions?

If you have the required electronics skills, simply build the adapter
according to the schematics of the i2c-parport documentation (second one
is better).

Also note that many recent motherboards have SMBus pins which you could
use directly if your compass works using standard SMBus commands.

-- 
Jean Delvare




More information about the lm-sensors mailing list