Accelerometer help with 18X and I2C

sunburnt63

New Member
I am trying to communicate with an accelerometer that has I2C connections, so I am using the 18X picaxe. Is it a problem that the accelerometer has voltage rails of 3V and 0V, whereas the picaxe has 5V and 0V? Will I be able to use the two with one another, and if so, can you help shed some light on the situation. Thank you so much.
 

kewakl

Senior Member
Texas Instruments PCA9306 I2C bus translator

there surely are others, but this is the one from the latest Jeff Bachiochi 'From the Bench' column in Circuit Cellar mag
 

hippy

Ex-Staff (retired)
The easiest solution is to use a PICAXE which can operate at the same voltage ( probably 3V3 rather than 3V ) thus removing the need for any level convertors.

The 18X has an official minimum operating voltage of 4V but people do have success running it at 3V3, though that's not guaranteed. It would be recommended to program the 18X ( on another board ) with a 5V supply powering it.
 

westaust55

Moderator
Very simple to operate some devices at 5V and others at 3/3.3V on the same i2c bus.

Just use two FET's one in each of the i2c data and clock lines.

There is a Philips paper on the topic (which I have made reference to previously here) and from memory there is a Sparkfun module using FETs to achieve the voltage shift/translation.

Have a read of this thread on shifting
http://www.picaxeforum.co.uk/showthread.php?t=13347
and a search for the Philips app note AN97055


found - so also look at:
http://www.sparkfun.com/datasheets/BreakoutBoards/Level-Converter-v10.pdf
http://www.sparkfun.com/commerce/product_info.php?products_id=8745
 
Last edited:

benryves

Senior Member
You could try using 3V zener diodes to keep the lines at a safe level, without resorting to full-blown level converters - I've used a similar system to interface a 5V microcontroller to USB's 3.6V data lines. As I²C is only driven low (floating high) you may be able to get away with a single diode to regulate the 3V to power the I²C part, connecting the I²C pull-up resistors to this regulated line.
 

westaust55

Moderator
Using FETs for i2c level changing

You could try using 3V zener diodes to keep the lines at a safe level, without resorting to full-blown level converters - I've used a similar system to interface a 5V microcontroller to USB's 3.6V data lines. As I²C is only driven low (floating high) you may be able to get away with a single diode to regulate the 3V to power the I²C part, connecting the I²C pull-up resistors to this regulated line.
The use of a simple zener circuit and holding the i2c lines to 3.3 Volts will cause problems when the PICAXE is operating at 5Vdc.

Looking for example at the datasheet for PIC micro used for the 18X, the i2c pins use TTL logic levels for “normal input functions, but have Schmidt Trigger (ST) inputs for the i2c and SPI hardware comms on both the data and clock lines. See attached extract.

The Schmidt Trigger inputs do not recognise a signal as “high” until it has reached 0.8 * Vdd = 0.8 * 4 = 4Vdc – so clamping the PICAXE i2c lines to 3.3V does not meet the PICmicro specs.



Just checked more datasheets and:
-RC3/RC4 pins for i2c comms on the 28X1 and 40X1 also incorporate ST input buffers.
-RC3/RC4 pins for i2c comms on the 28X2 and 40X2 also incorporate ST input buffers.

I recommend consider the two FET approach which I have used successfully with 2N7000 FET’s as mentioned in post 5 above.
 

Attachments

Last edited:
Top