<?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=8&amp;t=19503&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2017-11-05T09:20:12+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=8&amp;t=19503&amp;mode</id>
<entry>
<author><name><![CDATA[piotr_for]]></name></author>
<updated>2017-11-05T09:20:12+01:00</updated>
<published>2017-11-05T09:20:12+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19503&amp;p=198327#p198327</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19503&amp;p=198327#p198327"/>
<title type="html"><![CDATA[Re: Brak tekstu na LCD 20 x 4 DOGM204A]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19503&amp;p=198327#p198327"><![CDATA[
Ok. LCD ruszył. Niepotrzebnie bawiłem się w sprawdzanie zajętości. Po usunięciu zbędnego balastu mogę wszystko wyświetlać. <br />Pomogła analiza kodu kolegi wat1970. Dzięki!<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=815">piotr_for</a> — 5 lis 2017, o 09:20</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[piotr_for]]></name></author>
<updated>2017-10-31T21:32:17+01:00</updated>
<published>2017-10-31T20:47:00+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19503&amp;p=198132#p198132</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19503&amp;p=198132#p198132"/>
<title type="html"><![CDATA[Re: Brak tekstu na LCD 20 x 4 DOGM204A]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19503&amp;p=198132#p198132"><![CDATA[
Wszystko połączone zgodnie ze schematem. Inicjalizacja zgodna ze skróconą instrukcją. Wyświetlacz startuje, kursor miga aż miło, ale tekstu brak... Kod poniżej:<br />[syntax=c]//-----------------------------------------------------<br />//File: lcd_8bit.c<br />//Based on: ELECTRONIC ASSEMBLY JM<br />//-----------------------------------------------------<br /><br />//---Includes---<br />#include &quot;define.h&quot;<br />#include &quot;lcd8bit.h&quot;<br />#include &lt;avr/io.h&gt;<br />#include &lt;util/delay.h&gt;<br /><br />//-----------------------------------------------------<br />//Func: initDispl()<br />//Desc: inits Display<br />//-----------------------------------------------------<br />void initDispl(void)<br />{<br />//Port init PORT DIRECTION)<br />DDRA |= D0|D1|D2|RW|EN|RS|RESET;  // all outputs<br />DDRB |= D3|D4|D5|D6|D7;   // all outputs<br /><br />PORTA &amp;= ~(D0|D1|D2|RW|EN|RS);// all low<br />PORTB &amp;= ~(D3|D4|D5|D6|D7);// all low<br />PORTA |= RESET;// RESET high<br /><br />_delay_ms(10);<br />//Reset of LCD module<br />PORTA &amp;= ~RESET;<br />_delay_ms(15);<br />PORTA |= RESET;<br />_delay_ms(5);<br /><br />//init Display<br />WriteIns(0x3A);//8-Bit data length extension Bit RE=1; REV=0<br />WriteIns(0x09);//4 line display<br />WriteIns(0x06);//Bottom view<br />WriteIns(0x1E);//Bias setting BS1=1<br />WriteIns(0x39);//8-Bit data length extension Bit RE=0; IS=1<br />WriteIns(0x1B);//BS0=1 -&gt; Bias=1/6<br />WriteIns(0x6E); //Devider on and set value<br />WriteIns(0x57); //Booster on and set contrast (BB1=C5, DB0=C4)<br />WriteIns(0x72); //Set contrast (DB3-DB0=C3-C0)<br />WriteIns(0x38); //8-Bit data length extension Bit RE=0; IS=0<br /><br />ClrDisplay();<br />DisplayOnOff(DISPLAY_ON | CURSOR_ON | BLINK_ON);<br />}<br />//---------------------------------------------------------------<br />// Data direction OUT<br />//---------------------------------------------------------------<br />static inline void DataDirOut(void)<br />{<br />DDRA |= D0|D1|D2;  // all outputs<br />DDRB |= D3|D4|D5|D6|D7;   // all outputs<br />}<br />//---------------------------------------------------------------<br />// Data direction IN<br />//---------------------------------------------------------------<br />static inline void DataDirIn(void)<br />{<br />DDRA &amp;= ~(D0|D1|D2);  // all inputs<br />DDRB &amp;= ~(D3|D4|D5|D6|D7);   // all inputs<br />}<br />//-----------------------------------------------------<br />//Func: WriteChar(character)<br />//Desc: sends a single character to display<br />//-----------------------------------------------------<br />void WriteChar (char character)<br />{<br />WriteData(character);<br />}<br /><br />//-----------------------------------------------------<br />//Func: WriteString(string)<br />//Desc: sends a string to display,<br />//-----------------------------------------------------<br />void WriteString(char *string)<br />{<br />while(*string)<br />WriteData(*string++);<br /><br />//register char znak;<br />//while ( (znak=*(string++)) )<br />//WriteData( ( znak&gt;=0x80 &amp;&amp; znak&lt;=0x87 ) ? (znak &amp; 0x07) : znak);<br />}<br /><br />//-----------------------------------------------------<br />//Func: SetPostion(postion)<br />//Desc: set postion<br />//-----------------------------------------------------<br />void SetPostion(char pos)<br />{<br />WriteIns(LCD_HOME_L1+pos);<br />}<br /><br />//-----------------------------------------------------<br />//Func: DisplayOnOff(control)<br />//Desc: use definitions of header file to set display<br />//-----------------------------------------------------<br />void DisplayOnOff(char data)<br />{<br />WriteIns(0x08+data);<br />}<br /><br />//-----------------------------------------------------<br />//Func: DefineCharacter(memory postion, character data)<br />//Desc: stores an own defined character<br />//-----------------------------------------------------<br />void DefineCharacter(unsigned char postion, unsigned char *data)<br />{<br />unsigned char i=0;<br />WriteIns(0x40+8*postion);<br /><br />for (i=0; i&lt;8; i++)<br />{<br />WriteData(data&#91;i&#93;);<br />}<br />SetPostion(LINE1);<br />}<br />//-----------------------------------------------------<br />//Func: ClrDisplay<br />//Desc: Clears entire Display content and set home pos<br />//-----------------------------------------------------<br />void ClrDisplay(void)<br />{<br />WriteIns(0x01);<br />SetPostion(LINE1);<br />}<br /><br />//-----------------------------------------------------<br />//Func: SetContrast<br />//Desc: Sets contrast 0..63<br />//-----------------------------------------------------<br />void SetContrast(unsigned char contr)<br />{<br />WriteIns(0x39);<br />WriteIns(0x54 | (contr &gt;&gt; 4));<br />WriteIns(0x70 | (contr &amp; 0x0F));<br />WriteIns(0x38);<br />_delay_ms(25);<br />}<br /><br />//-----------------------------------------------------<br />//Func: SetView<br />//Desc: view bottom view(0x06), top view (0x05)<br />//-----------------------------------------------------<br />void SetView(unsigned char view)<br />{<br />WriteIns(0x3A);<br />WriteIns(view);<br />WriteIns(0x38);<br />}<br /><br />//-----------------------------------------------------<br />//Func: SetROM<br />//Desc: Changes the Rom code (ROMA=0x00, ROMB=0x04, ROMC=0x0C)<br />//---------------------------------------------------<br />void SetROM (unsigned char rom)<br />{<br />WriteIns(0x3A);<br />WriteIns(0x72);<br />WriteData(rom);<br />WriteIns(0x38);<br />}<br /><br />//------------------------------------------------------<br />// Wysłanie bajtu do LCD (D0..D7)<br />//------------------------------------------------------<br />static inline void SendData(uint16_t data)<br />{<br />if (data&amp;(1&lt;&lt;0)) PORTA |= D0; else PORTA &amp;= ~D0;<br />if (data&amp;(1&lt;&lt;1)) PORTA |= D1; else PORTA &amp;= ~D1;<br />if (data&amp;(1&lt;&lt;2)) PORTA |= D2; else PORTA &amp;= ~D2;<br />if (data&amp;(1&lt;&lt;3)) PORTB |= D3; else PORTB &amp;= ~D3;<br />if (data&amp;(1&lt;&lt;4)) PORTB |= D4; else PORTB &amp;= ~D4;<br />if (data&amp;(1&lt;&lt;5)) PORTB |= D5; else PORTB &amp;= ~D5;<br />if (data&amp;(1&lt;&lt;6)) PORTB |= D6; else PORTB &amp;= ~D6;<br />if (data&amp;(1&lt;&lt;7)) PORTB |= D7; else PORTB &amp;= ~D7;<br />}<br /><br />//----------------------------------------------------<br />// Odczyt bajtu z LCD (D0..D7)<br />//----------------------------------------------------<br />static inline uint16_t CheckData(void)<br />{<br />uint16_t result=0;<br /><br />DataDirIn();<br /><br />if(PINA&amp;D0) result |= (1&lt;&lt;0);<br />if(PINA&amp;D1) result |= (1&lt;&lt;1);<br />if(PINA&amp;D2) result |= (1&lt;&lt;2);<br />if(PINB&amp;D3) result |= (1&lt;&lt;3);<br />if(PINB&amp;D4) result |= (1&lt;&lt;4);<br />if(PINB&amp;D5) result |= (1&lt;&lt;5);<br />if(PINB&amp;D6) result |= (1&lt;&lt;6);<br />if(PINB&amp;D7) result |= (1&lt;&lt;7);<br /><br />DataDirOut();<br /><br />return result;<br />}<br />//#endif<br />//-----------------------------------------------------<br />//Func: WriteIns(instruction)<br />//Desc: sends instruction to display<br />//-----------------------------------------------------<br />void WriteIns(char ins)<br />{<br />CLR_RS;<br />CLR_RW;<br /><br />SendData(ins);<br /><br />SET_EN;<br />_delay_us(100);<br />CLR_EN;<br /><br />while( (CheckBF() &amp; 0x80) );<br />}<br /><br />//-----------------------------------------------------<br />//Func: WriteData(data)<br />//Desc: sends data to display<br />//-----------------------------------------------------<br />void WriteData(char _data)<br />{<br />SET_RS;<br />CLR_RW;<br /><br />SendData(_data);<br /><br />SET_EN;<br />_delay_us(100);<br />CLR_EN;<br /><br />while( (CheckBF() &amp; 0x80) );<br />}<br /><br />//-----------------------------------------------------<br />//Func: CheckBF()<br />//Desc: reads data<br />//-----------------------------------------------------<br />unsigned char CheckBF(void)<br />{<br />CLR_RS;<br />SET_RW;<br /><br />SET_EN;<br />return CheckData();<br />CLR_EN;<br />}[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=815">piotr_for</a> — 31 paź 2017, o 20:47</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[wat1970]]></name></author>
<updated>2017-10-31T20:27:51+01:00</updated>
<published>2017-10-31T20:27:51+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19503&amp;p=198130#p198130</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19503&amp;p=198130#p198130"/>
<title type="html"><![CDATA[Re: Brak tekstu na LCD 20 x 4 DOGM204A]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19503&amp;p=198130#p198130"><![CDATA[
Kurcze mój ulubiony wyświetlacz LCD, szybki jak wiatr i subtelny jak poranna rosa <img src="https://forum.atnel.pl/images/smilies/icon_e_smile.gif" alt=":)" title="Szczęśliwy" /> zerknij tutaj może coś pomocnego znajdziesz szczególnie w kodzie.<br /><!-- m --><a class="postlink" href="https://strefapic.blogspot.com/2017/05/wyswietlacz-lcd-matrycowo-punktowy-482.html" >https://strefapic.blogspot.com/2017/05/ ... y-482.html</a><!-- m --><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2179">wat1970</a> — 31 paź 2017, o 20:27</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[anshar]]></name></author>
<updated>2017-10-31T20:16:19+01:00</updated>
<published>2017-10-31T20:16:19+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19503&amp;p=198129#p198129</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19503&amp;p=198129#p198129"/>
<title type="html"><![CDATA[Re: Brak tekstu na LCD 20 x 4 DOGM204A]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19503&amp;p=198129#p198129"><![CDATA[
Odpaliłem ten wyświetlacz na I2C. Ważne jest by prawidłowo ustawić: Bias, OscFreq i kontrast.<br />Podłączyłeś wszystko prawidłowo?<br /><a href="https://obrazkiforum.atnel.pl/7157/dd5457ba972484d0099cddcc6c8b83fb.jpeg"  class="postlink"><img src="https://obrazkiforum.atnel.pl/thumb/7157/dd5457ba972484d0099cddcc6c8b83fb.jpeg" alt="Obrazek" /></a><br />Sprawdź wszystkie połączenia jeszcze raz na spokojnie, bo większość problemów z tymi wyświetlaczami to głównie strona sprzętowa. Szczególnie ważne są te kondensatory, bez nich niestety nie da rady.  <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /> <br />Następnie pokaż kod, bo tak to wróżenie z fusów.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7157">anshar</a> — 31 paź 2017, o 20:16</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[piotr_for]]></name></author>
<updated>2017-10-31T19:35:40+01:00</updated>
<published>2017-10-31T19:35:40+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19503&amp;p=198128#p198128</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19503&amp;p=198128#p198128"/>
<title type="html"><![CDATA[Re: Brak tekstu na LCD 20 x 4 DOGM204A]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19503&amp;p=198128#p198128"><![CDATA[
8-bit<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=815">piotr_for</a> — 31 paź 2017, o 19:35</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[anshar]]></name></author>
<updated>2017-10-31T19:19:03+01:00</updated>
<published>2017-10-31T19:19:03+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19503&amp;p=198125#p198125</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19503&amp;p=198125#p198125"/>
<title type="html"><![CDATA[Re: Brak tekstu na LCD 20 x 4 DOGM204A]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19503&amp;p=198125#p198125"><![CDATA[
Na SPI czy na I2C?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7157">anshar</a> — 31 paź 2017, o 19:19</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[piotr_for]]></name></author>
<updated>2017-10-31T16:20:04+01:00</updated>
<published>2017-10-31T16:20:04+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19503&amp;p=198109#p198109</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19503&amp;p=198109#p198109"/>
<title type="html"><![CDATA[Brak tekstu na LCD 20 x 4 DOGM204A]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19503&amp;p=198109#p198109"><![CDATA[
Jaki może być powód braku wyświetlania znaków, podczas gdy kursor jest obecny i ustawia się dokładnie w miejscu gdzie tekst powinien się kończyć? uC Atmega32, wyświetlacz DOGM204A oparty na SSD1803A. Inicjalizacja ok, instrukcje są wykonywane, ale nie ma tekstu. Czy ma ktoś doświadczenie z tymi wyświetlaczami?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=815">piotr_for</a> — 31 paź 2017, o 16:20</p><hr />
]]></content>
</entry>
</feed>