<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/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/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>I2C how to check device readiness?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/103702/i2c-how-to-check-device-readiness</link><description>I am using code from nRF5_SDK_17.1.0\examples\peripheral\twi_master_with_twis_slave for accessing an EEPROM. The code seemed to work fine for a 24c512. I am now trying to use it with a 24c64 device and I am running into issues!!! Data seems to wrap at</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 16 Sep 2023 08:14:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/103702/i2c-how-to-check-device-readiness" /><item><title>RE: I2C how to check device readiness?</title><link>https://devzone.nordicsemi.com/thread/446374?ContentTypeID=1</link><pubDate>Sat, 16 Sep 2023 08:14:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e27bd45-81f5-4120-bff1-bdb89a8436c1</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Great to hear you found the problem &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I will consider the case resolved then.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C how to check device readiness?</title><link>https://devzone.nordicsemi.com/thread/446336?ContentTypeID=1</link><pubDate>Fri, 15 Sep 2023 15:22:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c92d26b5-6b33-45a3-8fe6-8240ad18b9e0</guid><dc:creator>MrHarmonSr</dc:creator><description>&lt;p&gt;I found that using the twi callback events I would get address NACK events, indicating the device was not ready.&lt;br /&gt;I was able to use this t retry the operation.&lt;br /&gt;My real problem was the address byte order.&amp;nbsp; These needed to be swapped to be in the MSB first format required by the 24c64 product.&amp;nbsp; I now have working firmware.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C how to check device readiness?</title><link>https://devzone.nordicsemi.com/thread/445871?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2023 13:58:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c3e45db-6d2d-4ae1-b972-d45aaf1a9565</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can find the 24c64 datasheet &lt;a href="https://ww1.microchip.com/downloads/en/devicedoc/doc0336.pdf"&gt;here&lt;/a&gt;. It is correct that it has a page size of 32 bytes, meaning you can only read or write 32 bytes in each transaction.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The 24c512 for comparison has 128 byte pages, and will allow longer transactions.&amp;nbsp;&lt;/p&gt;
[quote user=""]The code comment says &amp;quot; * @attention If you wish to communicate with real EEPROM memory chip, check its readiness&lt;br /&gt; * after writing the data.&amp;quot;[/quote]
&lt;p&gt;Write and erase operations are generally slow for flash memory devices, and after performing one of these operations you need to check the status of the device before issuing more commands.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Many flash devices allow you to read out a status register, which indicates whether or not the device is busy executing a write or erase.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Apparently the 24C&amp;nbsp;series don&amp;#39;t have any status registers to read, but I found the following statement in the datasheet:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;BYTE WRITE: A write operation requires two 8-bit data word addresses following the device address word and acknowledgment. Upon receipt of this address, the EEPROM will again respond with a zero and then clock in the first 8-bit data word. Following receipt of the 8-bit data word, the EEPROM will output a zero and the addressing device, such as a microcontroller, must terminate the write sequence with a stop condition. &lt;span style="color:rgba(255, 0, 0, 1);"&gt;&lt;strong&gt;At this time the EEPROM enters an internally-timed write cycle, tWR, to the nonvolatile memory. All inputs are disabled during this write cycle and the EEPROM will not respond until the write is complete (refer to Figure 2).&lt;/strong&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;In other words you should get a NACK on the I2C bus if you try to issue more commands while the previous command is being executed.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>