<?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>need help with oled and NRF52 DK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21267/need-help-with-oled-and-nrf52-dk</link><description>Hi,
i was interfacing oled with nrf52 board. I got some example and modified bit to use it with GCC.
But it is now working. Oled not at all starting.
oled is 0.96 inch, I2C based 128x64.
Vdd = 5v
sda = p0.26
scl = p0.27 
 Here is code
 github</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 05 Oct 2018 13:52:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21267/need-help-with-oled-and-nrf52-dk" /><item><title>RE: need help with oled and NRF52 DK</title><link>https://devzone.nordicsemi.com/thread/151857?ContentTypeID=1</link><pubDate>Fri, 05 Oct 2018 13:52:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd851b80-4596-4276-b31b-d6e446af897d</guid><dc:creator>vohra alihussain</dc:creator><description>&lt;p&gt;hey do u get your answer?&lt;/p&gt;
&lt;p&gt;i am also facing same type of problem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: need help with oled and NRF52 DK</title><link>https://devzone.nordicsemi.com/thread/83261?ContentTypeID=1</link><pubDate>Thu, 11 May 2017 17:34:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb98c53a-4e90-4afc-a28d-ff19a140fcd8</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;An alternative if splitting the data does not work, is to use &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52840.ps/twi.html?cp=2_1_0_47#concept_rhy_rzp_sr"&gt;legacy TWI&lt;/a&gt; without EasyDMA. This can be selected by setting &lt;code&gt;TWIx_USE_EASY_DMA 0&lt;/code&gt; in &lt;em&gt;sdk_config.h&lt;/em&gt;. Unfortunately the TWI master driver and HAL does not seem to have support for length parameters of more than 8 bits. You will have to change the driver/HAL implementations to support 16-bit lengths, or use the registers directly. I will check if I can make an example for you, but something like this code should work to do a TWI transfer using the registers:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t byte_number = 0;
NRF_TWI0-&amp;gt;ENABLE = (TWI_ENABLE_ENABLE_Enabled &amp;lt;&amp;lt; TWI_ENABLE_ENABLE_Pos);
NRF_TWI0-&amp;gt;PSELSCL = 27;
NRF_TWI0-&amp;gt;PSELSDA = 26;
NRF_TWI0-&amp;gt;FREQUENCY = TWI_FREQUENCY_FREQUENCY_K100;
NRF_TWI0-&amp;gt;INTENCLR = 0xFFFFFFFFUL; //Disable all interrupts
NRF_TWI0-&amp;gt;SHORTS = 0x00000000;
NRF_TWI0-&amp;gt;ADDRESS = 0x3C;
NRF_TWI0-&amp;gt;EVENTS_TXDSENT = 0;

NRF_TWI0-&amp;gt;TXD            = 0x40; //control byte
NRF_TWI0-&amp;gt;TASKS_STARTTX  = 1;


while (byte_number &amp;lt; sizeof(buffer)) {
	// wait for the transaction complete
	
	while (NRF_TWI0-&amp;gt;EVENTS_TXDSENT == 0);

	NRF_TWI0-&amp;gt;TXD            = buffer[byte_number];
	NRF_TWI0-&amp;gt;EVENTS_TXDSENT = 0;
	byte_number++;
}

while (NRF_TWI0-&amp;gt;EVENTS_TXDSENT == 0); //Wait for last byte

NRF_TWI0-&amp;gt;EVENTS_STOPPED   = 0;
NRF_TWI0-&amp;gt;TASKS_STOP       = 1;

