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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2015-05-14T19:51:31+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=4&amp;t=11697&amp;mode</id>
<entry>
<author><name><![CDATA[KoWaL]]></name></author>
<updated>2015-05-14T19:51:31+01:00</updated>
<published>2015-05-14T19:51:31+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=11697&amp;p=129186#p129186</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=11697&amp;p=129186#p129186"/>
<title type="html"><![CDATA[Re: Brak wyświetlania daty z WiFi NTP]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=11697&amp;p=129186#p129186"><![CDATA[
O.O nie mogę uwierzyć że takiego małego babola popełniłem <img src="https://forum.atnel.pl/images/smilies/icon_e_smile.gif" alt=":)" title="Szczęśliwy" /><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2114">KoWaL</a> — 14 maja 2015, o 19:51</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[anshar]]></name></author>
<updated>2015-05-14T19:05:02+01:00</updated>
<published>2015-05-14T19:05:02+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=11697&amp;p=129180#p129180</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=11697&amp;p=129180#p129180"/>
<title type="html"><![CDATA[Re: Brak wyświetlania daty z WiFi NTP]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=11697&amp;p=129180#p129180"><![CDATA[
Popraw kod!<br />Na:<br /><br />[syntax=c]if(!strncasecmp(&quot;+ok=&quot;, buf, 4)){[/syntax]<br /><br />oraz<br />[syntax=c]ISR( TIMER2_COMP_vect ) {<br />             uint16_t n;[/syntax]<br /><br />Pozdrawiam<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7157">anshar</a> — 14 maja 2015, o 19:05</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[KoWaL]]></name></author>
<updated>2015-05-14T17:16:54+01:00</updated>
<published>2015-05-14T17:16:54+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=11697&amp;p=129169#p129169</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=11697&amp;p=129169#p129169"/>
<title type="html"><![CDATA[Re: Brak wyświetlania daty z WiFi NTP]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=11697&amp;p=129169#p129169"><![CDATA[
Tylko czy wtedy wyświetlałoby poprawnie w putty w terminalu a na procku już nie?<br />(Na putty dostaję poprawną odpowiedź)<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2114">KoWaL</a> — 14 maja 2015, o 17:16</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2015-05-14T17:08:47+01:00</updated>
<published>2015-05-14T17:08:47+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=11697&amp;p=129165#p129165</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=11697&amp;p=129165#p129165"/>
<title type="html"><![CDATA[Re: Brak wyświetlania daty z WiFi NTP]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=11697&amp;p=129165#p129165"><![CDATA[
Najpierw to ty sprawdz czy twoj dostawca internetu albo twoj router nie wycina pakietow ntp<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 14 maja 2015, o 17:08</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[KoWaL]]></name></author>
<updated>2015-05-14T17:03:23+01:00</updated>
<published>2015-05-14T17:03:23+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=11697&amp;p=129164#p129164</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=11697&amp;p=129164#p129164"/>
<title type="html"><![CDATA[Brak wyświetlania daty z WiFi NTP]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=11697&amp;p=129164#p129164"><![CDATA[
Witam,<br />Mam problem z wyświetleniem daty na lcd(pin z wifi RX-PD1   TX-PD0) na PUTTY wyświetla normalnie procek to ATmega32 na zestawie atb 1.03.<br />Kończę 3-cią część poradnika o dawcy czasu i jeśli wszystko jest ok to powinno się wyświetlić a cały czas pokazuje siętylko napis start...<br /><br />kod:<br />[syntax=c]#include &lt;avr/io.h&gt;<br />#include &lt;util/delay.h&gt;<br />#include &lt;avr/interrupt.h&gt;<br />#include &lt;avr/wdt.h&gt;<br />#include &lt;stdlib.h&gt;<br />#include &lt;string.h&gt;<br /><br /><br />#include &quot;LCD/lcd44780.h&quot;<br />#include &quot;MK_USART/mkuart.h&quot;<br /><br />// definicje dla preprocesora<br />#define LCD (1&lt;&lt;PA7)// definicja pinu do którego podłączona jest dioda<br />#define LCD_OFF PORTA &amp;= ~LCD// makrodefinicja – załączenie diody<br />#define LCD_ON PORTA |= LCD// makrodefinicja – wyłączenie diody<br />#define LCD_TOG PORTA ^= LCD// makrodefinicja – zmiana stanu diody<br />#define LED (1&lt;&lt;PC6)<br />#define LED_TOG PORTC ^= LED<br /><br /><br /><br />volatile uint16_t Timer1,Timer2;<br />char uart_buf&#91;80&#93;;<br />uint8_t get_time;<br />uint8_t actual_at_cmd;<br /><br />enum{_none, _at_gmt};<br /><br />void parse_rs232(char * buf);<br /><br />// ********************************************************* 1-sza wersja<br />int main(void)<br />{<br />// ****** inicjalizacja *********<br />DDRA |= LCD;// kierunek pinu PC7 – wyjściowy<br />DDRC |= LED;<br />lcd_init();<br />USART_Init(__UBRR);<br />LCD_ON;<br />LED_TOG;<br /><br /><br />// ustawienia TIMER2 w tryb CTC<br />TCCR2 |= (1&lt;&lt;WGM21);// tryb  CTC<br />TCCR2 |= (1&lt;&lt;CS22)|(1&lt;&lt;CS21)|(1&lt;&lt;CS20);// preskaler = 1024<br />OCR2 = 107;// przerwanie co 10ms<br />TIMSK |= (1&lt;&lt;OCIE2);// zezwolenie na przerwanie CompareMatch<br /><br /><br /><br /><br />register_uart_str_rx_event_callback( parse_rs232 );<br />// ****** pętla główna programu  *********<br />lcd_str(&quot;start...&quot;);<br />sei();<br />while(1)<br />{<br /><br />UART_RX_STR_EVENT(uart_buf);<br /><br />if(!Timer1){<br />LED_TOG;<br />Timer1=50;<br />}<br /><br /><br />if(!Timer2){<br /><br />switch (get_time){<br />case 0 ... 2: uart_puts(&quot;+&quot;); break;<br />case 3: uart_puts(&quot;a&quot;); break;<br />case 5: actual_at_cmd = _at_gmt; uart_puts(&quot;AT+GMT=2\r&quot;); break;<br />case 10: uart_puts(&quot;AT+ENTM\r&quot;); break;<br />}<br /><br />get_time++;<br />if(get_time&gt;100) get_time=0;<br />Timer2=10;<br />}<br /><br /><br /><br /><br /><br />}<br />}<br /><br /><br />void parse_rs232(char * buf){<br /><br />if(!buf&#91;0&#93;)return;<br />//uint8_t MM,DD,gg,mm,ss;<br />//uint16_t YY;<br /><br />char * dt;<br />char * tm;<br /><br />if(_at_gmt == actual_at_cmd){<br /><br />if(!strncasecmp(&quot;+ok&quot;, buf, 4)){<br />dt = strtok(buf,&quot;=&quot;);<br />dt = strtok(NULL,&quot; &quot;);<br />tm = strtok(NULL,&quot; &quot;);<br />if(10 == strlen(dt) &amp;&amp; 8 == strlen (tm)) {<br /><br />lcd_locate(0,0);<br />lcd_str(dt);<br />lcd_locate(1,0);<br />lcd_str(tm);<br /><br />//YY = atoi(strtok(dt,&quot;-&quot;));<br />//MM = atoi(strtok(NULL,&quot;-&quot;));<br />//DD = atoi(strtok(NULL,&quot;-&quot;));<br />//<br />//gg = atoi(strtok(tm,&quot;:&quot;));<br />//mm = atoi(strtok(NULL,&quot;:&quot;));<br />//ss = atoi(strtok(NULL,&quot;:&quot;));<br /><br />//ustaw_czas(gg, mm, ss);<br /><br /><br /><br />}<br /><br />}<br /><br />}<br /><br />if(!strncasecmp(&quot;AT+RST?&quot;, buf, 7)){<br />cli();<br />wdt_enable(0);<br />while(1);<br />}<br /><br />}<br /><br /><br />ISR( TIMER2_COMP_vect ) {<br /> uint8_t n;<br /><br />n = Timer1;<br />if (n) Timer1 = --n;<br />n = Timer2;<br />if (n) Timer2 = --n;<br />}[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2114">KoWaL</a> — 14 maja 2015, o 17:03</p><hr />
]]></content>
</entry>
</feed>