<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Arduino I2C Expansion I/O</title>
	<atom:link href="http://www.neufeld.newton.ks.us/electronics/?feed=rss2&#038;p=241" rel="self" type="application/rss+xml" />
	<link>http://www.neufeld.newton.ks.us/electronics/?p=241</link>
	<description></description>
	<lastBuildDate>Sun, 08 Dec 2024 17:19:24 -0600</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>By: ARUL</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=241&#038;cpage=3#comment-32279</link>
		<dc:creator>ARUL</dc:creator>
		<pubDate>Fri, 05 Jun 2015 06:43:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=241#comment-32279</guid>
		<description>hi i have one question. 
how to write a data  continuously  for i2c,in  arduino uno : 
here my code: this code is interfacing a  dac to arduino using  i2c protocol 
#include     
#include 
#define disk1 0xc0&gt;&gt;1 //Address of 24aa32a eeprom chip
//#define sda A4
//#define scl A5
char incomingByte;
unsigned int integerValue=4000;
void writeEEPROM(int deviceaddress, unsigned int eeaddress,unsigned int  data ) 
{
          
  Wire.beginTransmission(deviceaddress);
  Wire.write((int)(eeaddress &gt;&gt; 8));   // MSB
  Wire.write((int)(eeaddress &amp; 0xFF)); // LSB
   Wire.write((int)(data &gt;&gt; 8));   // MSB
  Wire.write((int)(data &amp; 0xFF));
    Wire.endTransmission();
      }

 void setup(void)
{
     unsigned int address = 0;
    Serial.begin(9600);
  Wire.begin(); 

}
 
