Subject: Re: I2C via parallel port?
To: John Clark <jclark@metricsystems.com>
From: Herb Peyerl <hpeyerl@beer.org>
List: netbsd-users
Date: 08/18/2005 10:42:43
On 18-Aug-05, at 10:18 AM, John Clark wrote:
> Dan McMahill wrote:
>> Anyone have code they'd like to share which implements an I^2C  
>> host by bit-banging of the parallel port?  For that matter, anyone  
>> know if the parallel port drivers for i386 even support such a  
>> thing?  I'm wanting to play around with a chip which needs to be  
>> programmed (via I^2C) to get it to do anything.
>>
> I've not tried to implment a I2C line, but I have recently used the  
> 'standard' parallel interface to
> perform 'general I/O'. In my case all I had to do was to set the  
> BIOS up to allow the
> interface to do the simplest 'bi-directional' setup. 'General'  
> meaning here that one can set the port
> to either output or input, not individual bits... However, there  
> are some bits which allow for
> both input and so one can have some 'bi-directionality' at the same  
> time.

I think Aaron Grier has a hacked lpt driver that he implements BDM  
on.  It should be relatively trivial to munge that to do I2C.

In reality, we really need a generic LPT driver so you can do big- 
banging from userspace.  I long for such a thing so I can program my  
AVR's via SPI. Such a thing needs to be integrated into NetBSD and  
export a userland API.

FreeBSD has such a thing if I'm not mistaken.  The scenery may have  
changed though; I haven't looked at this in a couple years.