EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Interfacing 5v I2C circuit to Olimex-h2148

Started by Mohamad Tayssir Alkowatly September 6, 2009
Hi all

I have ATMEGA08-16 based circuit that I want to command from my Olimex-h2148
board using I2C protocol.
The Atmel based circuit operates on 5v. LPC2148 I2C pins are 5v tolerant so
they all can operate on a 5v I2C bus. But I've noticed that all I2C pins on
Olimex-h2148 are pulled high at 3.3v using 4.7k resistors.
As I'm not from an electronic background I cannot tell whether this
arrangement on the Olimex board will eliminate the possibility of simply
interfacing the slave circuit using a 5v I2C bus (just ignore the fact that
the pins are pulled high at 3.3v).

I appreciate your advice regarding this case

Best Regards,

Tayseer


An Engineer's Guide to the LPC2100 Series

--- In l..., Mohamad Tayssir Alkowatly wrote:
>
> Hi all
>
> I have ATMEGA08-16 based circuit that I want to command from my Olimex-h2148
> board using I2C protocol.
> The Atmel based circuit operates on 5v. LPC2148 I2C pins are 5v tolerant so
> they all can operate on a 5v I2C bus. But I've noticed that all I2C pins on
> Olimex-h2148 are pulled high at 3.3v using 4.7k resistors.
> As I'm not from an electronic background I cannot tell whether this
> arrangement on the Olimex board will eliminate the possibility of simply
> interfacing the slave circuit using a 5v I2C bus (just ignore the fact that
> the pins are pulled high at 3.3v).
>
> I appreciate your advice regarding this case
>
> Best Regards,
>
> Tayseer

I would like to address two points.

1) 5 Volt tolerant input

An input is 5 Volt tolerant with a current limited 5V source is driving it.

That said, any device that output 5 Volts from its internal switch will have a current limit build in. The spec sheet of the device will tell you how much current in can pass.

If you think the input will not handle the current of the 5 Volt output, insert a resistor in serial with the input.

2) Pull-ups

A pullup resistor will pass the highest of two voltages.
So the 3.3V rail will see the 5V rail (with reduced current)

So, remove the 3.3V pullup and let the 5V tolerant input do its job as designed.

don
On Sun, Sep 6, 2009 at 6:52 PM, donhamilton2002
wrote:
>
> --- In l..., Mohamad Tayssir Alkowatly wrote:
> >
> > Hi all
> >
> > I have ATMEGA08-16 based circuit that I want to command from my Olimex-h2148
> > board using I2C protocol.
> > The Atmel based circuit operates on 5v. LPC2148 I2C pins are 5v tolerant so
> > they all can operate on a 5v I2C bus. But I've noticed that all I2C pins on
> > Olimex-h2148 are pulled high at 3.3v using 4.7k resistors.
> > As I'm not from an electronic background I cannot tell whether this
> > arrangement on the Olimex board will eliminate the possibility of simply
> > interfacing the slave circuit using a 5v I2C bus (just ignore the fact that
> > the pins are pulled high at 3.3v).
> >
> > I appreciate your advice regarding this case
> >
> > Best Regards,
> >
> > Tayseer
> >
> > I would like to address two points.
>
> 1) 5 Volt tolerant input
>
> An input is 5 Volt tolerant with a current limited 5V source is driving it.
>
> That said, any device that output 5 Volts from its internal switch will have a current limit build in. The spec sheet of the device will tell you how much current in can pass.
>
> If you think the input will not handle the current of the 5 Volt output, insert a resistor in serial with the input.
>
> 2) Pull-ups
>
> A pullup resistor will pass the highest of two voltages.
> So the 3.3V rail will see the 5V rail (with reduced current)
>
> So, remove the 3.3V pullup and let the 5V tolerant input do its job as designed.
>
> don
>

Many thanks Don for the notes

removing the 3.3v pullup will require a minor surgical operation on
the board which is my last resort
I'm not sure if I've got what you mean, and I appreciate if you could
explain the connection between the two sentences in your second note
(pull-ups) ? what I've got from the first sentence is that if i
connect the 5v rail to the 3.3v rail as in the following figure the
result will be is a 5v rail as desired

3.3v 5v
| |
[R1] [R2]
| |
|________|______________(SCL or SDA)
the second sentence you suggest removing the 3.3v pullup to make it
work. the question is: if the resulting bus in the figure is a 5v bus
as desired so why the circuits cannot drive it properly ?

Cheers,

Tayseer
--- In l..., Mohamad Tayssir Alkowatly wrote:
>
> Many thanks Don for the notes
>
> removing the 3.3v pullup will require a minor surgical operation on
> the board which is my last resort

Please remove the 3.3V pullup.

> I'm not sure if I've got what you mean, and I appreciate if you could
> explain the connection between the two sentences in your second note
> (pull-ups) ? what I've got from the first sentence is that if i
> connect the 5v rail to the 3.3v rail as in the following figure the
> result will be is a 5v rail as desired
>
> 3.3v 5v
> | |
> [R1] [R2]
> | |
> |________|______________(SCL or SDA)
> the second sentence you suggest removing the 3.3v pullup to make it
> work. the question is: if the resulting bus in the figure is a 5v bus
> as desired so why the circuits cannot drive it properly ?
>
> Cheers,
>
> Tayseer
>
The I2C bus will still work with both resister connected.

At this point its not the I2C bus, its the rest of the circuit tied to the 3.3V bus.

Some 3.3V devices may not like to see 5V at its Vcc input, even if the current is very low.

don
Well..

Do this: Check if all extra (if there is one) devices connected on the 3.3V
I2C are 5 volts tolerant.

By connecting a line pull uped to 3.3V to an other pulluped to 5V a current
will be sunk from the 5V line:
I = 1.7V/Req
Where Req = Parallel of the both pullups.

