Comments on: Arduino and the Two-Wire Interface (TWI/I2C) Including A Short Didactic Parenthetical On Making TWI Work On An Arduino Mini https://blog.nearfuturelaboratory.com/2007/01/11/arduino-and-twi/ Clarify Today, Design Tomorrow Fri, 18 Aug 2017 18:03:03 +0000 hourly 1 https://wordpress.org/?v=5.5.1 By: Julian https://blog.nearfuturelaboratory.com/2007/01/11/arduino-and-twi/#comment-165 Wed, 18 Dec 2013 04:23:51 +0000 http://diversifiedcuriosities.com/2007/01/11/arduino-and-twi/#comment-165 In reply to Mark.

Yep.

]]>
By: Mark https://blog.nearfuturelaboratory.com/2007/01/11/arduino-and-twi/#comment-164 Mon, 16 Dec 2013 12:02:56 +0000 http://diversifiedcuriosities.com/2007/01/11/arduino-and-twi/#comment-164 In reply to Henry.

Hi Julian,
i’ve started using AD7150 but finding hard to interface with Arduino
Do i ve to work on the register of AD7150

]]>
By: Lars Jansen » Huge index of Arduino & Freeduino Knowledge https://blog.nearfuturelaboratory.com/2007/01/11/arduino-and-twi/#comment-163 Tue, 02 Apr 2013 10:01:50 +0000 http://diversifiedcuriosities.com/2007/01/11/arduino-and-twi/#comment-163 […] I2C: even more on making I2C work with Arduino […]

]]>
By: 3dotter https://blog.nearfuturelaboratory.com/2007/01/11/arduino-and-twi/#comment-162 Fri, 03 Jun 2011 10:24:11 +0000 http://diversifiedcuriosities.com/2007/01/11/arduino-and-twi/#comment-162 I am looking for a similar i2c connection from a teensy (arduino based at90usb162 or atmega32u2 mcu) to a uBlox GPS receiver (NEO 5Q). Does anyone has experience with that? Or know about a tutorial/example code?

]]>
By: Grok Think » Blog Archive » I2C data logging chip. https://blog.nearfuturelaboratory.com/2007/01/11/arduino-and-twi/#comment-161 Sun, 04 Jul 2010 09:45:44 +0000 http://diversifiedcuriosities.com/2007/01/11/arduino-and-twi/#comment-161 […] Near Future Laboratory » Blog Archive » Arduino and the Two-Wire Interface (TWI/I2C) Including A S… […]

]]>
By: Julian https://blog.nearfuturelaboratory.com/2007/01/11/arduino-and-twi/#comment-160 Thu, 11 Mar 2010 05:33:10 +0000 http://diversifiedcuriosities.com/2007/01/11/arduino-and-twi/#comment-160 In reply to Shep.

That’s a bit shift operator — left shift.

http://www.lix.polytechnique.fr/~liberti/public/computing/prog/c/C/CONCEPT/bit_shift.html#shift

Since x_val is a 16 bit variable and it comes out in two pieces (x_val_h and x_val_l, which are each 8 bits) to assemble the full 16 bit variable x_val, we need to sort of cobble it together. First, taking x_val_h and putting it in x_val, so that x_val contains x_val_h in its lower 8 bits. Then, left shift x_val by 8 bits, so x_val_h is now effectively in the high 8 bits of x_val. Then, just adding x_val_l to x_val basically puts x_val_l in the lower 8 bits and the assembly of x_val is done: x_val_h is in the high 8 bits (from 15-8) and x_val_l is in the low 8 bits (from 0-7).

]]>
By: Shep https://blog.nearfuturelaboratory.com/2007/01/11/arduino-and-twi/#comment-159 Wed, 10 Mar 2010 21:16:29 +0000 http://diversifiedcuriosities.com/2007/01/11/arduino-and-twi/#comment-159 Hey Julian,

Thanks for posting your experience with the TWI, it definitely helps towards understanding it better. The one thing I don’t recognize in your code are these lines:

x_val = x_val_h;
x_val <<= 8;
x_val += x_val_l;

Specifically, what the "<<=" operator does and how you're using it. Thanks again for the great example.

]]>
By: Julian https://blog.nearfuturelaboratory.com/2007/01/11/arduino-and-twi/#comment-158 Thu, 28 Jan 2010 19:07:42 +0000 http://diversifiedcuriosities.com/2007/01/11/arduino-and-twi/#comment-158 In reply to david Familian.

Thanks David — good stuff. Sometimes its these sorts of things that trip me up!

]]>
By: david Familian https://blog.nearfuturelaboratory.com/2007/01/11/arduino-and-twi/#comment-157 Thu, 28 Jan 2010 15:49:04 +0000 http://diversifiedcuriosities.com/2007/01/11/arduino-and-twi/#comment-157 hi all

in all my research on the LIS3LV02DQ for twi/i2c no one mentions that the default for the LIS3LV02DQ is 4 wire. so you have to change this.

there are 3 registers that have a 8 preferences each. you control the on/off by sending this Wire.send(B11010010); the comments list the presences for CTRL_REG2 in order

Wire.begin(); // join i2c bus (address optional for master)
Wire.beginTransmission(0x1D);
Wire.send(0x21); // // CTRL_REG2 (21h)
Wire.send(B11010010);

// B11010010 corresponds to the seetings for below
//FS bit is used to select Full Scale value. default = 1
//BDU bit is used to inhibit output registers update default = 1
//BLE bit is used to select Big Endian or Little Endiandefault = 0
//BOOT bit is used to refresh the content of internal registers default = 1
//IEN bit is used to switch the value present on data-ready pad default = 0
//DRDY bit is used to enable Data-Ready (RDY/INT) default = 0
//SPI 4/3 wire SIM is ‘0’ (default value) the 4-wire SIM is ‘1’ the 3-wire TWI (I2C)
//DAS bit permits to decide between 12 bit right justified and 16 bit default = 0

]]>
By: Electronic improvements « NEar Space LABoratory https://blog.nearfuturelaboratory.com/2007/01/11/arduino-and-twi/#comment-156 Wed, 22 Jul 2009 19:14:56 +0000 http://diversifiedcuriosities.com/2007/01/11/arduino-and-twi/#comment-156 […] that are in the internet, specially with the ITP Sensor Workshop (magnetic sensor) and the Near Future Laboratory […]

]]>