void loop(){
  
    unsigned int address = 0;
   if (Serial.available()) {   
    integerValue = 0;        
    while(1) {          
      incomingByte = Serial.read(); // char
      if (incomingByte == &#039;\ &#039;) break;  
      if (incomingByte == -1) continue; 
      integerValue *= 10;  // shift left 1 decimal place
      // convert ASCII to integer, add, and shift left 1 decimal place
      integerValue = ((incomingByte - 48) + integerValue);
    }
   }
    Serial.println(integerValue);   // Do something with the value
    delay(500);
   writeEEPROM(disk1, address, integerValue);
   
   }

OUTPUT: DIGITAL VAL=4000, MY VOLT =4.8V  THE I2C IS WORKING FOLLOWING MANOR: S C0 A 00 A 00 A F0 A 11 A P    

     THIS CODE IS USED TO DAC. THIS WORKING PREFECT IN ONE TIME. that means the data write once in dac the dac provide equal volt. and next time arduino send stop bit the communication stopped here.MY AIM THE DIGITAL VALUE IS PROVIDE BY USING SERIAL SO I NEED WRITE DATA CONTINUES PLEASE ANY ONE HELP ME.   
     I WILL TRY ANOTHER METHOD for repeated start  BY REPLACING THE LINE IN ABOVE CODE, THIS SEND DATA CONTINUES BUT  IN THE DAC  do not produce OUTPUT VOLTAGE. THIS MY PROBLEM.
 THE CHANGES IS :Wire.endTransmission(false);
      the output is:S SR C0 A 00 A 00 A F0 A 11 A SR C0 A 00 A 00 A F0 A 11 A ....... TO FOLLOW THIS MANOR. PLEASE any one  HELP ME  AM WAIT U R REPLY THANK YOU</description>
		<content:encoded><![CDATA[<p>hi i have one question.<br />
how to write a data  continuously  for i2c,in  arduino uno :<br />
here my code: this code is interfacing a  dac to arduino using  i2c protocol<br />
#include<br />
#include<br />
#define disk1 0xc0&gt;&gt;1 //Address of 24aa32a eeprom chip<br />
//#define sda A4<br />
//#define scl A5<br />
char incomingByte;<br />
unsigned int integerValue=4000;<br />
void writeEEPROM(int deviceaddress, unsigned int eeaddress,unsigned int  data )<br />
{</p>
<p>  Wire.beginTransmission(deviceaddress);<br />
  Wire.write((int)(eeaddress &gt;&gt; 8));   // MSB<br />
  Wire.write((int)(eeaddress &amp; 0xFF)); // LSB<br />
   Wire.write((int)(data &gt;&gt; 8));   // MSB<br />
  Wire.write((int)(data &amp; 0xFF));<br />
    Wire.endTransmission();<br />
      }</p>
<p> void setup(void)<br />
{<br />
     unsigned int address = 0;<br />
    Serial.begin(9600);<br />
  Wire.begin(); </p>
<p>}</p>
<p>void loop(){</p>
<p>    unsigned int address = 0;<br />
   if (Serial.available()) {<br />
    integerValue = 0;<br />
    while(1) {<br />
      incomingByte = Serial.read(); // char<br />
      if (incomingByte == &#8216;\ &#8216;) break;<br />
      if (incomingByte == -1) continue;<br />
      integerValue *= 10;  // shift left 1 decimal place<br />
      // convert ASCII to integer, add, and shift left 1 decimal place<br />
      integerValue = ((incomingByte &#8211; 48) + integerValue);<br />
    }<br />
   }<br />
    Serial.println(integerValue);   // Do something with the value<br />
    delay(500);<br />
   writeEEPROM(disk1, address, integerValue);</p>
<p>   }</p>
<p>OUTPUT: DIGITAL VAL=4000, MY VOLT =4.8V  THE I2C IS WORKING FOLLOWING MANOR: S C0 A 00 A 00 A F0 A 11 A P    </p>
<p>     THIS CODE IS USED TO DAC. THIS WORKING PREFECT IN ONE TIME. that means the data write once in dac the dac provide equal volt. and next time arduino send stop bit the communication stopped here.MY AIM THE DIGITAL VALUE IS PROVIDE BY USING SERIAL SO I NEED WRITE DATA CONTINUES PLEASE ANY ONE HELP ME.<br />
     I WILL TRY ANOTHER METHOD for repeated start  BY REPLACING THE LINE IN ABOVE CODE, THIS SEND DATA CONTINUES BUT  IN THE DAC  do not produce OUTPUT VOLTAGE. THIS MY PROBLEM.<br />
 THE CHANGES IS :Wire.endTransmission(false);<br />
      the output is:S SR C0 A 00 A 00 A F0 A 11 A SR C0 A 00 A 00 A F0 A 11 A &#8230;&#8230;. TO FOLLOW THIS MANOR. PLEASE any one  HELP ME  AM WAIT U R REPLY THANK YOU</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gregg</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=241&#038;cpage=3#comment-31910</link>
		<dc:creator>Gregg</dc:creator>
		<pubDate>Mon, 22 Sep 2014 14:17:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=241#comment-31910</guid>
		<description>Correct. I just found the part number in their database for data sheets. Looks interesting but using it isn&#039;t possible. I&#039;m largely a through hole builder. I&#039;ve used SMT stuff sparingly...

And about the unique DS1620 it is indeed like that. I recall using one with the BASIC Stamp.

The DS620 doesn&#039;t use the I2C standard of course.  It uses something completely different. Naturally the website does describe how the protocol methods and the ways to make it work.</description>
		<content:encoded><![CDATA[<p>Correct. I just found the part number in their database for data sheets. Looks interesting but using it isn&#8217;t possible. I&#8217;m largely a through hole builder. I&#8217;ve used SMT stuff sparingly&#8230;</p>
<p>And about the unique DS1620 it is indeed like that. I recall using one with the BASIC Stamp.</p>
<p>The DS620 doesn&#8217;t use the I2C standard of course.  It uses something completely different. Naturally the website does describe how the protocol methods and the ways to make it work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pim Veld</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=241&#038;cpage=3#comment-31909</link>
		<dc:creator>Pim Veld</dc:creator>
		<pubDate>Mon, 22 Sep 2014 11:18:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=241#comment-31909</guid>
		<description>To Ahmad and Greg: As the Dallas-Maxim DS1620, the DS620 is also a Digital Thermometer and Thermostat. The DS620 communicates via a 2-wire bus with a protocol that looks identical to I2C. The DS1620 communicates via a 3-wire bus which is not compatibel with I2C nor SPI, but can easily be handled by &#039;bit-banging&#039;.</description>
		<content:encoded><![CDATA[<p>To Ahmad and Greg: As the Dallas-Maxim DS1620, the DS620 is also a Digital Thermometer and Thermostat. The DS620 communicates via a 2-wire bus with a protocol that looks identical to I2C. The DS1620 communicates via a 3-wire bus which is not compatibel with I2C nor SPI, but can easily be handled by &#8216;bit-banging&#8217;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gregg</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=241&#038;cpage=3#comment-31908</link>
		<dc:creator>Gregg</dc:creator>
		<pubDate>Mon, 22 Sep 2014 02:38:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=241#comment-31908</guid>
		<description>Oh and their temp sensors are One-Wire devices, the DS1820 for example who are supported directly on the Arduino, after a fashion.</description>
		<content:encoded><![CDATA[<p>Oh and their temp sensors are One-Wire devices, the DS1820 for example who are supported directly on the Arduino, after a fashion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gregg</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=241&#038;cpage=3#comment-31907</link>
		<dc:creator>Gregg</dc:creator>
		<pubDate>Mon, 22 Sep 2014 02:37:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=241#comment-31907</guid>
		<description>Actually it is DS1620 not DS620, and the DS1620 uses a non-standard two wire communications method with a clock added that is similar to SPI so you&#039;re not going to be able to use I2C methods with it.</description>
		<content:encoded><![CDATA[<p>Actually it is DS1620 not DS620, and the DS1620 uses a non-standard two wire communications method with a clock added that is similar to SPI so you&#8217;re not going to be able to use I2C methods with it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith Neufeld</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=241&#038;cpage=3#comment-31896</link>
		<dc:creator>Keith Neufeld</dc:creator>
		<pubDate>Fri, 19 Sep 2014 19:02:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=241#comment-31896</guid>
		<description>Waaaay back when I learned C, I was taught to put defensive parentheses around macro arguments, as macros are expanded syntactically by the preprocessor, not semantically by the compiler.

By way of example:

&lt;code&gt;#define mult(X,Y) X * Y
...
a = mult(b+5, c+3);&lt;/code&gt;

expands into

&lt;code&gt;a = b+5 * c+3;&lt;/code&gt;

which is (with a change in whitespace to show order of operations)

&lt;code&gt;a = b + 5*c + 3;&lt;/code&gt;

which is unlikely to be what was intended.  So I &lt;em&gt;always&lt;/em&gt; parenthesize macro arguments in &lt;code&gt;#define&lt;/code&gt;s.</description>
		<content:encoded><![CDATA[<p>Waaaay back when I learned C, I was taught to put defensive parentheses around macro arguments, as macros are expanded syntactically by the preprocessor, not semantically by the compiler.</p>
<p>By way of example:</p>
<p><code>#define mult(X,Y) X * Y<br />
...<br />
a = mult(b+5, c+3);</code></p>
<p>expands into</p>
<p><code>a = b+5 * c+3;</code></p>
<p>which is (with a change in whitespace to show order of operations)</p>
<p><code>a = b + 5*c + 3;</code></p>
<p>which is unlikely to be what was intended.  So I <em>always</em> parenthesize macro arguments in <code>#define</code>s.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pim Veld</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=241&#038;cpage=3#comment-31877</link>
		<dc:creator>Pim Veld</dc:creator>
		<pubDate>Mon, 08 Sep 2014 11:44:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=241#comment-31877</guid>
		<description>Keith, could you please explain in a bit more detail what de parenthesis do in the #define declaration? I know that normally the preprocessor simply replaces the first string by the second string.

Further I have implemented a couple of I2C-functions to controll an absolute barometer, an ad-converter and a high side current/power monitor without using the wire-library. My functions use &quot;bit-banging&quot;. This way you have more controll and smaller code. Probably at the expense of speed, but with most I2C-projects speed is not of the utmost importancy.

Thanks in advance,  Pim.</description>
		<content:encoded><![CDATA[<p>Keith, could you please explain in a bit more detail what de parenthesis do in the #define declaration? I know that normally the preprocessor simply replaces the first string by the second string.</p>
<p>Further I have implemented a couple of I2C-functions to controll an absolute barometer, an ad-converter and a high side current/power monitor without using the wire-library. My functions use &#8220;bit-banging&#8221;. This way you have more controll and smaller code. Probably at the expense of speed, but with most I2C-projects speed is not of the utmost importancy.</p>
<p>Thanks in advance,  Pim.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ahmad</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=241&#038;cpage=3#comment-31739</link>
		<dc:creator>Ahmad</dc:creator>
		<pubDate>Sat, 12 Apr 2014 00:35:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=241#comment-31739</guid>
		<description>Dear Keith,
Thank you for a very interesting and helpful site.
I am trying to use Arduino to read temperature sensor DS620.
I am unable to get temperature data.
Hope you could give guidance in this or provide code for Arduino to read DS620 using Arduino wire library.
Thank you.
Ahmad.</description>
		<content:encoded><![CDATA[<p>Dear Keith,<br />
Thank you for a very interesting and helpful site.<br />
I am trying to use Arduino to read temperature sensor DS620.<br />
I am unable to get temperature data.<br />
Hope you could give guidance in this or provide code for Arduino to read DS620 using Arduino wire library.<br />
Thank you.<br />
Ahmad.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith Neufeld</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=241&#038;cpage=3#comment-30059</link>
		<dc:creator>Keith Neufeld</dc:creator>
		<pubDate>Thu, 21 Jun 2012 21:01:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=241#comment-30059</guid>
		<description>Vance, I &lt;em&gt;suspect&lt;/em&gt; you could use the Arduino&#039;s Wire library, but I&#039;d have to try it myself with this device to be sure.  Give it a shot and come back and let us know whether you got it to work?</description>
		<content:encoded><![CDATA[<p>Vance, I <em>suspect</em> you could use the Arduino&#8217;s Wire library, but I&#8217;d have to try it myself with this device to be sure.  Give it a shot and come back and let us know whether you got it to work?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vance</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=241&#038;cpage=3#comment-30057</link>
		<dc:creator>Vance</dc:creator>
		<pubDate>Tue, 19 Jun 2012 18:01:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=241#comment-30057</guid>
		<description>hy keith,

i&#039;ve a generall question, i&#039;ve order this device:
http://www.dorji.com/pro/sensor-module/Compass_pressure_sensor.html

and i wonder now if a arduino can handle the command sequence
they put a example program for a pic u-processor online and im not quite sure 
if i can handle this with the wire commands

as example - when i understand that minimalistic datasheet right, i&#039;ve to wakup the device and im not quite sure if the timing of the &quot;data read&quot; is possible with the wire library

as example a code snipped how its programmend for the pic u-processor:


unsigned char IIC_ReadByte(void)
{
unsigned char ucValue;
unsigned char ucIndex;
ucValue = 0;
DATA_SET = DATA_INPUT;
SysDelay(DELAY100US);
for ( ucIndex = 0; ucIndex &lt; 8; ucIndex++ )
{
ucValue &lt;&lt;= 1;
IIC_SCL_LOW();
SysDelay(DELAY100US);

IIC_SCL_HIGH();
SysDelay(DELAY100US);
if(DATA)
ucValue &#124;= 1;
SysDelay(DELAY100US);
IIC_SCL_LOW();
SysDelay(DELAY100US);
}
return ucValue;
}

they predefinded  #defines are trivial and realy mean mostly 0 or 1

are u used to the wire library and how its programmed so could you tell me if its possible in generall to use this device with arduino and his wire library or do i have to go deeper into that topic and programm my own &quot;wire-library&quot;  ?

would be great if you could help me 

thx 
vance</description>
		<content:encoded><![CDATA[<p>hy keith,</p>
<p>i&#8217;ve a generall question, i&#8217;ve order this device:<br />
<a href="http://www.dorji.com/pro/sensor-module/Compass_pressure_sensor.html" rel="nofollow">http://www.dorji.com/pro/sensor-module/Compass_pressure_sensor.html</a></p>
<p>and i wonder now if a arduino can handle the command sequence<br />
they put a example program for a pic u-processor online and im not quite sure<br />
if i can handle this with the wire commands</p>
<p>as example &#8211; when i understand that minimalistic datasheet right, i&#8217;ve to wakup the device and im not quite sure if the timing of the &#8220;data read&#8221; is possible with the wire library</p>
<p>as example a code snipped how its programmend for the pic u-processor:</p>
<p>unsigned char IIC_ReadByte(void)<br />
{<br />
unsigned char ucValue;<br />
unsigned char ucIndex;<br />
ucValue = 0;<br />
DATA_SET = DATA_INPUT;<br />
SysDelay(DELAY100US);<br />
for ( ucIndex = 0; ucIndex &lt; 8; ucIndex++ )<br />
{<br />
ucValue &lt;&lt;= 1;<br />
IIC_SCL_LOW();<br />
SysDelay(DELAY100US);</p>
<p>IIC_SCL_HIGH();<br />
SysDelay(DELAY100US);<br />
if(DATA)<br />
ucValue |= 1;<br />
SysDelay(DELAY100US);<br />
IIC_SCL_LOW();<br />
SysDelay(DELAY100US);<br />
}<br />
return ucValue;<br />
}</p>
<p>they predefinded  #defines are trivial and realy mean mostly 0 or 1</p>
<p>are u used to the wire library and how its programmed so could you tell me if its possible in generall to use this device with arduino and his wire library or do i have to go deeper into that topic and programm my own &quot;wire-library&quot;  ?</p>
<p>would be great if you could help me </p>
<p>thx<br />
vance</p>
]]></content:encoded>
	</item>
</channel>
</rss>
