<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>i2c protocol</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/39232/i2c-protocol</link><description> 
 hi sir/madam, 

 
 i working i2c protocol by using two port pins.after writing
data ack is not getting please help me.when write mode first send
start condition and then slave address and then write bit is 0 after
that ack is not getting what is the</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: i2c protocol</title><link>https://community.arm.com/thread/104749?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2011 05:55:57 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6b11f55c-c81e-4925-ba94-1d1edc41f43d</guid><dc:creator>&amp;#178;erik malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
... the messiest code this month.&lt;/p&gt;

&lt;p&gt;
if you want help, post CLEAR code and do not forget to verify in
preview that it is CLEAR before you post.&lt;/p&gt;

&lt;p&gt;
I doubt anyone has an inkling to try to figure out the mess you
posted.&lt;/p&gt;

&lt;p&gt;
you also missed &amp;quot;Place source code source code between ......&amp;quot;
above the posting window&lt;/p&gt;

&lt;p&gt;
Erik&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c protocol</title><link>https://community.arm.com/thread/126779?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2011 05:18:42 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2199e397-d759-43dc-b50a-7ae1fd6089b1</guid><dc:creator>IB Shy</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;no these pins only for i2c.&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Welcome to the Keil comedy show.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c protocol</title><link>https://community.arm.com/thread/116318?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2011 05:07:46 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2f83cb94-88d2-4557-8c9d-dfe91f078398</guid><dc:creator>satish bankapalli</dc:creator><description>&lt;p&gt;&lt;p&gt;
i am able communicate eprom.but i can&amp;#39;t able to communicate rtc
(DS1307),&lt;br /&gt;
can please help me.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c protocol</title><link>https://community.arm.com/thread/116317?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2011 05:02:29 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2bed15d8-a289-4a67-804e-09add92f3cc8</guid><dc:creator>satish bankapalli</dc:creator><description>&lt;p&gt;&lt;p&gt;
no these pins only for i2c.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c protocol</title><link>https://community.arm.com/thread/102434?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2011 04:58:01 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:808cc6a0-6236-4cf9-aacb-35a54fb27860</guid><dc:creator>IB Shy</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;i working i2c protocol by using two port pins.&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Come to think of it ... are the two port pins connected to
anything ... maybe some sort of processor?&lt;/p&gt;

&lt;p&gt;
I&amp;#39;m blinded by the lack of information!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c protocol</title><link>https://community.arm.com/thread/79203?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2011 04:57:54 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f466dd44-a0c0-46ed-b914-750255086133</guid><dc:creator>satish bankapalli</dc:creator><description>&lt;p&gt;&lt;p&gt;
can please refer the below code&lt;/p&gt;

&lt;p&gt;
void i2c_start_cond(void)&lt;br /&gt;
{ SDA = 1; SCL_delay(); SCL = 1;&lt;br /&gt;
// SCL_delay(); I2CDELAY(I2CSPEED &amp;gt;&amp;gt; 2); SDA = 0;&lt;br /&gt;
} void i2c_stop_cond(void)&lt;br /&gt;
{ SCL = 0; SCL_delay(); SDA = 0; SCL_delay(); SCL = 1;&lt;br /&gt;
// SCL_delay(); I2CDELAY(I2CSPEED &amp;gt;&amp;gt; 2); SDA = 1;&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;
/* Write a bit to I2C bus */&lt;br /&gt;
void i2c_write_bit(unsigned bit)&lt;br /&gt;
{ SCL_delay(); SCL = 0; if (bit) SDA = 1; else SDA = 0;&lt;br /&gt;
// SCL_delay(); I2CDELAY(I2CSPEED &amp;gt;&amp;gt; 2); SCL = 1; SCL_delay();
SCL = 0;&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;
/* Read a bit from I2C bus */&lt;br /&gt;
unsigned i2c_read_bit(void)&lt;br /&gt;
{ unsigned bit; SCL_delay(); SCL = 1; bit = SDA; SCL_delay();
I2CDELAY(I2CSPEED &amp;gt;&amp;gt; 2); SCL = 0; return bit;&lt;br /&gt;
} /* Read a bit from I2C bus */&lt;br /&gt;
unsigned i2c_read_ack_bit(void)&lt;br /&gt;
{ unsigned char byte1; unsigned bit; SCL_delay(); SCL = 1; bit = SDA;
SCL_delay(); SCL = 0; return bit;&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;
/* Write a byte to I2C bus. Return 0 if ack by the slave */&lt;br /&gt;
unsigned i2c_write_byte(int send_start, int send_stop, unsigned char
byte)&lt;br /&gt;
{ unsigned bit; unsigned nack; if (send_start) { i2c_start_cond(); }
for (bit = 0; bit &amp;lt; 8; bit++) { i2c_write_bit(byte &amp;amp; 0x80);
byte &amp;lt;&amp;lt;= 1; } nack = i2c_read_ack_bit(); if (send_stop) {
i2c_stop_cond(); } return nack;&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;
/* Read a byte from I2C bus */&lt;br /&gt;
unsigned char i2c_read_byte(int nak, int send_stop)&lt;br /&gt;
{ unsigned char byte = 0; unsigned bit; pd3_4 = 0; for (bit = 0; bit
&amp;lt; 8; bit++) { byte &amp;lt;&amp;lt;= 1; byte |= i2c_read_bit(); } pd3_4 =
1; i2c_write_bit(nak); if (send_stop) { i2c_stop_cond(); } return
byte;&lt;br /&gt;
}&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c protocol</title><link>https://community.arm.com/thread/79202?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2011 04:54:37 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2df8e548-6cd5-486b-b6a0-d0aad0a4dee7</guid><dc:creator>satish bankapalli</dc:creator><description>&lt;p&gt;&lt;p&gt;
in read mode only getting FF only .&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c protocol</title><link>https://community.arm.com/thread/59337?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2011 04:53:42 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ebd9c03c-82eb-4fc4-8e93-3b705c183ba8</guid><dc:creator>Tamiryan Michael</dc:creator><description>&lt;p&gt;&lt;p&gt;
Is your i2c peripheral even powered up? Is it configured? Is your
clock signal to the device within spec. for that device, etc. etc.
etc. ?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c protocol</title><link>https://community.arm.com/thread/59334?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2011 04:48:05 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b36705fd-b5f2-4e6b-82c5-433ce694577d</guid><dc:creator>IB Shy</dc:creator><description>&lt;p&gt;&lt;p&gt;
Have you got anything connected to the other end of the bus?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>