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

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

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=12&amp;t=10875&amp;mode</id>
<entry>
<author><name><![CDATA[jaremka75]]></name></author>
<updated>2015-05-31T19:31:19+01:00</updated>
<published>2015-05-31T19:31:19+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=130521#p130521</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=130521#p130521"/>
<title type="html"><![CDATA[Re: Zmiany w progranie zegara AVT 5022]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=130521#p130521"><![CDATA[
Pokazuje cyfrę 5 lub  9 było też 2 na wyświetlaczu różne miejsca podczas impulsu godziny. impuls u mnie ten trwa 900 milisekund. To się dzieje jak zmieniłem czas impulsu do 900 ms .Układ działa bez problemów tylko że wyświetlacze zwiększają jasność na czas impulsu. <br /><br />Zauważyłem jeszcze rok 2015 pokazuje jako 05 . i nie da się da ustawić. Autor pisał o tym że może pojawić taki błąd ale w roku 2101 , wynika że to dotyczy już roku 2011.  <br /><br />Można wyłączyć wyświetlanie roku<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=5750">jaremka75</a> — 31 maja 2015, o 19:31</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[majster]]></name></author>
<updated>2015-03-08T17:15:10+01:00</updated>
<published>2015-03-08T17:15:10+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=122615#p122615</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=122615#p122615"/>
<title type="html"><![CDATA[Re: Zmiany w progranie zegara AVT 5022]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=122615#p122615"><![CDATA[
jaremka75 to może lepiej uczyć się C ? wg mnie jest prostrzy do opanowania.<br /><br /><strong><span style="color: #808000">------------------------ [ Dodano po: kilkunastu sekundach ]</span></strong><br /><br />ps fajny avatar<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1628">majster</a> — 8 mar 2015, o 17:15</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[jaremka75]]></name></author>
<updated>2015-03-08T17:10:33+01:00</updated>
<published>2015-03-08T17:10:33+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=122613#p122613</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=122613#p122613"/>
<title type="html"><![CDATA[Re: Zmiany w progranie zegara AVT 5022]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=122613#p122613"><![CDATA[
Nie zaprzeczam , tego akurat nie wiem, jakbym wiedział to bym nie szukał pomocy.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=5750">jaremka75</a> — 8 mar 2015, o 17:10</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[majster]]></name></author>
<updated>2015-03-05T17:58:47+01:00</updated>
<published>2015-03-05T17:58:47+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=122102#p122102</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=122102#p122102"/>
<title type="html"><![CDATA[Re: Zmiany w progranie zegara AVT 5022]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=122102#p122102"><![CDATA[
<div class="quotetitle">jaremka75 napisał(a):</div><div class="quotecontent"><br />Wiem od czego mam zacząć program nie wiem jak dalej się za niego zabrać, znam bascoma nie za bardzo, dam radę przerobić gotowe proste programy i je napisać.<br /></div><br /><br />Koledze chodzilo o to ze tym postem zaprzeczasz temu o co pytasz.<br /><br />Namazane ze smarta.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1628">majster</a> — 5 mar 2015, o 17:58</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[jaremka75]]></name></author>
<updated>2015-03-05T16:09:36+01:00</updated>
<published>2015-03-05T16:09:36+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=122084#p122084</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=122084#p122084"/>
<title type="html"><![CDATA[Re: Zmiany w progranie zegara AVT 5022]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=122084#p122084"><![CDATA[
<div class="quotetitle">pikczu napisał(a):</div><div class="quotecontent"><br />Zaprzeczasz sam sobie.<br />Nie potrafisz skonfigurowac dwóch pinów i dodac moze 10 liniej kodu do programu.<br /></div><br /><br />Logiczne chyba : Jeśli bym wiedział jak to bym nie pytał się na forum.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=5750">jaremka75</a> — 5 mar 2015, o 16:09</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[pikczu]]></name></author>
<updated>2015-03-04T00:49:48+01:00</updated>
<published>2015-03-04T00:49:48+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121862#p121862</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121862#p121862"/>
<title type="html"><![CDATA[Re: Zmiany w progranie zegara AVT 5022]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121862#p121862"><![CDATA[
Zaprzeczasz sam sobie.<br />Nie potrafisz skonfigurowac dwóch pinów i dodac moze 10 liniej kodu do programu.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=154">pikczu</a> — 4 mar 2015, o 00:49</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[jaremka75]]></name></author>
<updated>2015-03-02T18:05:33+01:00</updated>
<published>2015-03-02T18:05:33+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121643#p121643</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121643#p121643"/>
<title type="html"><![CDATA[Re: Zmiany w progranie zegara AVT 5022]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121643#p121643"><![CDATA[
Wiem od czego mam zacząć program nie wiem jak dalej się za niego zabrać, znam bascoma nie za bardzo, dam radę przerobić gotowe proste programy i je napisać . <br />Impulsy mają trwać ok. 1 sek, ma tylko podać impuls do rejestru przesuwnego do układu wskazującego dni tygodnia, zmiana ustawień będę zmieniał dodatkowym przyciskiem.Tak samo dla załączania generatora dźwięku informującego o pełnej godzinie. Kod jaki  dostałem z AVT to wersja ( nazwa pliku )AVT5022V4DS .<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=5750">jaremka75</a> — 2 mar 2015, o 18:05</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[pikczu]]></name></author>
<updated>2015-03-01T22:10:37+01:00</updated>
<published>2015-03-01T22:10:37+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121549#p121549</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121549#p121549"/>
<title type="html"><![CDATA[Re: Zmiany w progranie zegara AVT 5022]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121549#p121549"><![CDATA[
Dodam tylko kod został napisany przez Pana Zbigniewa Raabe.<br />Czyli prawie 14 lat temu od tego czasu w bascomie doszły poważne udogodnienia i zmiany.<br />jaremka75 Jak długo mają trwać te impulsy ? nikt tu w myślach nie czyta.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=154">pikczu</a> — 1 mar 2015, o 22:10</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[jaremka75]]></name></author>
<updated>2015-03-01T19:28:09+01:00</updated>
<published>2015-03-01T19:28:09+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121492#p121492</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121492#p121492"/>
<title type="html"><![CDATA[Re: Zmiany w progranie zegara AVT 5022]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121492#p121492"><![CDATA[
Po co stosować zewnętrzny RTC jeśli w układzie zastosowano wewnętrzny zegar na kwarcu zegarkowym 32768 Hz.<br />W opisie na stronie 34 pisze &quot; Ważnym elementem układu jest złącze magistrali I2C - CON10. Umożliwia ono dołączenie do zegara dodatkowych wyświetlaczy, np. modułów AVT-859 o wysokości 57 mm.&quot; Nie będę stosował tego modułu. Wiec myślę że we wyjścia można wykorzystać do tego.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=5750">jaremka75</a> — 1 mar 2015, o 19:28</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[kaka0204]]></name></author>
<updated>2015-03-01T18:25:30+01:00</updated>
<published>2015-03-01T18:25:30+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121483#p121483</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121483#p121483"/>
<title type="html"><![CDATA[Re: Zmiany w progranie zegara AVT 5022]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121483#p121483"><![CDATA[
Do niczego nie są podłączone. Wyprowadzone są na gniazdo, po ta, aby można buło podłączyć zewnętrzny RTC.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=889">kaka0204</a> — 1 mar 2015, o 18:25</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[jaremka75]]></name></author>
<updated>2015-03-01T19:30:07+01:00</updated>
<published>2015-03-01T17:38:50+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121482#p121482</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121482#p121482"/>
<title type="html"><![CDATA[Re: Zmiany w progranie zegara AVT 5022]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121482#p121482"><![CDATA[
Do komunikacji z odbiornikiem DCF jest wykorzystany port PD2. Porty PD.0 i PD.1 są podłączone do plusa zasliania przez rezystor 4,7 k na schemacie R27 i R28<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=5750">jaremka75</a> — 1 mar 2015, o 17:38</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[majster]]></name></author>
<updated>2015-03-01T15:13:49+01:00</updated>
<published>2015-03-01T15:13:49+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121463#p121463</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121463#p121463"/>
<title type="html"><![CDATA[Re: Zmiany w progranie zegara AVT 5022]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121463#p121463"><![CDATA[
PD0 i PD1 są używane do DCFA<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1628">majster</a> — 1 mar 2015, o 15:13</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[jaremka75]]></name></author>
<updated>2015-03-01T13:22:37+01:00</updated>
<published>2015-03-01T13:22:37+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121453#p121453</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121453#p121453"/>
<title type="html"><![CDATA[Zmiany w progranie zegara AVT 5022]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10875&amp;p=121453#p121453"><![CDATA[
Chciałbym zmienić kod zegara tak żeby na wyjściach PD.0 podawał impuls na pełną godzinę i na PD.1 podał impuls na pojawianie się godziny 0:00:00 , do układu pokazującego dni tygodnia.<br />W programie te porty są wpisane jako sda i scl można je wykorzystać są nie używane.<br />Dodaje też schemat .<br /><br />[syntax=basic4gl]'DS<br />$regfile = &quot;m8535.dat&quot;<br />$crystal = 8000000<br />Config Clock = Soft , Gosub = Sectic<br />Config Sda = Portd.1<br />Config Scl = Portd.0<br />Config Timer1 = Timer , Prescale = 64<br />Config Timer0 = Timer , Prescale = 64<br />On Timer1 Dcf_start<br />On Timer0 Multiplexing<br /><br />Dim Reset_seconds_flag As Bit<br />Dim Temp3 As Byte<br />Dim Disp1 As Byte<br />Dim Disp2 As Byte<br />Dim Disp3 As Byte<br />Dim Temp As Byte<br />Dim Digit_number As Byte<br />Dim Dcf_receiving_flag As Bit<br />Dim Dcf_bit As Bit<br />Dim Dcf_counter As Byte<br />Dim Dcf_min As Byte<br />Dim Dcf_hour As Byte<br />Dim Dcf_month As Byte<br />Dim Dcf_year As Byte<br />Dim Dcf_day As Byte<br />Dim Dcf_temp As Byte<br />Dim Week_day As Byte<br />Dim Dcf_flag As Byte<br />Dim Start_dcf_flag As Bit<br />Dim Pause_counter As Byte<br />Dim Alarm_hours As Byte<br />Dim Alarm_minutes As Byte<br />Dim Week_alarm_hours As Byte<br />Dim Week_alarm_minutes As Byte<br />Dim Timer_minutes As Byte<br />Dim Timer_seconds As Byte<br />Dim Timer_hours As Byte<br />Dim Meas_hours As Byte<br />Dim Meas_minutes As Byte<br />Dim Meas_seconds As Byte<br />Dim Meas_flag As Bit<br />Dim Display_type As Byte<br />Dim Eeprom_address As Word<br />Dim Time_set_flag As Bit<br />Dim Alarm_set_flag As Bit<br />Dim Week_alarm_set_flag As Bit<br />Dim Timer_set_flag As Bit<br />Dim Date_set_flag As Bit<br />Dim Alarm_on_flag As Bit<br />Dim Week_alarm_on_flag As Bit<br />Dim Timer_on_flag As Bit<br />Dim Flash_flag As Bit<br />Dim R As Byte<br />Dim Temp2 As Byte<br />Dim X As Byte<br />Dim Alarm_counter As Byte<br />Dim Week_alarm_counter As Byte<br />Dim Alarm_counter_flag As Bit<br />Dim Parity_bit As Bit<br />Dim Parity_check As Bit<br />Dim Flag As Bit<br />'----------------------------------<br />'zmienne zabezpieczeń syncho<br />Dim Ds_temp As Byte<br />Dim Ds_status As Byte<br />'ds_status = 2 zeby po włączeniu się synchronizował<br />Ds_status = 2<br />'-----------------------------------<br />Declare Sub Display_time<br />Declare Sub Display_date<br />Declare Sub Display_timer<br />Declare Sub Display_alarm<br />Declare Sub Display_week_alarm<br />Declare Sub Beep<br />Declare Sub Short_beep<br />Declare Sub Time_meas<br /><br />Declare Sub Temperature<br />Declare Sub Read1820<br /><br />Config Portc = Output<br />Config Porta = Output<br />Config Pind.4 = Output<br />Config Pinb.0 = Output<br />Config Pinb.1 = Output<br />Config Pinb.2 = Output<br />Config Pinb.3 = Output<br />Config Pinb.4 = Output<br />Config Pinb.5 = Output<br />Config Pind.5 = Output<br />Config Pind.6 = Output<br /><br /><br />Reset Flag<br /><br />Set Flag<br /><br />If _hour = 1 Then<br />  Enable Int0<br />Else<br />  Disable Int0<br />End If<br /><br />Config Int0 = Falling<br />Enable Int0<br />On Int0 Dcf<br />Enable Timer0<br />Enable Timer1<br />Enable Interrupts<br />Start Timer0<br />Start Timer1<br />Digit_number = 1<br />Dcf_receiving_flag = 1<br /><br />'DCF - PORTD.2<br />' klawisze - PORTB.0 ... PORTB.5<br /> Set Portd.4<br /><br /><br /><br /><br /><br />Reset Portd.5 : Reset Portd.6<br />Time_set_flag = 0<br />Date_set_flag = 0<br />Timer_on_flag = 0<br /><br />'KLAWIATURA<br />' CHANGE FUNCTION           START/ENTER                     ON/+<br />' STOP                                      RESET                                   OFF/-<br />Display_time<br /><br />If _hour = 1 Then<br />  Enable Int0<br />Else<br />  Disable Int0<br />End If<br /><br />Sub Display_time<br />Display_type = 1<br />Short_beep<br />Do<br />Disp1 = _sec<br />Disp2 = _min<br />Disp3 = _hour<br />Reset Portb.0<br />If Pinb.0 = 1 Then Display_date<br />Reset Portb.2 : Reset Portb.5<br />If Pinb.2 = 1 And Pinb.5 = 1 And Time_set_flag = 0 Then<br />For R = 1 To 3<br />Beep<br />Next R<br />Time_set_flag = 1<br />End If<br />Reset Portb.2<br />If Pinb.2 = 1 And Time_set_flag = 1 Then<br />Incr _min<br />If _min = 60 Then _min = 0<br />Short_beep<br />End If<br />Reset Portb.5<br />If Pinb.5 = 1 And Time_set_flag = 1 Then<br />Incr _hour<br />If _hour = 24 Then _hour = 0<br />Short_beep<br />End If<br />Reset Portb.1<br />If Pinb.1 = 1 And Time_set_flag = 1 Then<br />_sec = 0<br />Time_set_flag = 0<br />Beep<br />End If<br />  X = Makebcd(_hour)<br />         I2csend 112 , X<br />  X = Makebcd(_min)<br />         I2csend 114 , X<br />  X = Makebcd(_sec)<br />         I2csend 116 , X<br />Loop<br />End Sub<br /><br />Sub Display_date<br />Display_type = 2<br />Short_beep<br />Do<br />Disp1 = _year<br />Disp2 = _month<br />Disp3 = _day<br />Reset Portb.0<br />If Pinb.0 = 1 Then Display_alarm<br /><br />Reset Portb.2 : Reset Portb.5<br />If Pinb.2 = 1 And Pinb.5 = 1 And Date_set_flag = 0 Then<br />For R = 1 To 3<br />Beep<br />Next R<br />Date_set_flag = 1<br />End If<br />Reset Portb.2<br />If Pinb.2 = 1 And Date_set_flag = 1 Then<br />Incr _day<br />If _day = 32 Then _day = 1<br />Short_beep<br />End If<br />Reset Portb.5<br />If Pinb.5 = 1 And Date_set_flag = 1 Then<br />Incr _month<br />If _month = 13 Then _month = 1<br />Short_beep<br />End If<br />Reset Portb.1<br />If Pinb.1 = 1 And Date_set_flag = 1 Then<br />Date_set_flag = 0<br />Beep<br />End If<br />  X = Makebcd(_day)<br />         I2csend 112 , X<br />  X = Makebcd(_month)<br />         I2csend 114 , X<br />  X = Makebcd(_sec)<br />         I2csend 116 , X<br />Loop<br />End Sub<br /><br />Sub Display_alarm<br />Readeeprom Alarm_hours , 3<br />If Alarm_hours &gt; 23 Then Alarm_hours = 0<br />Readeeprom Alarm_minutes , 4<br />If Alarm_minutes &gt; 59 Then Alarm_minutes = 0<br />Display_type = 3<br />Short_beep<br />Do<br />Disp1 = Alarm_minutes<br />Disp2 = Alarm_hours<br />Reset Portb.0<br />If Pinb.0 = 1 Then Display_week_alarm<br />Reset Portb.2 : Reset Portb.5<br />If Pinb.2 = 1 And Pinb.5 = 1 And Alarm_set_flag = 0 Then<br />For R = 1 To 3<br />Beep<br />Next R<br />Alarm_set_flag = 1<br />End If<br />Reset Portb.2<br />If Pinb.2 = 1 And Alarm_set_flag = 1 Then<br />Incr Alarm_minutes<br />If Alarm_minutes = 60 Then Alarm_minutes = 0<br />Short_beep<br />End If<br />Reset Portb.5<br />If Pinb.5 = 1 And Alarm_set_flag = 1 Then<br />Incr Alarm_hours<br />If Alarm_hours = 24 Then Alarm_hours = 0<br />Short_beep<br />End If<br />Reset Portb.1<br />If Pinb.1 = 1 And Alarm_set_flag = 1 Then<br />Alarm_set_flag = 0<br />Writeeeprom Alarm_hours , 3<br />Writeeeprom Alarm_minutes , 4<br />Beep<br />End If<br />Reset Portb.1<br />If Pinb.1 = 1 Then<br />Alarm_on_flag = Not Alarm_on_flag<br />Short_beep<br />End If<br />Loop<br />End Sub<br /><br />Sub Display_week_alarm<br />Readeeprom Week_alarm_hours , 1<br />If Week_alarm_hours &gt; 23 Then Week_alarm_hours = 0<br />Readeeprom Week_alarm_minutes , 2<br />If Week_alarm_minutes &gt; 59 Then Week_alarm_minutes = 0<br />Display_type = 4<br />Short_beep<br />Do<br />Disp1 = Week_alarm_minutes<br />Disp2 = Week_alarm_hours<br />Reset Portb.0<br />If Pinb.0 = 1 Then Display_timer<br />Reset Portb.2 : Reset Portb.5<br />If Pinb.2 = 1 And Pinb.5 = 1 And Week_alarm_set_flag = 0 Then<br />For R = 1 To 3<br />Beep<br />Next R<br />Week_alarm_set_flag = 1<br />End If<br />Reset Portb.2<br />If Pinb.2 = 1 And Week_alarm_set_flag = 1 Then<br />Short_beep<br />Incr Week_alarm_minutes<br />If Week_alarm_minutes = 60 Then Week_alarm_minutes = 0<br />End If<br />Reset Portb.5<br />If Pinb.5 = 1 And Week_alarm_set_flag = 1 Then<br />Short_beep<br />Incr Week_alarm_hours<br />If Week_alarm_hours = 24 Then Week_alarm_hours = 0<br />End If<br />Reset Portb.1<br />If Pinb.1 = 1 And Week_alarm_set_flag = 1 Then<br />Week_alarm_set_flag = 0<br />Writeeeprom Week_alarm_hours , 1<br />Writeeeprom Week_alarm_minutes , 2<br />Beep<br />End If<br />Reset Portb.1<br />If Pinb.1 = 1 Then<br />Week_alarm_on_flag = Not Week_alarm_on_flag<br />Short_beep<br />End If<br />Loop<br />End Sub<br /><br />Sub Display_timer<br />If Timer_on_flag = 0 Then<br />Readeeprom Timer_minutes , 6<br />If Timer_minutes &gt; 59 Then Timer_minutes = 0<br />Readeeprom Timer_seconds , 7<br />If Timer_seconds &gt; 59 Then Timer_seconds = 0<br />Readeeprom Timer_hours , 5<br />If Timer_hours &gt; 99 Then Timer_hours = 0<br />End If<br />Display_type = 5<br />Short_beep<br />Do<br />Disp3 = Timer_hours<br />Disp2 = Timer_minutes<br />Disp1 = Timer_seconds<br />Reset Portb.0<br />If Pinb.0 = 1 Then Call Time_meas<br />Reset Portb.2 : Reset Portb.5<br />If Pinb.2 = 1 And Pinb.5 = 1 And Timer_set_flag = 0 Then<br />For R = 1 To 3<br />Beep<br />Next R<br />Timer_set_flag = 1<br />End If<br />Reset Portb.2<br />If Pinb.2 = 1 And Timer_set_flag = 1 Then<br />Short_beep<br />Incr Timer_minutes<br />If Timer_minutes = 60 Then Timer_minutes = 0<br />End If<br />Reset Portb.5<br />If Pinb.5 = 1 And Timer_set_flag = 1 Then<br />Short_beep<br />Incr Timer_hours<br />If Timer_hours = 99 Then Timer_hours = 0<br />End If<br />Reset Portb.4<br />If Pinb.4 = 1 And Timer_set_flag = 1 Then<br />Short_beep<br />Incr Timer_seconds<br />If Timer_seconds = 60 Then Timer_seconds = 0<br />End If<br />Reset Portb.1<br />If Pinb.1 = 1 And Timer_set_flag = 1 Then<br />Timer_set_flag = 0<br />Writeeeprom Timer_hours , 5<br />Writeeeprom Timer_minutes , 6<br />Writeeeprom Timer_seconds , 7<br />Beep<br />End If<br />Reset Portb.1<br />If Pinb.1 = 1 And Timer_set_flag = 0 Then<br />Timer_on_flag = 1<br />Short_beep<br />End If<br />Reset Portb.3<br />If Pinb.3 = 1 Then<br />Timer_on_flag = 0<br />Short_beep<br />End If<br />Reset Portb.4<br />If Pinb.4 = 1 And Timer_set_flag = 0 Then<br />Timer_on_flag = 0<br />Display_timer<br />End If<br />Portd.5 = Timer_on_flag<br />Loop<br />End Sub<br /><br />Sub Time_meas<br />Display_type = 6<br />Short_beep<br />Do<br />Disp3 = Meas_hours<br />Disp2 = Meas_minutes<br />Disp1 = Meas_seconds<br />Reset Portb.1<br />If Pinb.1 = 1 Then<br />Meas_flag = 1<br />Short_beep<br />End If<br />Reset Portb.3<br />If Pinb.3 = 1 Then<br />Meas_flag = 0<br />Short_beep<br />End If<br />Reset Portb.4<br />If Pinb.4 = 1 Then<br />Meas_hours = 0<br />Meas_minutes = 0<br />Meas_seconds = 0<br />Short_beep<br />End If<br />Reset Portb.0<br />If Pinb.0 = 1 Then Display_time<br />Loop<br />End Sub<br /><br /><br /><br />Multiplexing:<br />Porta = 0<br />Portc = 255<br />Incr Digit_number<br />If Digit_number = 7 Then Digit_number = 1<br />Select Case Digit_number<br />Case 1:<br />'dziesiątki sekund<br />Temp = Disp1 / 10<br />Porta = Lookup(temp , 7segment)<br />If Display_type = 6 Then Set Porta.0<br /><br />Reset Portc.1<br />Case 2:<br />'sekundy<br />Temp = Disp1 / 10<br />Temp = Temp * 10<br />Temp = Disp1 - Temp<br />Porta = Lookup(temp , 7segment)<br />If Display_type = 4 And Week_alarm_on_flag = 1 And Flash_flag = 1 Then Set Porta.0<br />If Display_type = 3 And Alarm_on_flag = 1 And Flash_flag = 1 Then Set Porta.0<br />Reset Portc.0<br />Case 3:<br />'Dziesiątki Minut<br />Temp = Disp2 / 10<br />   Porta = Lookup(temp , 7segment)<br />If Display_type = 2 Then Set Porta.0<br />Reset Portc.3<br />Case 4:<br />'minuty<br />Temp = Disp2 / 10<br />Temp = Temp * 10<br />Temp = Disp2 - Temp<br /><br />Porta = Lookup(temp , 7segment)<br />If Display_type = 5 Then Set Porta.0<br />Reset Portc.2<br />Case 5:<br />'dziesiątki godzin<br />Temp = Disp3 / 10<br /><br />'eliminacjka pierwszego zera<br />If Temp = 0 Then<br />   Porta = 0<br />Else<br />   Porta = Lookup(temp , 7segment)<br />End If<br /><br />If Display_type = 3 Then Porta = 238<br />If Display_type = 4 Then Porta = 238<br />If Dcf_receiving_flag = 1 Then Porta = Porta + 1<br /><br />Reset Portc.5<br />Case 6:<br />'godziny<br />Temp = Disp3 / 10<br />Temp = Temp * 10<br />Temp = Disp3 - Temp<br />If Display_type = 3 Then Temp = 1<br />If Display_type = 4 Then Temp = 2<br />Porta = Lookup(temp , 7segment)<br />If Display_type = 1 Then Set Porta.0<br />Reset Portc.4<br />End Select<br />Portd.5 = Timer_on_flag<br />Reset Portb.4<br />If Pinb.4 = 1 Then Reset Portd.6<br />Return<br /><br />Sectic:<br />If Temp2 &lt;&gt; _min Then<br />Readeeprom Alarm_hours , 3<br />Readeeprom Alarm_minutes , 4<br />If Alarm_hours = _hour And Alarm_minutes = _min And Alarm_on_flag = 1 Then<br />Alarm_counter = 30<br />Alarm_counter_flag = 1<br />Set Portd.6<br /> End If<br />Readeeprom Week_alarm_hours , 1<br />Readeeprom Week_alarm_minutes , 2<br />If Week_alarm_hours = _hour And Week_alarm_minutes = _min And Week_alarm_on_flag = 1 And Week_day &lt; 6 Then<br />Alarm_counter = 15<br />Alarm_counter_flag = 1<br />Set Portd.6<br />End If<br />End If<br />If Meas_flag = 1 Then Incr Meas_seconds<br />If Meas_seconds = 60 Then<br />Meas_seconds = 0<br />Incr Meas_minutes<br />If Meas_minutes = 60 Then<br />Meas_minutes = 0<br />Incr Meas_hours<br />End If : End If<br />Flash_flag = Not Flash_flag<br />If Timer_on_flag = 1 Then<br />Decr Timer_seconds<br />If Timer_seconds = 255 Then<br />Decr Timer_minutes<br />Timer_seconds = 59<br />If Timer_minutes = 255 Then<br />Decr Timer_hours<br />Timer_minutes = 59<br />If Timer_hours = 255 Then<br />Timer_on_flag = 0<br />Readeeprom Timer_minutes , 6<br />If Timer_minutes &gt; 59 Then Timer_minutes = 0<br />Readeeprom Timer_seconds , 7<br />If Timer_seconds &gt; 59 Then Timer_seconds = 0<br />Readeeprom Timer_hours , 5<br />If Timer_hours &gt; 99 Then Timer_hours = 0<br />Beep<br />End If : End If : End If : End If<br />Temp2 = _min<br />If Alarm_counter_flag = 1 Then Decr Alarm_counter<br />If Alarm_counter = 0 Then Alarm_counter_flag = 0<br />If Alarm_counter_flag = 1 And Flash_flag = 1 Then<br />Reset Portd.4<br />Else<br />Set Portd.4<br />End If<br />Return<br /><br />7segment:<br />Data 252 , 96 , 218 , 242 , 102 , 182 , 190 , 224 , 254 , 246<br /><br />Dcf:<br />Pause_counter = 0<br />Dcf_flag = Not Dcf_flag<br />If Dcf_flag = 0 Then<br />Config Int0 = Rising<br />Dcf_receiving_flag = 1<br />Counter1 = 0<br />Start Timer1<br />Else<br />Stop Timer1<br />Config Int0 = Falling<br />Dcf_receiving_flag = 0<br />If Timer1 &lt; 18750 And Timer1 &gt; 6250 Then<br />Dcf_bit = 0<br />End If<br />If Timer1 &gt; 19000 And Timer1 &lt; 31250 Then<br />Dcf_bit = 1<br />End If<br />If Timer1 &lt; 6000 Then Start_dcf_flag = 0<br />If Timer1 &gt; 18750 And Timer1 &lt; 19000 Then Start_dcf_flag = 0<br />If Timer1 &gt; 31250 Then Start_dcf_flag = 0<br />Select Case Dcf_counter<br /><br />Case 0:<br />If Reset_seconds_flag = 1 Then<br />Reset_seconds_flag = 0<br />_sec = 0<br />_year = Dcf_temp<br />_month = Dcf_month<br />_day = Dcf_day<br />Dcf_temp = 0<br />'--------------------------------------------------------------------------------------------<br />'pierwszy bit sygnału dcf jest jednocześnie momentem synchronizacji zegara<br />'tu wprowadze warunki przed zakłóceniami<br />Ds_status.7 = 0<br />Ds_status.6 = 0<br />'synchronizuje godzinę tylko w trzech przypadkach<br />Ds_temp = _hour + 1<br />If Dcf_hour = _hour Or Dcf_hour = Ds_temp Then              'jesli godzina ta sama to jest ok<br />   _hour = Dcf_hour                                         'jesli godzina wieksza o 1 to jest ok<br />   Ds_status.7 = 1<br />End If<br />If _hour = 23 Then                                          'jesli godzina 23 a jest 0 to też ok<br />   If Dcf_hour = 0 Then<br />      _hour = Dcf_hour<br />      Ds_status.7 = 1<br />   End If<br />End If<br /><br />If Ds_status.7 = 1 Then<br />'tylko jeśli pozytywnie poszła synchronizacja godzin<br />'synchronizuje minutę tylko w trzech przypadkach<br />Ds_temp = _min + 1<br />If Dcf_min = _min Or Dcf_min = Ds_temp Then                 'jesli minuta ta sama to jest ok<br />   _min = Dcf_min                                           'jesli minuta wieksza o 1 to jest ok<br />   Ds_status.6 = 1<br />End If<br />If _min = 59 Then                                           'jesli godzina 23 a jest 0 to też ok<br />   If Dcf_min = 0 Then<br />      _min = Dcf_min<br />      Ds_status.6 = 1<br />   End If<br />End If<br />End If<br /><br />If Ds_status.7 = 1 And Ds_status.6 = 1 Then                 'jesli synchronizacja poszła pozytywnie<br />   Ds_status = 1                                            'to zeruje licznik błedów<br />Else                                                        'w przeciwnym razie<br />   Incr Ds_status                                           'zwiększa licznik błędów<br />End If<br /><br />If Ds_status.2 = 1 Then                                     'jesli były trzy nieudane próby synchronizacji<br />   _min = Dcf_min                                           'to synchronizuje warunkowo<br />   _hour = Dcf_hour<br />   Ds_status = 1<br />End If<br />'----------------------------------------------------------------------------------------------------<br />End If<br /><br />Case 21 :<br />Parity_bit = 1<br />Dcf_temp = 0<br />If Dcf_bit = 1 Then<br />Dcf_temp = 1<br />Parity_bit = Not Parity_bit<br />End If<br />Case 22 : If Dcf_bit = 1 Then<br />Dcf_temp = Dcf_temp + 2<br />Parity_bit = Not Parity_bit<br />End If<br />Case 23 : If Dcf_bit = 1 Then<br />Dcf_temp = Dcf_temp + 4<br />Parity_bit = Not Parity_bit<br />End If<br />Case 24 : If Dcf_bit = 1 Then<br />Dcf_temp = Dcf_temp + 8<br />Parity_bit = Not Parity_bit<br />End If<br />Dcf_min = Dcf_temp<br />Dcf_temp = 0<br /><br />Case 25 : If Dcf_bit = 1 Then<br />Dcf_temp = 1<br />Parity_bit = Not Parity_bit<br />End If<br />Case 26 : If Dcf_bit = 1 Then<br /> Dcf_temp = Dcf_temp + 2<br /> Parity_bit = Not Parity_bit<br />End If<br />Case 27 :<br />If Dcf_bit = 1 Then<br /> Dcf_temp = Dcf_temp + 4<br /> Parity_bit = Not Parity_bit<br />End If<br />Dcf_temp = Dcf_temp * 10<br />Dcf_temp = Dcf_temp + Dcf_min<br />'Decr Dcf_temp                                               'weweweqweqweqweqwe<br />If Start_dcf_flag = 1 And Dcf_temp &lt; 60 Then Dcf_min = Dcf_temp<br />Dcf_temp = 0<br />Case 28 : If Parity_bit = Dcf_bit Then Start_dcf_flag = 0<br /><br />Case 29 :<br />Parity_bit = 1<br />If Dcf_bit = 1 Then<br />Dcf_temp = 1<br />Parity_bit = Not Parity_bit<br />End If<br />Case 30 : If Dcf_bit = 1 Then<br />Dcf_temp = Dcf_temp + 2<br />Parity_bit = Not Parity_bit<br />End If<br />Case 31 : If Dcf_bit = 1 Then<br />Dcf_temp = Dcf_temp + 4<br />Parity_bit = Not Parity_bit<br />End If<br />Case 32 :<br />If Dcf_bit = 1 Then<br />Dcf_temp = Dcf_temp + 8<br />Parity_bit = Not Parity_bit<br />End If<br />Dcf_hour = Dcf_temp<br />Dcf_temp = 0<br />Case 33 : If Dcf_bit = 1 Then<br />Dcf_temp = 1<br />Parity_bit = Not Parity_bit<br />End If<br />Case 34 :<br />If Dcf_bit = 1 Then<br />Dcf_temp = Dcf_temp + 2<br />Parity_bit = Not Parity_bit<br />End If<br />Dcf_temp = Dcf_temp * 10<br />Dcf_temp = Dcf_temp + Dcf_hour<br /><br />If Start_dcf_flag = 1 And Dcf_temp &lt; 24 Then Dcf_hour = Dcf_temp<br />Dcf_temp = 0<br />Case 35 : If Parity_bit = Dcf_bit Then Start_dcf_flag = 0<br />Case 36 : If Dcf_bit = 1 Then Dcf_temp = 1<br />Case 37 : If Dcf_bit = 1 Then Dcf_temp = Dcf_temp + 2<br />Case 38 : If Dcf_bit = 1 Then Dcf_temp = Dcf_temp + 4<br />Case 39 :<br />If Dcf_bit = 1 Then Dcf_temp = Dcf_temp + 8<br />Dcf_day = Dcf_temp<br />Dcf_temp = 0<br />Case 40 : If Dcf_bit = 1 Then Dcf_temp = 1<br />Case 41 :<br />If Dcf_bit = 1 Then Dcf_temp = Dcf_temp + 2<br />Dcf_temp = Dcf_temp * 10<br />Dcf_temp = Dcf_temp + Dcf_day<br />If Start_dcf_flag = 1 And Dcf_temp &lt; 32 Then Dcf_day = Dcf_temp<br />Dcf_temp = 0<br />Case 42 : If Dcf_bit = 1 Then Dcf_temp = 1<br />Case 43 : If Dcf_bit = 1 Then Dcf_temp = Dcf_temp + 2<br />Case 44 :<br />If Dcf_bit = 1 Then Dcf_temp = Dcf_temp + 4<br />If Start_dcf_flag = 1 Then Week_day = Dcf_temp<br />Dcf_temp = 0<br />Case 45 : If Dcf_bit = 1 Then Dcf_temp = 1<br />Case 46 : If Dcf_bit = 1 Then Dcf_temp = Dcf_temp + 2<br />Case 47 : If Dcf_bit = 1 Then Dcf_temp = Dcf_temp + 4<br />Case 48 :<br />If Dcf_bit = 1 Then Dcf_temp = Dcf_temp + 8<br />Dcf_month = Dcf_temp<br />Dcf_temp = 0<br />Case 49 :<br />If Dcf_bit = 1 Then Dcf_temp = 10<br />If Start_dcf_flag = 1 Then Dcf_month = Dcf_temp + Dcf_month<br />Dcf_temp = 0<br />Case 50 : If Dcf_bit = 1 Then Dcf_temp = 1<br />Case 51 : If Dcf_bit = 1 Then Dcf_temp = Dcf_temp + 2<br />Case 52 : If Dcf_bit = 1 Then Dcf_temp = Dcf_temp + 4<br />Case 53 :<br />If Dcf_bit = 1 Then Dcf_temp = Dcf_temp + 8<br />'If Dcf_temp &lt; 9 Then Dcf_year = Dcf_temp<br />If Dcf_temp &lt; 9 Then Dcf_year = Dcf_temp + 10               'year correction<br />'Dcf_year = Dcf_temp<br /><br /><br />Case 58 :<br />If Start_dcf_flag = 1 Then<br />'_year = Dcf_temp<br />'_month = Dcf_month<br />'_day = Dcf_day<br />'_hour = Dcf_hour<br />'_min = Dcf_min<br />'Dcf_temp = 0<br />Reset_seconds_flag = 1<br /><br />End If<br /><br />Start_dcf_flag = 0<br /><br />End Select<br />Incr Dcf_counter<br />Counter1 = 0<br />Start Timer1<br />End If<br />Return<br /><br />Dcf_start:<br />Incr Pause_counter<br />If Pause_counter = 2 Then<br />Pause_counter = 0<br />Dcf_counter = 0<br />Start_dcf_flag = 1<br /><br />End If<br />Return<br /><br />Sub Beep<br />Reset Portd.4<br />Waitms 100<br />Set Portd.4<br />Waitms 100<br />End Sub<br /><br />Sub Short_beep<br />Reset Portd.4<br />Waitms 10<br />Set Portd.4<br />Waitms 255<br />End Sub[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=5750">jaremka75</a> — 1 mar 2015, o 13:22</p><hr />
]]></content>
</entry>
</feed>