Bidirectional level converter

I want to connect a Wii nunchuck to my Arduino. Since the Arduino is running at 5V, and the nunchuck at 3.3V, I think I need to convert the SDA/SCL levels. Stepping them down to 3.3V should be relatively straightforward (voltage divider), but how do I make this bidirectional?

I have seen bus transceivers such as the SN74LVC245A, which would do the job, but seem to rely on being told which direction to do the conversion in. Is this normal? Presumably in my case, I'd tell it A->B for sending, and B->A for receiving, but taking that approach I'd lose another pin. Is there a better component/schematic for doing this?

http://www.sparkfun.com/commerce/product_info.php?products_id=8745

This application note tells you how to do it:- http://www.nxp.com/acrobat_download2/applicationnotes/AN97055.pdf

Since it has labelled inputs and outputs, I rather assumed it wasn't bidirectional....

I2C has a bi-directional data line otherwise how can you read and write?

Grumpy Mike

Thanks for that. It tells me how to do just what I want.

Sorry, crossed posts.

Mike: Yes, of course I2C is bidirectional, but my original response was that I understood the SFE product not to be, as it has clearly labelled “input” and “output” pins.

Similarly, I follow that the app note you pointed out does what I need :slight_smile:

Thanks again, apologies for any confusion.

but my original response was that I understood the SFE product not to be, as it has clearly labelled "input" and "output" pins.

But that sparkfun product will not do what you need, it is simply a logic level converter and as you point out you need more than this on an I2C device.

Can't seem to see your original response just the original post that makes no mention of it.

Mike

My first response was to fdufnews, pointing out the SFE board wasn't bidirectional. You haven't posted anything I disagreed with or misunderstood (so I must be learning...).

I'm grateful (as ever) for your sage advice, and will go away and shut up now, as I understand the answer to my original question. :-[

http://www.nxp.com/acrobat_download2/applicationnotes/AN97055.pdf

Link is 404 :(

Try this one:- http://www.nxp.com/documents/application_note/AN10441.pdf

Or google:- I2C level shifter

Sweet, thanks Mike :)

My first response was to fdufnews, pointing out the SFE board wasn't bidirectional.

The board is bidirectionnal. You should look at the schematic of SFE board. 2 of the channels on the board are the exact application of NXP application note.

Ah. Aren't there 4 channels, though? So I'd be 50% right :)

Aren’t there 4 channels, though?

Looks like 2 per direction. And again that wont make it ‘full-duplex’.

Will probably be easier to just redo the circuit from the app note.

No no the 2 channels with FET transistors are bidirectionnal. They are implemented the way NXP describe it in their application note. So can be used for an I²C bus

No no the 2 channels with FET transistors are bidirectionnal.

I think I understand why now. But that would make it 4 channel correct?

I think the TX/RX labels make the PCB confusing.

There are four channels on the board but two of them are just voltage dividers and the two others are active one (with FET).

or you can try one of these... http://focus.ti.com/lit/ds/symlink/txs0102.pdf

The hardware I2C lines are supposed to be open-drain in I2C mode - so why not use a version of the Wire library that refrains from turning on the internal pull-ups, and use external 3.3v pullups?