<?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>Read register issue using nrf52 TWI</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/25668/read-register-issue-using-nrf52-twi</link><description>Hi , 
 I have recently bought a nRF5232 PCA10040 development kit and i am trying to interface nRf52832 development kit(Master) with AS3955(slave) over twi. I tested the twi_scanner example and AS3955 responds with correct slave address(i.e 0x50). Now</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 Oct 2017 13:21:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/25668/read-register-issue-using-nrf52-twi" /><item><title>RE: Read register issue using nrf52 TWI</title><link>https://devzone.nordicsemi.com/thread/101120?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2017 13:21:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:916067ae-1a6c-44e7-be49-b994223efbf2</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Happy to help and glad it works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read register issue using nrf52 TWI</title><link>https://devzone.nordicsemi.com/thread/101119?ContentTypeID=1</link><pubDate>Fri, 13 Oct 2017 16:02:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92c1e34c-fbaf-4e2d-a4e4-1fd1f5b051ea</guid><dc:creator>Shahid Ali Nadaf</dc:creator><description>&lt;p&gt;Oh Yes....Then its right..i was actually looking at an old datasheet which the company had shared with me along with their development kit...!!!!&lt;/p&gt;
&lt;p&gt;Thank You&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read register issue using nrf52 TWI</title><link>https://devzone.nordicsemi.com/thread/101118?ContentTypeID=1</link><pubDate>Fri, 13 Oct 2017 11:54:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b54d7c7e-fa8b-4533-abdf-af8e8857a38c</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Are you sure it is not supposed to be 0x02? According to &lt;a href="https://ams.com/ger/content/download/765130/1929267/file/AS3955_DS000400_4-00.pdf"&gt;this datasheet&lt;/a&gt; I think what you see is correct:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/1200.asdf.PNG" alt="asdf" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read register issue using nrf52 TWI</title><link>https://devzone.nordicsemi.com/thread/101116?ContentTypeID=1</link><pubDate>Thu, 12 Oct 2017 19:54:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8561dee7-c663-4aa9-8926-469798cd337e</guid><dc:creator>Shahid Ali Nadaf</dc:creator><description>&lt;p&gt;Hi martin,&lt;/p&gt;
&lt;p&gt;Sorry for the late reply, I was caught up with some other work. And Thank you the register read i think is working fine.
In order to enable I2C on AS3955, /SS pin of AS3955 should be pulled low which i was already doing in the code using&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_gpio_cfg_output(SLAVE_SELECT_GPIO);
nrf_gpio_pin_write(SLAVE_SELECT_GPIO, 0);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;but looks like i have to add a delay of 10ms(or less) in order to stabilize I2C pins(i am actually not sure why). Adding the delay of 10ms after writing to GPIO actually worked for me.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_gpio_cfg_output(SLAVE_SELECT_GPIO);
nrf_gpio_pin_write(SLAVE_SELECT_GPIO, 0);
nrf_delay_ms(10);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The default value at register address 0x3E(0x1E) is 0x01(according to datasheet) but for me it reads as 0x02.
But i tried reading other registers and all read correct values.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read register issue using nrf52 TWI</title><link>https://devzone.nordicsemi.com/thread/101114?ContentTypeID=1</link><pubDate>Thu, 05 Oct 2017 07:39:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc940363-6b29-4f82-bee8-d1db3ed46b22</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;I see. Are you able to read anything other than 0xFF from the other registers? Do you have a logic analyzer or oscilloscope so we can see what is actually going on on the bus? Since you receive 0xFF I assume neither the tx or the rx functions return any errors?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read register issue using nrf52 TWI</title><link>https://devzone.nordicsemi.com/thread/101115?ContentTypeID=1</link><pubDate>Wed, 04 Oct 2017 15:56:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c4a31ef-0cc5-4163-bfe0-4d155f207d08</guid><dc:creator>Shahid Ali Nadaf</dc:creator><description>&lt;p&gt;Hi Martin,&lt;/p&gt;
&lt;p&gt;The address is actually 0x1E and the default data contained by 0x1E register(version control) is 0x01. If you look into the datasheet I2C access modes contain 3 bits to set the mode and remaining 5 bits contain the register address. For register read the Mode bits should be set to 001 and the remaining 5 bits are occupied by the register address(0x1E), hence it is 0x3E.&lt;/p&gt;
&lt;p&gt;Mode bits   Register Address&lt;br /&gt;
M2 M1 M0    C4 C3 C2 C1 C0&lt;br /&gt;
0        0        1           1       1       1       1        0&lt;/p&gt;
&lt;p&gt;Therefore the address is 0x3E (otherwise the actual address is 0x1E in the datasheet)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read register issue using nrf52 TWI</title><link>https://devzone.nordicsemi.com/thread/101117?ContentTypeID=1</link><pubDate>Wed, 04 Oct 2017 12:42:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c078b60-da43-4e21-9b79-c1e014062442</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;What kind of data is stored at address 0x3E? I couldn&amp;#39;t find any reference to that particular address when skimming through the datasheet.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>