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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2015-01-04T12:58:41+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=12&amp;t=10005&amp;mode</id>
<entry>
<author><name><![CDATA[piurek10]]></name></author>
<updated>2015-01-04T12:58:41+01:00</updated>
<published>2015-01-04T12:58:41+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10005&amp;p=112181#p112181</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10005&amp;p=112181#p112181"/>
<title type="html"><![CDATA[Re: Bascom Program do obsługi zasilacza]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10005&amp;p=112181#p112181"><![CDATA[
czytam, czytam<br />Tylko po to się daje zadania w przerwaniu by były one z jakąś częstotliwością wykonywane.<br />Ten przykład może i by działał tylko wykonanie tego<br /><br />[syntax=basic4gl]if 1_6ms = 1 Then<br />   1_6ms = 0<br /> Incr Timerek<br />   If Timerek = 255 Then                                    'co 408ms dodaj inne timery albo inaczej ustaw przewanie<br />      Timerek = 0<br />end if[/syntax]<br /><br />jest w pętli głównej co za tym idzie czas operacji może być opóźniony (różne wait obsługi przycisków itd)<br /><br />Przynajmniej tak myślę.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7318">piurek10</a> — 4 sty 2015, o 12:58</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[piurek10]]></name></author>
<updated>2015-01-04T10:51:49+01:00</updated>
<published>2015-01-04T10:51:49+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10005&amp;p=112154#p112154</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10005&amp;p=112154#p112154"/>
<title type="html"><![CDATA[Re: Bascom Program do obsługi zasilacza]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10005&amp;p=112154#p112154"><![CDATA[
Taki prosty program tego typu tylko z odczytem ADC w pętli przerwania też nie działa:<br /><br />[syntax=basic4gl]$regfile = &quot;m16def.dat&quot;<br />$crystal = 8000000<br /><br />Config Lcdbus = 4<br />Config Lcd = 16 * 2<br />Config Lcdpin = Pin , Db4 = Portd.2 , Db5 = Portd.3 , Db6 = Portd.4 , Db7 = Portd.5 , E = Portd.1 , Rs = Portd.0<br />Cursor Off<br /><br />Disable Oc1a<br />Disable Oc1b<br /><br />Config Portc = Output<br />Config Pinb.3 = Input<br />Config Pinb.2 = Input<br />Config Pinb.1 = Input<br />Config Pinb.0 = Input<br />Set Portb.3<br />Set Portb.2<br />Set Portb.1<br />Set Portb.0<br /><br /><br />Volplus Alias Pinb.3<br />Volminus Alias Pinb.2<br />Currplus Alias Pinb.1<br />Currminus Alias Pinb.0<br /><br />Dim Voladc As Integer<br />Dim Curradc As Integer<br /><br />Config Adc = Single , Prescaler = Auto , Reference = Avcc<br />Start Adc<br /><br />Config Timer0 = Timer , Prescale = 8<br />On Timer0 Przerwanie<br />Enable Interrupts<br />Enable Timer0<br />Start Timer0<br /><br />Do<br />Cls<br />Locate 1 , 1<br />Lcd Voladc<br />Locate 2 , 1<br />Lcd Curradc<br /><br /><br />Przerwanie:<br />Timer0 = 55<br />Voladc = Getadc(7)<br />Curradc = Getadc(6)<br /><br />Return<br /><br />Loop[/syntax]<br /><br />edytowane:<br /><br />Sorry ale wystarczy chwile poczekać i odczyt adc wyświetla się bardzo wolno, to znaczy bardzo wolno cyfra po cyfrze i potem nic się nie zmienia.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7318">piurek10</a> — 4 sty 2015, o 10:51</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[piurek10]]></name></author>
<updated>2015-01-03T18:02:52+01:00</updated>
<published>2015-01-03T18:02:52+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10005&amp;p=112011#p112011</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10005&amp;p=112011#p112011"/>
<title type="html"><![CDATA[Re: Bascom Program do obsługi zasilacza]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10005&amp;p=112011#p112011"><![CDATA[
Bo to jest schemat sprzed lutowania, a jak już lutowałem przewodami to zamieniłem tak żeby było wygodnie. Sam wyświetlacz działa.<br /><br />Co do nieporządku to najpierw staram się uruchomić układ a potem dopiero dopieszczać.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7318">piurek10</a> — 3 sty 2015, o 18:02</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[swicio]]></name></author>
<updated>2015-01-03T14:49:11+01:00</updated>
<published>2015-01-03T14:49:11+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10005&amp;p=111950#p111950</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10005&amp;p=111950#p111950"/>
<title type="html"><![CDATA[Re: Bascom Program do obsługi zasilacza]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10005&amp;p=111950#p111950"><![CDATA[
Tak wstępnie to config lcdpin nie zgadza się ze schematem<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=3956">swicio</a> — 3 sty 2015, o 14:49</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[piurek10]]></name></author>
<updated>2015-01-03T14:06:57+01:00</updated>
<published>2015-01-03T14:06:57+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=10005&amp;p=111941#p111941</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=10005&amp;p=111941#p111941"/>
<title type="html"><![CDATA[Bascom Program do obsługi zasilacza]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=10005&amp;p=111941#p111941"><![CDATA[
Witajcie<br />Od paru dni męczę się programowaniem zasilacza <a href="http://forum.atnel.pl/_obrazki/o/7318/2cda6be28814bc3de57849408482da9f.png"  class="postlink"><img src="http://forum.atnel.pl/_obrazki/o/thumb/7318/2cda6be28814bc3de57849408482da9f.png" alt="Obrazek" /></a><br /><br />I napisałem program<br /><br />                     [syntax=basic4gl]$regfile = &quot;m16def.dat&quot;<br />$crystal = 8000000<br /><br />Config Lcdbus = 4<br />Config Lcd = 16 * 2<br />Config Lcdpin = Pin , Db4 = Portd.2 , Db5 = Portd.3 , Db6 = Portd.4 , Db7 = Portd.5 , E = Portd.1 , Rs = Portd.0<br />Cursor Off<br /><br />Disable Oc1a<br />Disable Oc1b<br /><br />Config Portc = Output<br />Config Pinb.3 = Input<br />Config Pinb.2 = Input<br />Config Pinb.1 = Input<br />Config Pinb.0 = Input<br />Set Portb.3<br />Set Portb.2<br />Set Portb.1<br />Set Portb.0<br /><br />Volplus Alias Pinb.3<br />Volminus Alias Pinb.2<br />Currplus Alias Pinb.1<br />Currminus Alias Pinb.0<br /><br />Dim Voladc As Long<br />Dim Curradc As Long<br />Dim Volnastawa As Single<br />Dim Currnastawaadc As Single<br />Dim Wynikpom As Single<br />Dim Wyjscie As Byte<br />Dim Liczwys As Word<br />Dim Ogranicz As Bit<br />Dim Wynikcurr As Single<br />Dim Currnastawa As Single<br />Dim Voldisplay As Single<br />Dim Currdisplay As Single<br />Dim Voladc1 As Single<br />Dim Volnastawa1 As Single<br />Dim Ogranicz1 As Bit<br />Dim Ogranicz2 As Bit<br />Dim Ogranicz3 As Bit<br /><br />Config Adc = Single , Prescaler = Auto , Reference = Avcc<br />Start Adc<br /><br />Config Timer0 = Timer , Prescale = 64<br />On Timer0 Przerwanie<br />Enable Interrupts<br />Enable Timer0<br />Cls<br />Currnastawa = 1<br />Volnastawa = 12<br /><br />Przerwanie:<br /><br />   Timer0 = 55<br />   Voladc = Getadc(7)<br />   Curradc = Getadc(6)<br />   Voladc = Voladc * 10000<br />   Curradc = Curradc * 1000                                 ' sygnał z czujnika prądu ACS 712 daje 2,5v + na każdego A + 185 mV<br />   Curradc = Curradc - 512000                               ' dlatego odejmuje połowe wartosci maksymalnej<br />   Currnastawaadc = Currnastawa * 37880                     ' przeliczenie prądu zadanego na wartości  do porównania z przetwornikiem<br />   Wynikcurr = Curradc - Currnastawaadc<br /><br />   If Wynikcurr &gt; 3788 Then<br />   Ogranicz1 = 1<br />   Wyjscie = Wyjscie / 2<br />   Else<br />   Ogranicz1 = 0<br />   End If<br />   If Wynikcurr &gt; 1500 And Wynikcurr &lt; 3788 Then<br />   Ogranicz2 = 1<br />   Wyjscie = Wyjscie - 6<br />   Else<br />   Ogranicz2 = 0<br />   End If<br />   Portc = Wyjscie<br /><br />   Return<br /><br /><br />Do<br /><br /><br /><br />    If Volplus = 1 Then<br />    Waitms 20                                               ' obsługa przyciskow<br />    If Volplus = 1 Then<br />    Volnastawa = Volnastawa + 0.5<br />    Waitms 80<br />    End If<br />    End If<br /><br />    If Volminus = 1 Then<br />    Waitms 20<br />    If Volminus = 1 Then<br />    Volnastawa = Volnastawa - 0.5<br />    Waitms 80<br />    End If<br />    End If<br /><br />    If Currplus = 1 Then<br />    Waitms 20<br />    If Currplus = 1 Then<br />    Currnastawa = Currnastawa + 0.1<br />    Waitms 80<br />    End If<br />    End If<br /><br />    If Currminus = 1 Then<br />    Waitms 20<br />    If Currminus = 1 Then<br />    Currnastawa = Currnastawa - 0.1<br />    Waitms 80<br />    End If<br />    End If<br /><br />    If Currnastawa &gt; 2 Then<br />    Currnastawa = 2<br />    End If<br />    If Currnastawa &lt; 0 Then<br />    Currnastawa = 0<br />    End If<br /><br />    If Volnastawa &gt; 32 Then<br />    Volnastawa = 32<br />    End If<br /><br />    If Volnastawa &lt; 0 Then<br />    Volnastawa = 0<br />    End If<br /><br />      If Wynikcurr &gt; 500 Then<br />      Ogranicz3 = 1<br />      Wyjscie = Wyjscie - 1<br />      Else<br />      Ogranicz3 = 0<br />      End If<br /><br />      Voladc1 = Voladc<br />      Volnastawa1 = Volnastawa * 262564<br />      Wynikpom = Voladc1 - Volnastawa1<br /><br />      If Ogranicz1 = 0 And Ogranicz2 = 0 And Ogranicz3 = 0 Then<br />      Ogranicz = 0<br />      Else<br />      Ogranicz = 1<br />      End If<br /><br />      If Wynikpom &lt; 0 And Ogranicz = 0 Then<br /><br />         If Wynikpom &lt; -720000 Then<br />         Wyjscie = Wyjscie + 8<br />         End If<br />         If Wynikpom &lt; 0 And Wynikpom &gt; -720000 Then<br />         Wyjscie = Wyjscie + 1<br />         End If<br /><br />      End If<br /><br />      If Wynikpom &gt; 0 And Ogranicz = 0 Then<br /><br />         If Wynikpom &gt; 720000 Then<br />         Wyjscie = Wyjscie - 8<br />         End If<br /><br />         If Wynikpom &gt; 0 And Wynikpom &lt; 720000 Then<br />         Wyjscie = Wyjscie - 1<br />         End If<br /><br />      End If<br />Portc = Wyjscie<br />Voldisplay = Voladc * 0.00000380859375<br />Currdisplay = Curradc / 37880<br /><br />Locate 1 , 9<br />Lcd &quot;(&quot; , Volnastawa , &quot;V)&quot;<br />Locate 2 , 9<br />Lcd &quot;(&quot; , Currnastawa , &quot;A)&quot;<br /><br /><br />Cls<br />Locate 1 , 9<br />Lcd &quot;(&quot; , Volnastawa , &quot;V)&quot;<br />Locate 2 , 9<br />Lcd &quot;(&quot; , Currnastawa , &quot;A)&quot;<br />Locate 1 , 1<br />Lcd Fusing(voldisplay , &quot;#.##&quot;)<br />Locate 1 , 6<br />Lcd &quot;V&quot;<br />Locate 2 , 1<br />Lcd Fusing(currdisplay , &quot;#.##&quot;)<br />Locate 2 , 6<br />Lcd &quot;A&quot;<br />If Ogranicz = 1 Then<br />Locate 2 , 7<br />Lcd &quot;*&quot;<br /><br />End If<br /><br /><br />Loop[/syntax]<br />Jak widzicie program jest podzielony na dwie części przerwania i pętli głównej.<br />Program wariuje nie ustawia napięć oraz wyświetlacz lcd nic nie pokazuje.<br />Nawet jak zrobię taki program<br /><br />Przerwanie <br />tylko odczyt ADC<br />konie przerwania<br />do<br />lcd &quot;test&quot;<br />loop<br /><br />to nadal nic się nie wyświetla<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7318">piurek10</a> — 3 sty 2015, o 14:06</p><hr />
]]></content>
</entry>
</feed>