<?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>Text Flicker with ILI9341 GFX Library</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/56062/text-flicker-with-ili9341-gfx-library</link><description>I&amp;#39;m working with Fantel&amp;#39;s adaptation of the nrf52840 (EV-BT840F). I have gotten the GFX example working with Adafruit&amp;#39;s ILI9341 in SPI mode, however I am having a problem with text flickering. When I display text I have to erase that text to show the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Feb 2020 16:53:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/56062/text-flicker-with-ili9341-gfx-library" /><item><title>RE: Text Flicker with ILI9341 GFX Library</title><link>https://devzone.nordicsemi.com/thread/232407?ContentTypeID=1</link><pubDate>Mon, 03 Feb 2020 16:53:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5130b7e5-b92f-42b7-a58a-2105fb16d695</guid><dc:creator>Keith Wakeham</dc:creator><description>&lt;p&gt;Modifying the write_character function, I included a rect_draw for a single line. This sets the line to the bckgnd_color (which now needs to be specified, and I modified&amp;nbsp; nrf_gfx_print to accept a background color and pass it forward). If you&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This works better than a full clear of the area or the write old character to background as you won&amp;#39;t perceive the line clears versus a rectangle clear. It is displaying very cleanly on a ST7789 LCD BUT it leaves artifacts if the width of the new character(s) is smaller than the old. My goal is to use this for numerics and it seems okay to do a constant width font using The Dot Factory. But I Limited the font to the numbers, as some characters are wider and cause the min width to be large making it look bad.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void write_character_bckgnd(nrf_lcd_t const * p_instance,
                            nrf_gfx_font_desc_t const * p_font,
                            uint8_t character,
                            uint16_t * p_x,
                            uint16_t y,
                            uint16_t font_color,
                            uint16_t bckgnd_color)
{
    uint8_t char_idx = character - p_font-&amp;gt;startChar;
    uint16_t bytes_in_line = CEIL_DIV(p_font-&amp;gt;charInfo[char_idx].widthBits, 8);

    if (character == &amp;#39; &amp;#39;)
    {
        *p_x += p_font-&amp;gt;height / 2;
        return;
    }

    for (uint16_t i = 0; i &amp;lt; p_font-&amp;gt;height; i++)
    {
        rect_draw(p_instance, *p_x, y+i, p_font-&amp;gt;charInfo[char_idx].widthBits + p_font-&amp;gt;spacePixels,1,bckgnd_color);
        for (uint16_t j = 0; j &amp;lt; bytes_in_line; j++)
        {
            for (uint8_t k = 0; k &amp;lt; 8; k++)
            {
                if ((1 &amp;lt;&amp;lt; (7 - k)) &amp;amp;
                    p_font-&amp;gt;data[p_font-&amp;gt;charInfo[char_idx].offset + i * bytes_in_line + j])
                {
                    pixel_draw(p_instance, *p_x + j * 8 + k, y + i, font_color);
                }
            }
        }
    }

    *p_x += p_font-&amp;gt;charInfo[char_idx].widthBits + p_font-&amp;gt;spacePixels;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Text Flicker with ILI9341 GFX Library</title><link>https://devzone.nordicsemi.com/thread/232209?ContentTypeID=1</link><pubDate>Mon, 03 Feb 2020 01:48:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:953d42fa-2f63-43b2-8980-02aa5767590f</guid><dc:creator>Keith Wakeham</dc:creator><description>&lt;p&gt;I&amp;#39;m experiencing this as well. The cause is that you&amp;#39;re using screen fill to erase the area first. Like writing an image, it happens slowly over the spi bus. Once the whole rectangle has been written it writes pixel by pixel of the text, only writing needed pixels, but not overwriting the background.&lt;/p&gt;
&lt;p&gt;As an improvement I tried writing the old text first with the background colour and then write the text, this reduces flicker but it still shows clearing and then writing the pixels. What we both need is to blank the background&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The two methods that might avoid this is to convert the text to an image temporarily and write the whole image, thus overwriting the background. The second method is to re-write the&amp;nbsp;&lt;span&gt;nrf_gfx_print and&amp;nbsp;&lt;/span&gt;write_character function to accept an old and new text string and generate pixel writes for both the old and new text.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m working on this now but it&amp;#39;s tricky. The second method is difficult unless font width is constant. So still trying to figure this out.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Text Flicker with ILI9341 GFX Library</title><link>https://devzone.nordicsemi.com/thread/228161?ContentTypeID=1</link><pubDate>Wed, 08 Jan 2020 13:55:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e331fdbd-0eb9-41f4-a223-0c79b6229b79</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;My apologies for the late reply. I have been waiting for a display, which I received today. Will get back to you within tomorrow or Friday.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Text Flicker with ILI9341 GFX Library</title><link>https://devzone.nordicsemi.com/thread/227290?ContentTypeID=1</link><pubDate>Thu, 02 Jan 2020 15:45:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45e13bb5-5db4-4e31-8220-d6ddc6a2c81c</guid><dc:creator>Capitillar</dc:creator><description>&lt;p&gt;Hi Oyvind,&lt;/p&gt;
&lt;p&gt;I am using SDK &amp;quot;nRF5_SDK_16.0.0_98a08e2&amp;quot; there is no delay in the while loop, so it is running at max speed at the moment. I am simply using the GFX example provided in the SDK, the only modifications I have made are the pinout for the Fanstel development board.&lt;/p&gt;
&lt;p&gt;The screen is displaying text, images, and everything fine so I believe the connections are correct. The problem is the update rate of the screen is very low. When I want to write new text to the screen I have to &amp;quot;erase&amp;quot; the old text by writing over it with a rectangle, then the new text slowly writes on the screen. When I want to update a number, like a readout from the ADC, the number appears to flicker because it is erased and then re-written slowly. I have re-uploaded the video below&amp;nbsp;as an mp4, hopefully it will show this time.&lt;/p&gt;
&lt;p&gt;Here is my main loop:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;int main(void)
{
    APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
    NRF_LOG_DEFAULT_BACKENDS_INIT();

    NRF_LOG_INFO(&amp;quot;GFX usage example application started.&amp;quot;)
    NRF_LOG_FLUSH();

    gfx_initialization();
    screen_clear();

    while (1)
    {
       nrf_gfx_rotation_set(p_lcd, NRF_LCD_ROTATE_90);

       nrf_gfx_point_t text_start = NRF_GFX_POINT(20, 100);
       nrf_gfx_print(p_lcd, &amp;amp;text_start, GRAY, &amp;quot;Hello World!&amp;quot;, p_font, false);
       nrf_gfx_screen_fill_area(p_lcd,20,104,235,31,0);
       nrf_gfx_print(p_lcd, &amp;amp;text_start, GRAY, &amp;quot;Test Text&amp;quot;, p_font, false);
       nrf_gfx_screen_fill_area(p_lcd,20,104,235,31,0);

//       brackground_set();
//       text_print();
//       nrf_delay_ms(1000);
//       screen_clear();
//       line_draw();
//       nrf_delay_ms(1000);
//       screen_clear();
//       circle_draw();
//       nrf_delay_ms(1000);
//       screen_clear();
//       test_rect_draw();
//       nrf_delay_ms(1000);
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Screen-Flicker.mp4"&gt;devzone.nordicsemi.com/.../Screen-Flicker.mp4&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Text Flicker with ILI9341 GFX Library</title><link>https://devzone.nordicsemi.com/thread/227279?ContentTypeID=1</link><pubDate>Thu, 02 Jan 2020 15:02:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1afc828f-6d8b-4006-8620-df8fcccc5931</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I&amp;#39;m not able to see the video you have attached. And unfortunately, I do not have any displays available for testing at the moment.&lt;br /&gt;&lt;br /&gt;What version of the SDK are you using? Have you tried to change the delay time in the while loop? Have you verified the connections are correct?&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>