<?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>Problem sending data via TWI - Fatal error</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70026/problem-sending-data-via-twi---fatal-error</link><description>I am trying to communicate with a SH1106 OLED display using TWI and the popular u8g2 display controller library. 
 I&amp;#39;ve verified that the display works without problems on an Arduino and I now try to mimic the exact same behavior on the nRF52. In order</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 05 Jan 2021 10:23:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70026/problem-sending-data-via-twi---fatal-error" /><item><title>RE: Problem sending data via TWI - Fatal error</title><link>https://devzone.nordicsemi.com/thread/287458?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2021 10:23:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bf33d3e-d702-466f-985c-8aa64fd4e970</guid><dc:creator>daubsi</dc:creator><description>&lt;p&gt;Thanks Edvin, I eventually managed to get a fully working example!&lt;/p&gt;
&lt;p&gt;If anyone is interested or in need of a working example of using the u8g2 library on a nRF 52 DK please have a look here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/olikraus/u8g2/issues"&gt;https://github.com/olikraus/u8g2/issues&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and/or here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/OevreFlataeker/u8g2_nrf52"&gt;github.com/.../u8g2_nrf52&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem sending data via TWI - Fatal error</title><link>https://devzone.nordicsemi.com/thread/287182?ContentTypeID=1</link><pubDate>Mon, 04 Jan 2021 10:38:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d85403c2-d67d-4bf3-8905-e32cc0d698cd</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Glad to hear that you found the root cause of your issue. Yes. The 0x8202 means NRF_ERROR_DRV_TWI_ERR_DNACK. Why this was returned was probably a bit random, if the device was not configured for TWI.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best of luck with the garbled output. Make sure that you check the datasheet of the display, so that you send the data in the way that the screen expects to receive it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem sending data via TWI - Fatal error</title><link>https://devzone.nordicsemi.com/thread/287080?ContentTypeID=1</link><pubDate>Sat, 02 Jan 2021 15:29:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3872e1e5-c253-4864-b875-d975959360e8</guid><dc:creator>daubsi</dc:creator><description>&lt;p&gt;I turned out the problem was because I was not actually initializing the u8g2 in i2c mode but presumably in SPI mode.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sniffing the i2c traffic on an Arduino showed the following signals&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1609601237894v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Whereas on the nRF52 DK it was&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1609601274239v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;So that middle part was clearly missing. In the end it turned out I had to call&amp;nbsp;u8g2_Setup_sh1106_i2c_128x64_noname_f() instead of&amp;nbsp;u8g2_Setup_sh1106_128x64_noname_f....&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The display now initialized but has a garbled output. I will work on this now. The TWI part of the SDK seems to work perfectly now&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem sending data via TWI - Fatal error</title><link>https://devzone.nordicsemi.com/thread/287073?ContentTypeID=1</link><pubDate>Fri, 01 Jan 2021 19:49:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3b397495-f6ed-4497-bc42-ca8ec37685c3</guid><dc:creator>daubsi</dc:creator><description>&lt;p&gt;The actual error I receive it 0x8202 by the way:&amp;nbsp;&lt;span&gt;NRF_ERROR_DRV_TWI_ERR_DNACK&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I also tried setting the frequency to 400 kHz but no change in the result.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>