And the tension of the line will be something between 3.3V and 5V, stills
ok, 3.3V is already enough to the 5V chip understand a bit '1'.

You dont really have to worry about it if the current is low. If all the
devices are 5V tolerant thats ok connecting everything together.

2009/9/6 donhamilton2002

> --- In l... , Mohamad
> Tayssir Alkowatly wrote:
> >
> > Many thanks Don for the notes
> >
> > removing the 3.3v pullup will require a minor surgical operation on
> > the board which is my last resort
>
> Please remove the 3.3V pullup.
>
> > I'm not sure if I've got what you mean, and I appreciate if you could
> > explain the connection between the two sentences in your second note
> > (pull-ups) ? what I've got from the first sentence is that if i
> > connect the 5v rail to the 3.3v rail as in the following figure the
> > result will be is a 5v rail as desired
> >
> > 3.3v 5v
> > | |
> > [R1] [R2]
> > | |
> > |________|______________(SCL or SDA)
> >
> >
> > the second sentence you suggest removing the 3.3v pullup to make it
> > work. the question is: if the resulting bus in the figure is a 5v bus
> > as desired so why the circuits cannot drive it properly ?
> >
> > Cheers,
> >
> > Tayseer
> >
> The I2C bus will still work with both resister connected.
>
> At this point its not the I2C bus, its the rest of the circuit tied to the
> 3.3V bus.
>
> Some 3.3V devices may not like to see 5V at its Vcc input, even if the
> current is very low.
>
> don
>
>
>


On Mon, Sep 7, 2009 at 4:21 AM, Felipe de Andrade Neves Lavratti
wrote:
>
> Well..
>
> Do this: Check if all extra (if there is one) devices connected on the 3.3V
> I2C are 5 volts tolerant.
>
> By connecting a line pull uped to 3.3V to an other pulluped to 5V a current
> will be sunk from the 5V line:
> I = 1.7V/Req
> Where Req = Parallel of the both pullups.
>
> And the tension of the line will be something between 3.3V and 5V, stills
> ok, 3.3V is already enough to the 5V chip understand a bit '1'.
>
> You dont really have to worry about it if the current is low. If all the
> devices are 5V tolerant thats ok connecting everything together.
>
> 2009/9/6 donhamilton2002 >
> >
> > --- In l... , Mohamad
>
> > Tayssir Alkowatly wrote:
> > >
> > > Many thanks Don for the notes
> > >
> > > removing the 3.3v pullup will require a minor surgical operation on
> > > the board which is my last resort
> >
> > Please remove the 3.3V pullup.
> >
> > > I'm not sure if I've got what you mean, and I appreciate if you could
> > > explain the connection between the two sentences in your second note
> > > (pull-ups) ? what I've got from the first sentence is that if i
> > > connect the 5v rail to the 3.3v rail as in the following figure the
> > > result will be is a 5v rail as desired
> > >
> > > 3.3v 5v
> > > | |
> > > [R1] [R2]
> > > | |
> > > |________|______________(SCL or SDA)
> > >
> > >
> > > the second sentence you suggest removing the 3.3v pullup to make it
> > > work. the question is: if the resulting bus in the figure is a 5v bus
> > > as desired so why the circuits cannot drive it properly ?
> > >
> > > Cheers,
> > >
> > > Tayseer
> > >
> > The I2C bus will still work with both resister connected.
> >
> > At this point its not the I2C bus, its the rest of the circuit tied to the
> > 3.3V bus.
> >
> > Some 3.3V devices may not like to see 5V at its Vcc input, even if the
> > current is very low.
> >
> > don
> >
> >

Ok, Thanks to both replies from Don and Felipe I now understand the
consequences of this arrangement.

Tayseer

> >
--
Mohamad Tayssir Alkowatly
Hi Tayseer,

You could use a bidirectional level translator like TI TXS0102

http://focus.ti.com/docs/prod/folders/print/txs0102.html

This chip is specially made for I2C or GPIO level shifting applications.

Girish

--- In l..., Mohamad Tayssir Alkowatly wrote:
>
> Hi all
>
> I have ATMEGA08-16 based circuit that I want to command from my Olimex-h2148
> board using I2C protocol.
> The Atmel based circuit operates on 5v. LPC2148 I2C pins are 5v tolerant so
> they all can operate on a 5v I2C bus. But I've noticed that all I2C pins on
> Olimex-h2148 are pulled high at 3.3v using 4.7k resistors.
> As I'm not from an electronic background I cannot tell whether this
> arrangement on the Olimex board will eliminate the possibility of simply
> interfacing the slave circuit using a 5v I2C bus (just ignore the fact that
> the pins are pulled high at 3.3v).
>
> I appreciate your advice regarding this case
>
> Best Regards,
>
> Tayseer
>
>
--- In l..., "gmpundlik" wrote:
>
> >
> > Hi all
> >
> > I have ATMEGA08-16 based circuit that I want to command from my Olimex-h2148
> > board using I2C protocol.
> > The Atmel based circuit operates on 5v. LPC2148 I2C pins are 5v tolerant so
> > they all can operate on a 5v I2C bus. But I've noticed that all I2C pins on
> > Olimex-h2148 are pulled high at 3.3v using 4.7k resistors.
> > As I'm not from an electronic background I cannot tell whether this
> > arrangement on the Olimex board will eliminate the possibility of simply
> > interfacing the slave circuit using a 5v I2C bus (just ignore the fact that
> > the pins are pulled high at 3.3v).
> >
> > I appreciate your advice regarding this case
> >
> > Best Regards,
> >
> > Tayseer
> >

Just remove the pullups to 3.3V and add some pullups to 5V.

Cheers

Martin


Memfault Beyond the Launch