while (NRF_TWI0-&amp;gt;EVENTS_STOPPED == 0);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: need help with oled and NRF52 DK</title><link>https://devzone.nordicsemi.com/thread/83254?ContentTypeID=1</link><pubDate>Tue, 09 May 2017 15:53:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:235a0d3e-a867-4f8d-ada1-286abe23695a</guid><dc:creator>phob</dc:creator><description>&lt;p&gt;Thanks for correcting. Link is broken. Please share the link again.
i have updated code in github. still not working.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: need help with oled and NRF52 DK</title><link>https://devzone.nordicsemi.com/thread/83255?ContentTypeID=1</link><pubDate>Tue, 09 May 2017 04:38:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1bd5a487-e2fa-4922-bb2e-97c55550c342</guid><dc:creator>kian79</dc:creator><description>&lt;p&gt;Hi Jorgen,&lt;/p&gt;
&lt;p&gt;There seems to be an issue with a repeated start bit between non stop transfers as discussed in this thread:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/questi..."&gt;devzone.nordicsemi.com/questi...&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I think splitting the buffer into multiple transfers of 255 bytes will not work too. Did you manage to find another solution?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: need help with oled and NRF52 DK</title><link>https://devzone.nordicsemi.com/thread/83260?ContentTypeID=1</link><pubDate>Thu, 27 Apr 2017 10:52:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de9f2da1-dc48-44a8-b967-e829f85bd52f</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;I see one more issue in the code. In function &lt;code&gt;ssd1306_display()&lt;/code&gt;, the buffer is sent to the display in a single transfer. From the API documentation of &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v13.0.0%2Fgroup__nrf__drv__twi.html&amp;amp;anchor=ga2c5ea8408254dfa9cbff55dbee171a95"&gt;&lt;code&gt;nrf_drv_twi_tx()&lt;/code&gt;&lt;/a&gt;, you can see that the input &lt;code&gt;length&lt;/code&gt; is of type &lt;code&gt;uint8_t&lt;/code&gt;, meaning the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/twim.html?cp=2_2_0_32_7_14#register.TXD.MAXCNT"&gt;maximum length of the transfer can be 255 bytes&lt;/a&gt;. This is due to the limited EasyDMA buffer in the nRF52 series. You have to split the buffer into multiple transfers of 255 bytes or less. With a resolution of 128x64 pixels, the transfer size will be 128*64/8=1024 bytes. When giving this number to the 8-bit length parameter, the variable will overflow and a lengt of 0 will be used, leading to no data being transferred. &lt;a href="https://devzone.nordicsemi.com/question/63802/twii2c-with-sdk-11-long-transfers/"&gt;This thread&lt;/a&gt; might be of help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: need help with oled and NRF52 DK</title><link>https://devzone.nordicsemi.com/thread/83259?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2017 17:49:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe927e25-bfa8-431e-9222-ca4f6fbe187f</guid><dc:creator>phob</dc:creator><description>&lt;p&gt;Ok.
I don&amp;#39;t think there is any Initialization failed, because i compare 3-4 kinda code of different controller for the same oled. Init sequence is exact replica. I think there might be issue with i2c communication. Or May be because of blocking or non-blocking issue. I don&amp;#39;t have working LA now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: need help with oled and NRF52 DK</title><link>https://devzone.nordicsemi.com/thread/83257?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2017 08:01:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95978573-98e9-4485-8082-d5206c41b351</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Yes, I get the same dots. Most likely there is something wrong with the initialization commands or the functions for writing to the OLED.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: need help with oled and NRF52 DK</title><link>https://devzone.nordicsemi.com/thread/83253?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2017 19:00:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:844542a9-430f-42dc-9733-2d4dbad07986</guid><dc:creator>phob</dc:creator><description>&lt;p&gt;Thanks jorgen. I tried 0x3C address and partially oled works means backlight and some dots are coming. But it stucks at dots only. I am calling function to draw some bitmaps as well but no effect.
&lt;a href="http://obrazki.elektroda.pl/2093360400_1492801072.jpg"&gt;obrazki.elektroda.pl/2093360400_1492801072.jpg&lt;/a&gt;
is it same result you got or you got text on oled?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: need help with oled and NRF52 DK</title><link>https://devzone.nordicsemi.com/thread/83258?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2017 08:38:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f99d8b71-08bc-40a0-908f-e42ee532db09</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;The code from your GitHub is working with my display if I change the I2C address from 3D to 3C. Are you sure the OLED is powered correctly?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: need help with oled and NRF52 DK</title><link>https://devzone.nordicsemi.com/thread/83252?ContentTypeID=1</link><pubDate>Thu, 20 Apr 2017 17:53:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c747e1f4-ff43-4dd0-a402-5289a4f20731</guid><dc:creator>phob</dc:creator><description>&lt;p&gt;No, I think my code is not working at all. Even if i do LED ON then also no effect.
I saw once LED backlight was ON, but later no such effect.
I have updated code on github and link shared in 1st post.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: need help with oled and NRF52 DK</title><link>https://devzone.nordicsemi.com/thread/83262?ContentTypeID=1</link><pubDate>Tue, 18 Apr 2017 06:58:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:558e6685-c0e9-4038-be77-2b58788fe04a</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Yes, the backlight is enables in initialization (at least on my device). Do you get any error codes from the calls to &lt;code&gt;nrf_drv_twi_tx&lt;/code&gt;? Have you checked that you are using the correct address for the device? You can scan for TWI devices using the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v13.0.0/twi_scanner_example.html?cp=4_0_0_4_4_35"&gt;TWI scanner&lt;/a&gt; example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: need help with oled and NRF52 DK</title><link>https://devzone.nordicsemi.com/thread/83256?ContentTypeID=1</link><pubDate>Thu, 13 Apr 2017 15:09:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bad42c0d-67b3-4127-8e31-43d7c2d1421f</guid><dc:creator>phob</dc:creator><description>&lt;p&gt;I checked with blocking mode, but it didn&amp;#39;t work for me. Do i have to change jumper anywhere?
I checked voltage and its proper, but like other lcd&amp;#39;s which glow backlight, but with oled backlight is not coming.
Do we have any example to refer?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: need help with oled and NRF52 DK</title><link>https://devzone.nordicsemi.com/thread/83251?ContentTypeID=1</link><pubDate>Tue, 11 Apr 2017 10:46:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0d9a022-e6d1-4ce0-a215-69015cd1aeb9</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The problem seems to be that you are using the TWI driver in &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v13.0.0/hardware_driver_twi.html?cp=4_0_0_2_16_1#hardware_driver_twi_basic"&gt;non-blocking mode&lt;/a&gt;, but you do not have any mechanism implemented to make sure that the previous transfer is done before starting a new transfer. If you check the return code of your calls to &lt;code&gt;nrf_drv_twi_tx()&lt;/code&gt; in &lt;code&gt;ssd1306_command()&lt;/code&gt;, you will see that you get a lot of error code 0x11 - &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v3.0.0/group__nrf__error.html#ga5d2d8608f6d6a0329f58961a969e946e"&gt;NRF_ERROR_BUSY&lt;/a&gt;. This leads to that the commands is not sent to the OLED.&lt;/p&gt;
&lt;p&gt;A simple fix to this problem is to switch to blocking mode for the TWI instance. This is done by passing &lt;code&gt;NULL&lt;/code&gt; to &lt;em&gt;event_handler&lt;/em&gt; argument of &lt;code&gt;nrf_drv_twi_init()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>