<?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>Receiving a NACK communicating using TWI interfacing</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/64638/receiving-a-nack-communicating-using-twi-interfacing</link><description>II&amp;#39;m having issues communicating to the MLX90614, datasheet attached. It seems that I have everything set correctly and the TWI Scanner returns addresses and data. My output messages: 
 Event Handler was successfully called. But the Event Handler did</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 13 Aug 2020 07:57:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/64638/receiving-a-nack-communicating-using-twi-interfacing" /><item><title>RE: Receiving a NACK communicating using TWI interfacing</title><link>https://devzone.nordicsemi.com/thread/264377?ContentTypeID=1</link><pubDate>Thu, 13 Aug 2020 07:57:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4f394d3-12cd-48e4-a406-258bd2b1e179</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="bfrank"]I actually changed my setup to use the Melexis library. The signals are stuck high.[/quote]
&lt;p&gt;I am unfamiliar with the Melexis library.&lt;br /&gt;The signals are stuck high, you are seeing this using a logical analyzer I assume?&lt;/p&gt;
[quote user="bfrank"]Can you confirm that it is OK to use the following pins for TWI?[/quote]
&lt;p&gt;I can check this for you if you tell me which nRF device you are using. I see that you have tagged your post with nRF52 and that you mention &amp;quot;nrf52883&amp;quot; in your text - are you using the nRF52833 SoC? Furthermore, are you using a Development Kit or a custom module?&lt;/p&gt;
[quote user="bfrank"]The implemetnation works on the nrf 52883 with nothing else.My implementation was based off of the HTS example. Is there anything there that could cause issue with TWI?[/quote]
&lt;p&gt;What do you mean when you say that it works on the nRF with nothing else?&lt;br /&gt;Are you able to send and receive the correct data over TWI, or what do you mean here?&lt;br /&gt;&lt;br /&gt;As a side note, I would recommend that you use the nrfx_twim driver instead of the nrf_drv_twi_* legacy driver.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving a NACK communicating using TWI interfacing</title><link>https://devzone.nordicsemi.com/thread/264351?ContentTypeID=1</link><pubDate>Thu, 13 Aug 2020 05:24:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9378549-f83a-4ce7-b5db-5284765e2c6b</guid><dc:creator>bfrank</dc:creator><description>&lt;p&gt;I actually changed my setup to use the Melexis library. The signals are stuck high. Can you confirm that it is OK to use the following pins for TWI?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;#define TWI_SCL_PIN NRF_GPIO_PIN_MAP(1, 7)&lt;br /&gt;#define TWI_SDA_PIN NRF_GPIO_PIN_MAP(1, 6)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is what is being sent:&lt;/p&gt;
&lt;p&gt;ret_code_t ret = nrf_drv_twi_tx (&amp;amp;m_twi, slave_address, &amp;amp;readAddress, 1, true);&lt;/p&gt;
&lt;p&gt;if (ret != NRF_SUCCESS) return -1;&lt;/p&gt;
&lt;p&gt;Then this:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; ret = nrf_drv_twi_rx (&amp;amp;m_twi, slave_address, smbData, 3);&lt;/p&gt;
&lt;p&gt;if (ret != NRF_SUCCESS) return -1;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The implemetnation works on the nrf 52883 with nothing else.My implementation was based off of the HTS example. Is there anything there that could cause issue with TWI?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving a NACK communicating using TWI interfacing</title><link>https://devzone.nordicsemi.com/thread/263863?ContentTypeID=1</link><pubDate>Mon, 10 Aug 2020 13:53:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cac04d06-26e7-49f8-affa-a45ec6999cdd</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;From the datasheet you provided, the following except regards SD sending NACK:&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;&lt;em&gt;After every received 8 bits the SD should issue ACK or NACK. When a MD initiates communication, it first sends the address of the slave and only the SD which recognizes the address will ACK, the rest will remain silent. In case the SD NACKs one of the bytes, the MD should stop the communication and repeat the message. A NACK could be received after the PEC. This&amp;nbsp; means that there is an error in the received message and the MD should try sending the message again. The PEC calculation includes all bits except the START, REPEATED START, STOP, ACK, and NACK bits. The PEC is a CRC-8 with polynomial X8+X2+X1+1. The Most Significant Bit of every byte is transferred&lt;/em&gt; first.&amp;quot;&lt;br /&gt;&lt;br /&gt;What is the content of your tx_data when you first do&amp;nbsp;&lt;em&gt;nrf_drv_twi_tx&lt;/em&gt;? Which command are you trying to send?&lt;br /&gt;&lt;br /&gt;The fact that the TWI Scanner example were able to read the address tells us that the hardware connections should be all right, which means we need to take a look at what is being sent, and if it is received successfully.&lt;br /&gt;However, it seems that the TWI Scanner example is also receiving a NACK? If I have understood you correctly that the first log-exempt is from the TWI scanner example.&lt;br /&gt;Do you have access to a logical analyzer?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>