Marius,

The hardware direction control issues may be simpler 
than you expect.

The I2C bus does not use tri-state and direction 
control. Rather it uses "open collector" or "open
drain" style outputs with a pull-up resistor. When
it wants to read from an input, it writes a logic 
one to that output so that the driver is not pulling 
down.

The resistor pulls up and if there is nothing else
driving the signal, then the input from that same
signal will read as one. If something else connected
to that signal drives the signal to zero, then it
will overcome the pull-up resistor and the input
will read as a zero. 

The standard parallel printer port includes four
signals (pins 1, 14, 16, and 17) that behave in this
same manner and may be usable for direct connection
to an I2C bus. 

Recommended reading:

http://www.linux-cae.net/Projects/Parallel/Dage/parport.html

Parallel ports that follow the original IBM-PC design 
recommendations will have a 4.7K ohm pull-up resistor. 
For many applications this will directly work with the 
I2C bus. In a few cases the resistor may be a different
value and in a very few rare cases parallel ports have
been built that use totem-pole drivers for these pins.

If you are not comfortable with connecting your I2C bus
directly to the parallel port, you can also use external
buffers that are open-collector to achieve the same thing
without needing to control the direction of the parallel
port's data pins. It just requires one more pin from the
parallel port because the data out and data in will need
to be on different pins. See this application note:

http://www.maximintegrated.com/app-notes/index.mvp/id/3230

Do keep in mind that some of the signal paths in a parallel
port interface have an extra signal inversion, so what is
described as a one or zero at the parallel port connector
may show up as the reverse when software reads the interface
registers.

Regards,
Steve Stallings
www.PMDX.com


> -----Original Message-----
> From: Marius Liebenberg [mailto:[email protected]] 
> Sent: Sunday, May 18, 2014 4:12 AM
> To: [email protected]
> Subject: Re: [Emc-developers] New function for parport driver required
> 
> Partly as you say but it only puts the control lines into 
> input mode so 
> that the port has 8 out and 9 input lines. To use it as bidirectional 
> pins the approach is slightly different. So I have to add the 
> bi-directional pins as a config option and then they must be 
> handled is 
> input or output as required.
> Currently the code only handles input or output mode. I 
> started with the 
> corrections already and might ask for some testing help later.
> 
> One wire will work if we have bi-dir pins. Just need a driver 
> comp then.
> Once I have the bi-dir stuff sorted I can continue with the 
> I2C driver.
> 
> 
> On 2014-05-18 09:23, Andy Pugh wrote:
> >
> >> On 17 May 2014, at 22:55, Marius Liebenberg 
> <[email protected]> wrote:
> >>
> >> I need an added feature for the parport driver namely to 
> be able to put
> >> the control pins in bi-directional mode in order to drive 
> i2c devices.
> > I think that this is partly implemented already as the "x" mode.
> >
> > It might also be a useful feature for bit-banging onewire.
> >
> > 
> --------------------------------------------------------------
> ----------------
> > "Accelerate Dev Cycles with Automated Cross-Browser Testing 
> - For FREE
> > Instantly run your Selenium tests across 300+ browser/OS combos.
> > Get unparalleled scalability from the best Selenium testing 
> platform available
> > Simple to use. Nothing to install. Get started now for free."
> > http://p.sf.net/sfu/SauceLabs
> > _______________________________________________
> > Emc-developers mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/emc-developers
> >
> 
> -- 
> 
> Regards /Groete
> 
> Marius D. Liebenberg
> +27 82 698 3251
> +27 12 743 6064
> QQ 1767394877
> 
> 
> --------------------------------------------------------------
> ----------------
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing 
> platform available
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
> _______________________________________________
> Emc-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/emc-developers
> 


------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to