Showing posts with label RJ11. Show all posts
Showing posts with label RJ11. Show all posts

Saturday, March 22, 2014

TTL to I2C

Since I'm using 5 volts as the standard I2C bus voltage, I need a way to translate from the 3.3 volts the MCU uses to the 5 volts the I2C bus uses. The interface needs to be bidirectional without having any switching since either the 5 volt side or the 3.3 volt side can pull the bus low. And there is no way to tell in advance which side might want to do that so a bus translator like the 74LVC2T45 will not work. I did try the the P82B96, but, despite being a very popular chip it latched up on me. Some manufacturers allude to this when they tout "no latch up" at the top of their data sheets for I2C bus voltage level translators. NXP describes how to do it with N channel MOSFET transistors in their application note AN10441. The circuit described there is what we would have called in the old days a grounded grid circuit. Today we call it grounded gate. The gate is grounded for AC despite the 3.3volt bias on it because the 3.3 volts comes from a power supply which is heavily filtered to eliminate any AC voltage on the supply. Despite being low cost I decided not to use this method because low cost transistors commonly come in an SOT23 package (which is big enough so that I can actually hand solder it). But the SOT23 package takes up a fair amount of board area by today's standards.

So I settled on the NVT2002 chip which looks like it has two transistors in the package along with disconnect circuitry which prevents translator operation if both sides of the bus aren't powered. Because the transistors are basically pass through devices they don't add much bus delay (on the order of nano seconds or less). And just to cap off the sweetness they cost a lot less than the P82B96.

To make life easier for I2C bus users I put 3 of our standard RJ11 I2C bus jacks on the board, so that if you are using 3 or fewer devices on the bus you don't need to buy doublers or triplers to daisy chain bus devices. Although you would have to use them if your bus is long in order to keep your bus capacitance below the specified maximum.

Bare boards for the I2C bus adapter are available from OSH Park for $5.15. You can find the documentation for the board (schematic, parts list, and parts layout) here.

You have a choice of powering the I2C bus with the power supply providing power to the MCU board or if your bus peripherals use a lot of 5V power you can give the TTL to I2C adapter its own power supply so as to avoid dragging down the 5 volts supplying the MCU board.

Engineering is the art of making what you want from what you can get at a profit.

Thursday, March 28, 2013

Testing Telephone Cables With RJ11 Connectors


I'm working on a distributed I2C bus system that uses standard telephone cable and RJ11 jacks for interconnection. Plug and play - if you get the software right. That requires cables that are correctly wired. No shorts of course. But also no twists. Five volts should not appear on the ground connection. And vice versa. To do the testing I have designed a board with three resistors and six LEDs. I use a six volt battery pack of 4 AA cells with a built in switch to power the tester. The batteries should be good for about 120 hours of continuous use. If the cost of batteries irks you the tester can be powered by a 5V wall wart supply. Or a convenient bench supply. The voltage is not critical. Anything from about 4 volts to 6 volts will do. Absolute maximum current possible is about 35 mA at 6 volts. Normal current with a working cable plugged in and a 6 volt supply is about 25 mA.

In use the supply polarity doesn't matter. If you use the supply conventions shown the green power good light comes on with power and if the cable is good you get two green lights in addition. If the cable is reversed you get a green power good light and two red lights. If you reverse the power supply red will be the power good light and two additional red lights will indicate a good cable. Various other faults will give you different light combinations which you can work out from the schematic. You will also find the parts placement and parts list with the schematic.

The only thing that needs special attention during assembly is LED orientation. I used a 5V supply and some clip leads along with two 150 ohm resistors (one for each clip lead) to probe the LEDs before mounting them.

The boards (I2C Simplest Cable Tester 31 Oct 2012) are available from OSH Park for $2.45 each plus shipping.