<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl-pl">
<link rel="self" type="application/atom+xml" href="https://forum.atnel.pl/feed.php?f=4&amp;t=24320&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2022-09-27T15:55:25+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=4&amp;t=24320&amp;mode</id>
<entry>
<author><name><![CDATA[Eposas]]></name></author>
<updated>2022-09-27T15:55:25+01:00</updated>
<published>2022-09-27T15:55:25+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=24320&amp;p=236042#p236042</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=24320&amp;p=236042#p236042"/>
<title type="html"><![CDATA[Losowe piksele na wyświetlaczu ST7565]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=24320&amp;p=236042#p236042"><![CDATA[
Cześć wszystkim,<br />Mam problem z wyświetlaczem COG Winstar; WDO0066-TML#06 128x64 na sterowniku ST7565, na bocznej sciance od lewej strony wyświetlają mi się losowe piksele, oraz napisy są obrócone o 180 stopni  <img src="https://forum.atnel.pl/images/smilies/icon_e_surprised.gif" alt=":o" title="Zdziwiony" />. Wprawdzie działam na stm32 f103 jednak to nie leży po stronie mikrokontrolera, tylko pewnie kodu. Od razu uprzedzam że to też nie jest wina wyświetlacza, na dwóch mam tak samo <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" />.<br />Biblioteka jest zaciągnięta z Githuba<br />[syntax=c]#include &lt;stdlib.h&gt;<br />#include &lt;stdint.h&gt;<br />#include &quot;stm32f1xx_hal.h&quot;<br />#include &quot;ST7565.h&quot;<br />#include &lt;string.h&gt;<br />#include &quot;spi.h&quot;<br />#include &quot;font.h&quot;<br /><br />#define ST7565_STARTBYTES 0<br />extern SPI_HandleTypeDef hspi2;<br /><br />//extern void DelaymS(vu32 nTime);<br /><br />//extern void DelayuS(vu32 nCount);<br />uint8_t is_reversed = 0;<br /><br />// a handy reference to where the pages are on the screen<br />//const uint8_t pagemap&#91;&#93; = { 3, 2, 1, 0, 7, 6, 5, 4 };<br />const uint8_t pagemap&#91;&#93; = { 7, 6, 5, 4, 3, 2, 1, 0 };<br /><br />// a 5x7 font table<br />extern const uint8_t font&#91;&#93;;<br />int pData;<br />// the memory buffer for the LCD<br />uint8_t st7565_buffer&#91;1024&#93; = {<br /> 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,<br /> 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,<br /> 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,<br /> 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,<br /> 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,<br /> 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,<br /> 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,<br /> 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};<br /><br />/* uint8_t st7565_buffer&#91;1024&#93; = {<br /> 0x00, 0x07, 0x18, 0x20, 0x20, 0x40, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x40, 0x40, 0x40, 0x20, 0x20, 0x18, 0x07, 0x00,<br /> 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,<br /> 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,<br /> 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,<br /> 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,<br /> 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,<br /> 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,<br /> 0x00, 0xe0, 0x18, 0x04, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x04, 0x04, 0x18, 0xe0, 0x00};<br />*/<br />// reduces how much is refreshed, which speeds it up!<br />// originally derived from Steve Evans/JCW's mod but cleaned up and<br />// optimized<br />#define enablePartialUpdate<br /><br />#ifdef enablePartialUpdate<br />static uint8_t xUpdateMin, xUpdateMax, yUpdateMin, yUpdateMax;<br />#endif<br /><br /><br /><br />static void ST7565_updateBoundingBox(uint8_t xmin, uint8_t ymin, uint8_t xmax, uint8_t ymax) {<br />#ifdef enablePartialUpdate<br />  if (xmin &lt; xUpdateMin) xUpdateMin = xmin;<br />  if (xmax &gt; xUpdateMax) xUpdateMax = xmax;<br />  if (ymin &lt; yUpdateMin) yUpdateMin = ymin;<br />  if (ymax &gt; yUpdateMax) yUpdateMax = ymax;<br />#endif<br />}<br /><br />void ST7565_drawbitmap(uint8_t x, uint8_t y, const uint8_t *bitmap, uint8_t w, uint8_t h, uint8_t color) {<br />  uint8_t i, j;<br />  for (j=0; j&lt;h; j++) {<br />    for (i=0; i&lt;w; i++ ) {<br />      if (bitmap&#91;i + (j/8) * w&#93; &amp; (1&lt;&lt;(j%8))) {<br />        ST7565_my_setpixel(x+i, y+j, color);<br />      }<br />    }<br />  }<br /><br />  ST7565_updateBoundingBox(x, y, x+w, y+h);<br />}<br /><br />void ST7565_drawstring(uint8_t x, uint8_t line, char *c) {<br />  while (c&#91;0&#93; != 0) {<br />ST7565_drawchar(x, line, c&#91;0&#93;);<br />    c++;<br />    x += 6; // 6 pixels wide<br />    if (x + 6 &gt;= LCDWIDTH) {<br />      x = 0;    // ran out of this line<br />      line++;<br />    }<br />    if (line &gt;= (LCDHEIGHT/8))<br />      return;        // ran out of space :(<br />  }<br />}<br /><br /><br />void ST7565_drawstring_P(uint8_t x, uint8_t line, const char *str) {<br />  char c;<br />  while (1) {<br />    c = *str++;<br />    if (! c)<br />      return;<br />    ST7565_drawchar(x, line, c);<br />    x += 6; // 6 pixels wide<br />    if (x + 6 &gt;= LCDWIDTH) {<br />      x = 0;    // ran out of this line<br />      line++;<br />    }<br />    if (line &gt;= (LCDHEIGHT/8))<br />      return;        // ran out of space :(<br />  }<br />}<br /><br />void  ST7565_drawchar(uint8_t x, uint8_t line, char c) {<br />  uint8_t i;<br />  for (i =0; i&lt;5; i++ ) {<br />    st7565_buffer&#91;x + (line*128) &#93; = font&#91;((unsigned char)c * 5) + i&#93;;<br />    x++;<br />  }<br /><br />  ST7565_updateBoundingBox(x-5, line*8, x-1, line*8 + 8);<br />}<br /><br /><br />// bresenham's algorithm - thx wikpedia<br />void ST7565_drawline(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1,<br />      uint8_t color) {<br />  uint8_t steep = abs(y1 - y0) &gt; abs(x1 - x0);<br />  if (steep) {<br />    swap(x0, y0);<br />    swap(x1, y1);<br />  }<br /><br />  if (x0 &gt; x1) {<br />    swap(x0, x1);<br />    swap(y0, y1);<br />  }<br /><br />  // much faster to put the test here, since we've already sorted the points<br />  ST7565_updateBoundingBox(x0, y0, x1, y1);<br /><br />  uint8_t dx, dy;<br />  dx = x1 - x0;<br />  dy = abs(y1 - y0);<br /><br />  int8_t err = dx / 2;<br />  int8_t ystep;<br /><br />  if (y0 &lt; y1) {<br />    ystep = 1;<br />  } else {<br />    ystep = -1;}<br /><br />  for (; x0&lt;=x1; x0++) {<br />    if (steep) {<br />    ST7565_my_setpixel(y0, x0, color);<br />    } else {<br />    ST7565_my_setpixel(x0, y0, color);<br />    }<br />    err -= dy;<br />    if (err &lt; 0) {<br />      y0 += ystep;<br />      err += dx;<br />    }<br />  }<br />}<br /><br />// filled rectangle<br />void ST7565_fillrect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t color) {<br />  uint8_t i, j;<br /><br />  // stupidest version - just pixels - but fast with internal buffer!<br />  for (i=x; i&lt;x+w; i++) {<br />    for (j=y; j&lt;y+h; j++) {<br />      ST7565_my_setpixel(i, j, color);<br />    }<br />  }<br /><br />  ST7565_updateBoundingBox(x, y, x+w, y+h);<br />}<br /><br />// draw a rectangle<br />void ST7565_drawrect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t color) {<br />  uint8_t i;<br />  // stupidest version - just pixels - but fast with internal buffer!<br />  for (i=x; i&lt;x+w; i++) {<br />ST7565_my_setpixel(i, y, color);<br />ST7565_my_setpixel(i, y+h-1, color);<br />  }<br />  for (i=y; i&lt;y+h; i++) {<br />ST7565_my_setpixel(x, i, color);<br />ST7565_my_setpixel(x+w-1, i, color);<br />  }<br /><br />  ST7565_updateBoundingBox(x, y, x+w, y+h);<br />}<br /><br />// draw a circle outline<br />void ST7565_drawcircle(uint8_t x0, uint8_t y0, uint8_t r, uint8_t color) {<br />ST7565_updateBoundingBox(x0-r, y0-r, x0+r, y0+r);<br /><br />  int8_t f = 1 - r;<br />  int8_t ddF_x = 1;<br />  int8_t ddF_y = -2 * r;<br />  int8_t x = 0;<br />  int8_t y = r;<br /><br />  ST7565_my_setpixel(x0, y0+r, color);<br />  ST7565_my_setpixel(x0, y0-r, color);<br />  ST7565_my_setpixel(x0+r, y0, color);<br />  ST7565_my_setpixel(x0-r, y0, color);<br /><br />  while (x&lt;y) {<br />    if (f &gt;= 0) {<br />      y--;<br />      ddF_y += 2;<br />      f += ddF_y;<br />    }<br />    x++;<br />    ddF_x += 2;<br />    f += ddF_x;<br /><br />    ST7565_my_setpixel(x0 + x, y0 + y, color);<br />    ST7565_my_setpixel(x0 - x, y0 + y, color);<br />    ST7565_my_setpixel(x0 + x, y0 - y, color);<br />    ST7565_my_setpixel(x0 - x, y0 - y, color);<br /><br />    ST7565_my_setpixel(x0 + y, y0 + x, color);<br />    ST7565_my_setpixel(x0 - y, y0 + x, color);<br />    ST7565_my_setpixel(x0 + y, y0 - x, color);<br />    ST7565_my_setpixel(x0 - y, y0 - x, color);<br /><br />  }<br /><br /><br /><br />}<br /><br />void ST7565_fillcircle(uint8_t x0, uint8_t y0, uint8_t r, uint8_t color) {<br />  ST7565_updateBoundingBox(x0-r, y0-r, x0+r, y0+r);<br /><br />  int8_t f = 1 - r;<br />  int8_t ddF_x = 1;<br />  int8_t ddF_y = -2 * r;<br />  int8_t x = 0;<br />  int8_t y = r;<br />  uint8_t i;<br /><br />  for (i=y0-r; i&lt;=y0+r; i++) {<br />ST7565_my_setpixel(x0, i, color);<br />  }<br /><br />  while (x&lt;y) {<br />    if (f &gt;= 0) {<br />      y--;<br />      ddF_y += 2;<br />      f += ddF_y;<br />    }<br />    x++;<br />    ddF_x += 2;<br />    f += ddF_x;<br /><br />    for (i=y0-y; i&lt;=y0+y; i++) {<br />      ST7565_my_setpixel(x0+x, i, color);<br />      ST7565_my_setpixel(x0-x, i, color);<br />    }<br />    for (i=y0-x; i&lt;=y0+x; i++) {<br />      ST7565_my_setpixel(x0+y, i, color);<br />      ST7565_my_setpixel(x0-y, i, color);<br />    }<br />  }<br />}<br /><br />void ST7565_my_setpixel(uint8_t x, uint8_t y, uint8_t color) {<br />  if ((x &gt;= LCDWIDTH) || (y &gt;= LCDHEIGHT))<br />    return;<br /><br />  // x is which column<br />  if (color)<br />    st7565_buffer&#91;x+ (y/8)*128&#93; |= (1&lt;&lt;(7-(y%8)));<br />  else<br />    st7565_buffer&#91;x+ (y/8)*128&#93; &amp;= ~(1&lt;&lt;(7-(y%8)));<br />}<br /><br />// the most basic function, set a single pixel<br />void ST7565_setpixel(uint8_t x, uint8_t y, uint8_t color) {<br />  if ((x &gt;= LCDWIDTH) || (y &gt;= LCDHEIGHT))<br />    return;<br /><br />  // x is which column<br />  if (color)<br />    st7565_buffer&#91;x+ (y/8)*128&#93; |= (1&lt;&lt;(7-(y%8)));<br />  else<br />    st7565_buffer&#91;x+ (y/8)*128&#93; &amp;= ~(1&lt;&lt;(7-(y%8)));<br /><br />  ST7565_updateBoundingBox(x,y,x,y);<br />}<br /><br /><br />// the most basic function, get a single pixel<br />uint8_t ST7565_getpixel(uint8_t x, uint8_t y) {<br />  if ((x &gt;= LCDWIDTH) || (y &gt;= LCDHEIGHT))<br />    return 0;<br /><br />  return (st7565_buffer&#91;x+ (y/8)*128&#93; &gt;&gt; (7-(y%8))) &amp; 0x1;<br />}<br /><br />void ST7565_begin(uint8_t contrast) {<br />  ST7565_st7565_init();<br />  ST7565_st7565_command(CMD_DISPLAY_ON);<br />  ST7565_st7565_command(CMD_SET_ALLPTS_NORMAL);<br />  ST7565_st7565_set_brightness(contrast);<br />}<br /><br />void ST7565_st7565_init(void) {<br /><br />//  toggle RST low to reset; CS is low so it'll listen to us<br />//  if (cs &gt; 0)<br />//  digitalWrite(cs, LOW);<br />  HAL_GPIO_WritePin(GPIOA, GPIO_PIN_6, GPIO_PIN_RESET); // CS LOW<br /><br />//  digitalWrite(rst, LOW);<br />  HAL_GPIO_WritePin(GPIOC, GPIO_PIN_4, GPIO_PIN_RESET); // RST LOW 0.5sec<br /><br />//wait 0.5sec<br />  HAL_Delay(500);<br /><br />//digitalWrite(rst, HIGH);<br />  HAL_GPIO_WritePin(GPIOC, GPIO_PIN_4, GPIO_PIN_SET); // RST HIGH<br /><br />  // LCD bias select<br />  ST7565_st7565_command(CMD_SET_BIAS_7);<br />  // ADC select<br />  ST7565_st7565_command(CMD_SET_ADC_NORMAL);<br />  // SHL select<br />  ST7565_st7565_command(CMD_SET_COM_NORMAL);<br />  // Initial display line<br />  ST7565_st7565_command(CMD_SET_DISP_START_LINE);<br /><br />  // turn on voltage converter (VC=1, VR=0, VF=0)<br />  ST7565_st7565_command(CMD_SET_POWER_CONTROL | 0x4);<br />  // wait for 50% rising<br />  HAL_Delay(50);<br /><br />  // turn on voltage regulator (VC=1, VR=1, VF=0)<br />  ST7565_st7565_command(CMD_SET_POWER_CONTROL | 0x6);<br />  // wait &gt;=50ms<br />  HAL_Delay(50);<br /><br />  // turn on voltage follower (VC=1, VR=1, VF=1)<br />  ST7565_st7565_command(CMD_SET_POWER_CONTROL | 0x7);<br />  // wait<br />  HAL_Delay(10);<br /><br />  // set lcd operating voltage (regulator resistor, ref voltage resistor)<br />  ST7565_st7565_command(CMD_SET_RESISTOR_RATIO | 0x6);<br /><br />  // initial display line<br />  // set page address<br />  // set column address<br />  // write display data<br /><br />  // set up a bounding box for screen updates<br /><br />  ST7565_updateBoundingBox(0, 0, LCDWIDTH-1, LCDHEIGHT-1);<br />}<br /><br /><br /><br />inline void ST7565_spiwrite(uint8_t c) {<br />//shiftOut(sid, sclk, MSBFIRST, c);<br />//while (SPI_GetFlagStatus(SPI2, SPI_FLAG_TXE) == RESET);<br />//SPI_SendData(SPI2, c);<br />HAL_SPI_Transmit(&amp;hspi2, &amp;c, 1, 500);<br />}<br /><br />void ST7565_st7565_command(uint8_t c) {<br />//  digitalWrite(a0, LOW);<br />// GPIO_ResetBits(GPIOA, GPIO_Pin_4);<br /> HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, GPIO_PIN_RESET);<br /><br />  ST7565_spiwrite(c);<br />}<br /><br />void ST7565_st7565_data(uint8_t c) {<br />//  digitalWrite(a0, HIGH);<br />// GPIO_SetBits(GPIOB, GPIO_Pin_11);<br />HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, GPIO_PIN_SET);<br /><br />  ST7565_spiwrite(c);<br />}<br />void ST7565_st7565_set_brightness(uint8_t val) {<br />ST7565_st7565_command(CMD_SET_VOLUME_FIRST);<br />    ST7565_st7565_command(CMD_SET_VOLUME_SECOND | (val &amp; 0x3f));<br />}<br /><br /><br />void ST7565_display(void) {<br />  uint8_t col, maxcol, p;<br /><br />  /*<br />  Serial.print(&quot;Refresh (&quot;); Serial.print(xUpdateMin, DEC);<br />  Serial.print(&quot;, &quot;); Serial.print(xUpdateMax, DEC);<br />  Serial.print(&quot;,&quot;); Serial.print(yUpdateMin, DEC);<br />  Serial.print(&quot;, &quot;); Serial.print(yUpdateMax, DEC); Serial.println(&quot;)&quot;);<br />  */<br /><br />  for(p = 0; p &lt; 8; p++) {<br />    /*<br />      putstring(&quot;new page! &quot;);<br />      uart_putw_dec(p);<br />      putstring_nl(&quot;&quot;);<br />    */<br />#ifdef enablePartialUpdate<br />    // check if this page is part of update<br />    if ( yUpdateMin &gt;= ((p+1)*8) ) {<br />      continue;   // nope, skip it!<br />    }<br />    if (yUpdateMax &lt; p*8) {<br />      break;<br />    }<br />#endif<br /><br />    HAL_Delay(1);<br /><br />    ST7565_st7565_command(CMD_SET_PAGE | pagemap&#91;p&#93;);<br />    HAL_Delay(1);<br /><br /><br />#ifdef enablePartialUpdate<br />    col = xUpdateMin;<br />    maxcol = xUpdateMax;<br />#else<br />    // start at the beginning of the row<br />    col = 0;<br />    maxcol = LCDWIDTH;<br />#endif<br /><br />    ST7565_st7565_command(CMD_SET_COLUMN_LOWER | ((col+ST7565_STARTBYTES) &amp; 0xf));<br />    HAL_Delay(1);<br />    ST7565_st7565_command(CMD_SET_COLUMN_UPPER | (((col+ST7565_STARTBYTES) &gt;&gt; 4) &amp; 0x0F));<br />    HAL_Delay(1);<br />    ST7565_st7565_command(CMD_RMW);<br />    HAL_Delay(1);<br /><br />    for(; col &lt; maxcol; col++) {<br />      //uart_putw_dec(col);<br />      //uart_putchar(' ');<br />      ST7565_st7565_data(st7565_buffer&#91;(128*p)+col&#93;);<br />      //DelayuS(10);<br />    }<br />  }<br /><br />#ifdef enablePartialUpdate<br />  xUpdateMin = LCDWIDTH;// - 1;<br />  xUpdateMax = 0;<br />  yUpdateMin = LCDHEIGHT;//-1;<br />  yUpdateMax = 0;<br />#endif<br />}<br /><br />// clear everything<br />void ST7565_clear(void) {<br />  memset(st7565_buffer, 0, 1024);<br />  ST7565_updateBoundingBox(0, 0, LCDWIDTH-1, LCDHEIGHT-1);<br />}<br /><br /><br />// this doesnt touch the buffer, just clears the display RAM - might be handy<br />void ST7565_clear_display(void) {<br />  uint8_t p, c;<br /><br />  for(p = 0; p &lt; 8; p++) {<br />    /*<br />      put<br />(&quot;new page! &quot;);<br />      uart_putw_dec(p);<br />      putstring_nl(&quot;&quot;);<br />    */<br /><br />ST7565_st7565_command(CMD_SET_PAGE | p);<br />    for(c = 0; c &lt; 128; c++) {<br />      //uart_putw_dec(c);<br />      //uart_putchar(' ');<br />      ST7565_st7565_command(CMD_SET_COLUMN_LOWER | (c &amp; 0xf));<br />      ST7565_st7565_command(CMD_SET_COLUMN_UPPER | ((c &gt;&gt; 4) &amp; 0xf));<br />      //DelayuS(10);<br />      ST7565_st7565_data(0x0);<br />    }<br />  }<br />}[/syntax]<br /><br />Znalazłem wątek podobny można powiedzieć identyczny <a href="https://github.com/olikraus/u8g2/issues/1187"  class="postlink">https://github.com/olikraus/u8g2/issues/1187</a> jednak nie wiem jak rozwiązali ten problem <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" />.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=17799">Eposas</a> — 27 wrz 2022, o 15:55</p><hr />
]]></content>
</entry>
</feed>