EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: mribble on April 09, 2012, 01:01:03 am

Title: i2c voltage level conversion problem
Post by: mribble on April 09, 2012, 01:01:03 am
I'm trying to interface this I2C LCD (http://www.newhavendisplay.com/specs/NHD-C0216CiZ-FSW-FBW-3V3.pdf (http://www.newhavendisplay.com/specs/NHD-C0216CiZ-FSW-FBW-3V3.pdf)) with the Arduino.

I'm using code that is basically from the data sheet, but it wasn't working.  I hooked up a logic analyzer and can see that I'm geting an ACK on the 3.3 side of the bus (slave/lcd side).  When I look at the 5V side of the bus (master/arduino) I don't get the ack and it fails.

Here is my level conversion circuit:
(http://www.glacialwanderer.com/_blog/blog2012/April/i2c_debug2.png)

The only things that could possibly matter are the mosfets.  This is what I'm using there: http://www.mouser.com/ProductDetail/Fairchild-Semiconductor/FQN1N50CTA/?qs=sGAEpiMZZMsrr1kXJis%252bJwANxo1JtN8aMQxukBeGcxU%3d (http://www.mouser.com/ProductDetail/Fairchild-Semiconductor/FQN1N50CTA/?qs=sGAEpiMZZMsrr1kXJis%252bJwANxo1JtN8aMQxukBeGcxU%3d)

Does anyone have an idea what's going wrong?
Title: Re: i2c voltage level conversion problem
Post by: Rerouter on April 09, 2012, 01:12:12 am
perhaps your mosfet is back to front? drain is to go on the higher voltage side,

alternativly here are the mosfet specs you must meet http://ics.nxp.com/support/documents/interface/pdf/an97055.pdf (http://ics.nxp.com/support/documents/interface/pdf/an97055.pdf) page 13

max gs voltage of 2V, your one reads 30V
Title: Re: i2c voltage level conversion problem
Post by: mribble on April 09, 2012, 01:45:52 am
I've triple checked and if the datasheet is correct and mouser shipped me the part on the label (both of these seem highly likely) then I have the drain hooked up to the higher voltage.

That said I think your point about the gs voltage makes sense.  I'm not sure where you got 30V for mine.  The datasheet seems to say mine is 2-4 volts.  Based on the application note you sent me I think my max gs voltage needs be under 1.7 volts.
Title: Re: i2c voltage level conversion problem
Post by: TerminalJack505 on April 09, 2012, 01:47:08 am
Your MOSFET has a worst-case Vgs(th) of 4V so that may be the problem.  You might try a different one.  Sparkfun has a level converter...

http://www.sparkfun.com/products/8745 (http://www.sparkfun.com/products/8745)

that uses the same circuit you are using but uses a BSS138 which has a worst-case Vgs(th) of 1.5V.  People say the circuit works for I2C.

You might also read this app note:

http://www.nxp.com/documents/application_note/AN10441.pdf (http://www.nxp.com/documents/application_note/AN10441.pdf)
Title: Re: i2c voltage level conversion problem
Post by: mribble on April 09, 2012, 10:54:33 am
Thanks!  I've just ordered some new mosfets to try.  I'm pretty sure this will fix my problem.