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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2014-06-15T10:34:08+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=61&amp;t=7439&amp;mode</id>
<entry>
<author><name><![CDATA[dudek246]]></name></author>
<updated>2014-06-15T10:34:08+01:00</updated>
<published>2014-06-15T10:34:08+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7439&amp;p=84511#p84511</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7439&amp;p=84511#p84511"/>
<title type="html"><![CDATA[Re: VHDL - sterownik silnika krokowego]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7439&amp;p=84511#p84511"><![CDATA[
Witam ponownie.<br /><br />Zrobiłem programik do sterowania bipolarnym silnikiem krokowym(kierunek obrotów, tryb pełno/pół-krokowy, prędkość+/-)<br /><br />Korzystam ze środowiska XILINX'a, które nie wywala mi żadnych errorów, natomiast wywala sporo warningów i symulacja nie przebiega zgodnie z założeniami.<br /><br />Czy ktoś mógłby sprawdzić mój kod w celu eliminacji wszystkich błędów?<br /><br />oto najnowsza wersja kodu<br />[syntax=vhdl]library IEEE;<br />use IEEE.STD_LOGIC_1164.ALL;<br /><br />entity sterownikSilnika3 is<br />    Port ( clk : in  STD_LOGIC;<br />           engineOut : out  STD_LOGIC_VECTOR (3 downto 0);<br />           speedPlus : in  STD_LOGIC;<br />           speedMinus : in  STD_LOGIC;<br />           ledMax : out  STD_LOGIC;<br />           ledMin : out  STD_LOGIC;<br />           onOff : in  STD_LOGIC;<br />           leftRight : in  STD_LOGIC;<br />           ledLeft : out  STD_LOGIC;<br />           ledRight : out  STD_LOGIC;<br />           ledOnOff : out  STD_LOGIC;<br />           mode : in  STD_LOGIC;<br />  modeLed : out std_logic_vector(1 downto 0));<br />end sterownikSilnika3;<br /><br />architecture Behavioral of sterownikSilnika3 is<br />signal clk_devide : bit;<br />signal speed : integer range 3 to 7 := 3;<br />signal modeMultiplicator : integer range 1 to 2;<br />signal onOffSignal : bit;<br />signal speedLeds : bit_vector(1 downto 0);<br />signal counter : integer range 0 to 7;<br />begin<br /><br /><br />process (clk, speedPlus, speedMinus)---dzielnik częstotliwości sterowany przez speedPlus i speedMinus<br />variable i : integer range 1 to 600;<br />variable debouncing : std_logic_vector(20 downto 0); <br />variable debouncing2 : std_logic_vector(20 downto 0); <br />begin<br />if rising_edge(clk) then<br />if (debouncing = &quot;111111111111111111110&quot;) and (speedPlus = '1') then--detekcja zmiany stanu z 0 na 1<br />speed &lt;= speed + 1;<br />elsif(debouncing2 = &quot;111111111111111111110&quot;) and (speedMinus = '1') then<br />speed &lt;= speed - 1;<br />end if;<br /><br />if (speed = 5) then<br />speedLeds &lt;= &quot;01&quot;;<br />elsif (speed = 1) then<br />speedLeds &lt;= &quot;10&quot;;<br />else<br />speedLeds &lt;= &quot;00&quot;;<br />end if;<br /><br />debouncing(20 downto 1) := debouncing(19 downto 0); <br />debouncing(0) := speedPlus;<br />debouncing2(20 downto 1) := debouncing2(19 downto 0); <br />debouncing2(0) := speedMinus;<br /><br />if i = 0 then<br />clk_devide &lt;= '1';<br />i := 50 * modeMultiplicator * speed;<br />else<br />clk_devide &lt;= '0';<br />i := i - 1;<br />end if;<br />end if;<br />end process;<br /><br />process(clk_devide, mode, leftRight, onOff, counter, speedLeds)---sterownie silnikiem w zależności od podzielonej częstotliwości, trybu pracy i kierunku<br />begin<br />if (onOff = '1') then<br />ledOnOff &lt;= '1';<br />if (clk_devide'Event) and (clk_devide = '1')then<br />if (mode = '0') then<br />modeLed(0) &lt;= '1';<br />modeLed(1) &lt;= '0';<br />if (leftRight = '0') then<br />ledLeft &lt;= '1';<br />ledRight  &lt;= '0';<br />if (counter = 0) then<br />counter &lt;= 3;<br />end if;<br />counter &lt;= counter - 1;<br />else<br />ledLeft &lt;= '0';<br />ledRight  &lt;= '1';<br />if (counter = 3) then<br />counter &lt;= 0;<br />end if;<br />counter &lt;= counter + 1;<br />end if;<br /><br />case counter is <br />when 0 =&gt; engineOut &lt;= &quot;0110&quot;;     <br />when 1 =&gt; engineOut &lt;= &quot;1100&quot;; <br />when 2 =&gt; engineOut &lt;= &quot;1001&quot;; <br />when 3 =&gt; engineOut &lt;= &quot;0011&quot;; <br />when others =&gt; engineOut &lt;= &quot;0000&quot;;<br />end case; <br />else<br />modeLed(0) &lt;= '0';<br />modeLed(1) &lt;= '1';<br /><br />if (leftRight = '0') then<br />ledLeft &lt;= '1';<br />ledRight  &lt;= '0';<br />if (counter = 0) then<br />counter &lt;= 7;<br />end if;<br />counter &lt;= counter - 1;<br />else<br />ledLeft &lt;= '0';<br />ledRight  &lt;= '1';<br />if (counter = 7) then<br />counter &lt;= 0;<br />end if;<br />counter &lt;= counter + 1;<br />end if;<br /><br />case counter is <br />when 0 =&gt; engineOut &lt;= &quot;1001&quot;;     <br />when 1 =&gt; engineOut &lt;= &quot;1000&quot;;<br />when 2 =&gt; engineOut &lt;= &quot;1010&quot;; <br />when 3 =&gt; engineOut &lt;= &quot;0010&quot;;    <br />when 4 =&gt; engineOut &lt;= &quot;0110&quot;; <br />when 5 =&gt; engineOut &lt;= &quot;0100&quot;; <br />when 6 =&gt; engineOut &lt;= &quot;0101&quot;; <br />when 7 =&gt; engineOut &lt;= &quot;0001&quot;; <br />when others =&gt; engineOut &lt;= &quot;0000&quot;;<br />end case; <br />end if;<br />end if;<br /><br />if (speedLeds = &quot;00&quot;) then<br />ledMin &lt;= '0';<br />ledMax &lt;= '0';<br />elsif (speedLeds = &quot;10&quot;) then<br />ledMin &lt;= '1';<br />ledMax &lt;= '0';<br />else<br />ledMin &lt;= '0';<br />ledMax &lt;= '1';<br />end if;<br />else<br />engineOut &lt;= &quot;0000&quot;;<br />ledMax &lt;= '0';<br />ledMin &lt;= '0';<br />ledLeft &lt;= '0';<br />ledRight &lt;= '0';<br />ledOnOff &lt;= '0';<br />modeLed &lt;= &quot;00&quot;;<br />end if;<br />end process;<br />end Behavioral;[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2502">dudek246</a> — 15 cze 2014, o 10:34</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Anonymous]]></name></author>
<updated>2014-06-14T20:47:23+01:00</updated>
<published>2014-06-14T20:47:23+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7439&amp;p=84478#p84478</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7439&amp;p=84478#p84478"/>
<title type="html"><![CDATA[Re: VHDL - sterownik silnika krokowego]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7439&amp;p=84478#p84478"><![CDATA[
<div class="quotetitle">mokrowski napisał(a):</div><div class="quotecontent"><br />Obecnie nie. A powody są następujące:<br />1. Mimo ogólnej pochlebnej oceny jakości C++ zaczynam dochodzić do wniosku że kontynuacja staje się bezpodstawna bo nie mam informacji zwrotnej dotyczącej problemów z przejściem drogi cyklu tutoriali.<br />Mimo to go skończę ale szablony STL (z ankiet) to temat dla 2 osób. <br />2. Brak czasu (i tak wsiąkłem w tematy elektroniczne po uszy i z intensywnością bliską zachłyśnięcia)<br />3. Odbiorców VHDL'u/Verilog'a niewielu i jest to wiedza niszowa (z całym szacunkiem) co nie kwalifikuje jej do tutoriali.<br />4. W tematach FPGA i pochodnych nie czuję  jeszcze abym był na poziomie nawet początkującym.<br /><br />Może kiedyś...<br /></div><br /><br />AD1. Tu akurat nie zgodzę się z tobą, to że teraz jest mały odzew to nie znaczy że same poradniki nie są użyteczne, po prostu okres trochę ciężki, bo sporo studenciaków ma zaliczenia.<br />Sam bym z chęcią się w to zagłębił, ale w długie zimowe wieczory, gdyż aktualnie przeszedłem bardziej na Kinetis L/ STM niż AVR<br />AD2. Brak czasu to w sumie główny hamownik większości <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /><br />AD3. Jak w odpowiedzi AD1<br />AD4. Tu bardziej chodzi o jakieś wprowadzenie. Bo akurat NE0-nano to dosyć tania platforma do sporych możliwościach, a tematyka bardzo ciekawa.<p>Statystyki: Napisane przez Gość — 14 cze 2014, o 20:47</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Anonymous]]></name></author>
<updated>2014-06-14T20:01:00+01:00</updated>
<published>2014-06-14T20:01:00+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7439&amp;p=84459#p84459</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7439&amp;p=84459#p84459"/>
<title type="html"><![CDATA[Re: VHDL - sterownik silnika krokowego]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7439&amp;p=84459#p84459"><![CDATA[
<div class="quotetitle">mokrowski napisał(a):</div><div class="quotecontent"><br />Ja akurat ćwiczę na DE0-NANO <img src="https://forum.atnel.pl/images/smilies/icon_e_smile.gif" alt=":-)" title="Szczęśliwy" /><br /></div><br /><br />Czy kolega przewiduje jakiś kurs? po świetnym C++, może przydało by się przedstawić coś w VHDL/Verilog ?<p>Statystyki: Napisane przez Gość — 14 cze 2014, o 20:01</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[dudek246]]></name></author>
<updated>2014-06-14T19:10:12+01:00</updated>
<published>2014-06-14T19:10:12+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7439&amp;p=84450#p84450</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7439&amp;p=84450#p84450"/>
<title type="html"><![CDATA[VHDL - sterownik silnika krokowego]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7439&amp;p=84450#p84450"><![CDATA[
Witam<br />Właśnie jestem w trakcie tworzenia sterownika bipolarnego silnika krokowego opartego o układ CPLD XC9536XL.<br />Potrafię zrobić prosty sterownik działający z jedną prędkością. Problem pojawia się gdy chcę sterować prędkością za pomocą dwóch przycisków(szybciej, wolniej).<br />Czy ktoś tu ma jakieś wyobrażenie jakby to można by napisać?<br /><br />z góry dziękuję za odpowiedź i pozdrawiam.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2502">dudek246</a> — 14 cze 2014, o 19:10</p><hr />
]]></content>
</entry>
</feed>