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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2021-01-27T21:59:10+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=4&amp;t=23523&amp;mode</id>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2021-01-27T21:59:10+01:00</updated>
<published>2021-01-27T21:59:10+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230790#p230790</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230790#p230790"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230790#p230790"><![CDATA[
<div class="quotetitle">Slawek napisał(a):</div><div class="quotecontent"><br />Uważam ze dostałem od ciebie po uszach<br /></div><br />Ja pierdziu! gdzie ja tobie po uszach dawałem, gdzie ja cię krytykowałem? - podpowiadam coś z dobrego serca a ten mi tu spazmów dostaje - no ja pierdziu. Idź pan .... nie powiem gdzie - nie mam zamiaru dalej dyskutować w takim tonie.<br /><br /><div class="quotetitle">Slawek napisał(a):</div><div class="quotecontent"><br />, czego się zresztą spodziewałem na początku.<br /></div><br />a niby po czym się spodziewałeś ... no chore podejście. <br /><br />I weź tu człowieku staraj się pomóc - zawsze się znajdzie taki jeden co to napisze że go opierdzielam chociaż nawet mi przez myśl to nie przeszło bo i za co miałbym to robić - ale już po pierwszym twoim poście widziałem że jakoś tak zadziornie zaczynasz pisać.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 27 sty 2021, o 21:59</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Slawek]]></name></author>
<updated>2021-01-27T20:01:49+01:00</updated>
<published>2021-01-27T20:01:49+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230789#p230789</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230789#p230789"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230789#p230789"><![CDATA[
Nie zgadzam się z tym co napisałeś.<br />Niemniej to ty piszesz na forum że asynchroniczne przerwania  nie działają i potem w suplemencie też ty to powtarzasz.<br />Skoro wymagasz ode mnie rzetelności w pisaniu posta, czym się nawet zgadzam. Uważam ze dostałem od ciebie po uszach, czego się zresztą spodziewałem na początku. Co prawda myślałem że jak zapytam wprost na forum zamiast siedzenia nad notami będzie łatwej. Zresztą nie pisałem że nie rozumiem tekstu tylko że nie rozumiem różnicy w wymienionych przerwaniach , a to jednak co innego. Dla jasności doczytałem głębiej, więc teraz już wiem. <br />To cichłbym abyś teraz sam był fair i powiedział dlaczego tak piszesz i potem mówisz. Czy sprawdzałeś to, że asynchroniczne nie działają, skąd masz taką wiedzę. Bo nie tłumacząc co masz namyśli masz mój poziom, który skrytykowałeś w delikatny wprawdzie sposób.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=69">Slawek</a> — 27 sty 2021, o 20:01</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2021-01-26T20:15:52+01:00</updated>
<published>2021-01-26T20:15:52+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230778#p230778</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230778#p230778"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230778#p230778"><![CDATA[
<div class="quotetitle">Slawek napisał(a):</div><div class="quotecontent"><br />Ktoś (w takim sensie ktoś, osoba bo chyba nie potrzebujesz tu imienia bo i tak nie pamiętam) opisywała jak w dokumentacji atmela opisane są przerwania. Co innego w datasheet, co innego w przykładach i dopiero w erracie co nieco się wyjaśnia.<br /></div><br />Oczywiście że mi nie są potrzebne ani imiona ani numery butów ani inne dane osobowe - a po choinkę. Nadal jednak twierdzę, żebyś ty zamiast się skupiać na tym co ktoś tam napisał i że jak czegoś nie zrozumiał to pisał dziwne rzeczy - to sam zajrzyj do noty, zobacz, porównaj i napisz czego nie rozumiesz. Bo teraz to już dziwnie piszesz po tym co na górze starałem się wyjaśnić i podać ci trop co i jak jest opisane w nocie - a ty dalej swoje, że ktoś coś tam napisał sobie. W internecie jest mnóstwo bzdur i nic na to nie poradzisz.<br /><br />W ogóle nie rozumiem co tu wyjaśniać jak chodzi o różnice w działaniu tych przerwań skoro w nocie PDF jest to opisane jasno i prosto jak byk. A i tak w 99% przypadków nikt nie wykorzystuje w jakiś zaawansowany sposób różnic jakie niosą za sobą działania tych przerwań.<br /><br /><br /><br /><div class="quotetitle">Slawek napisał(a):</div><div class="quotecontent"><br />Jaki wpływ na pracę biblioteki V-USB to mam.<br /></div><br />Wpływu nie ma - skoro ktoś przewidział w swojej bibliotece że mogą być użyte tylko przerwania synchroniczne no to co na to poradzisz. Poza tym biblioteka V-USB wykorzystuje w sposób drastycznie zaawansowany zależności czasowe, dlatego spora jej część napisana jest w asemblerze i co ciekawe w zależności od częstotliwości taktowania wstawki asemblerowe również drastycznie muszą się różnić, bo rozkazy asm dobierane są tak aby zgadzały się czasówki do prawie pojedynczych taktów zegara.<br /><br />Poza tym pokazałem ci wyżej fragment noty - możesz sobie ten tekst wrzucić do gogle translate zawsze - jeśli np do końca coś tam po angielsku nie rozumiesz - co za problem?<br /><br />Ale ok jest tam napisane że przerwania od zbocza narastającego czy opadającego dla przerwania wyzwalane są asynchronicznie czyli niezależnie od sygnału CLK, za to muszą się zmieścić zgodnie z podaną tam tabelą w odpowiedniej ilości cykli zegara. W związku z tym, np krótsze impulsy mogą nie być w ogóle &quot;zauważone&quot; przez procka.<br /><br />Ja wprawdzie nie analizowałem na poziomie asemblera wykorzystania przerwań INTx w V-USB - spojrzałem tylko na dostępne bity konfiguracyjne do ustawienia dla przerwań i po tym widać, że autorzy V-USB zdecydowali się na synchroniczne przerwania jeśli chodzi o INTx. Trzeba byłoby posiedzieć nad analizą kodu asemblera i ręcznie liczyć cykle i co robi kod - a jednocześnie poznać od podszewki czysty protokół USB żeby sobie odpowiedzieć na takie pytanie - tylko czy jest sens ? Ja nie widzę takiego sensu. Jeśli ty widzisz - to już wiesz co musisz zrobić żeby zaspokoić ciekawość dalej.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 26 sty 2021, o 20:15</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Slawek]]></name></author>
<updated>2021-01-26T19:34:30+01:00</updated>
<published>2021-01-26T19:34:30+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230776#p230776</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230776#p230776"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230776#p230776"><![CDATA[
Wydawało się proste pytanie a się skomplikowało.<br />&quot;Ludzie&quot; to było spontaniczne wtrącenie. Mało ważne kto i co, ale szukając informacji o przerwaniach natrafiłem na ciekawy wpis na AVRFreaks. Ktoś (w takim sensie ktoś, osoba bo chyba nie potrzebujesz tu imienia bo i tak nie pamiętam) opisywała jak w dokumentacji atmela opisane są przerwania. Co innego w datasheet, co innego w przykładach i dopiero w erracie co nieco się wyjaśnia.<br /><br />Mnie chodziło o to dlaczego piszesz <div class="quotetitle">mirekk36 napisał(a):</div><div class="quotecontent"><br />musisz sprawdzić ale z tego co pamiętam to to przerwanie się nie nadaje bo jest <strong><span style="color: #FF0000">asynchroniczne</span></strong><br /></div><br />Jaki wpływ na pracę biblioteki V-USB to mam.<br />Jeśli nie doczytałem tego w orangebooku to przepraszam i proszę o podanie na której stronie to jest, jeśli nie ma to proszę wyjaśnij dlaczego tak mówisz.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=69">Slawek</a> — 26 sty 2021, o 19:34</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2021-01-26T09:59:31+01:00</updated>
<published>2021-01-26T09:59:31+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230773#p230773</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230773#p230773"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230773#p230773"><![CDATA[
<div class="quotetitle">Slawek napisał(a):</div><div class="quotecontent"><br />i nawet ludzie opisują że Atmel wprowadził pewne zamieszanie w nich (myli ich opisy w stosunku do pinów)<br /></div><br />Przepraszam ale co to za ludzie ? Bez żadnej złośliwości ale najczęściej to jakieś początkujące osoby jak już, które nie dostrzegają tego, że praktycznie w każdym procku AVR działają one IDENTYCZNIE, że praktycznie notę z jednego procka można używać prawie bez kłopotów do innego jak chodzi o opisy modułów. Oczywiście nie zawsze bo bywają różnice. Poza tym czasem drobne pomyłki się mogą zdarzyć ale i tak Atmel to robił zawsze NAJLEPSZE noty PDF, najbardziej czytelne ... porównaj sobie to do Microchipa dawnego to zrozumiesz.<br /><br />Co się tyczy samych przerwań to czemu nie zajrzysz do noty PDF żeby zobaczyć czym się różnie przerwanie INT2 od przerwań INT0 albo INT1? Przecież tam jak byk widać, że w przypadku INT0 i INT1 masz już na pierwszy rzut oka więcej możliwości co do samego WYZWALANIA przerwań. W tabelce za pomocą dwóch bitów ISCxn ustawia się czy przerwanie ma być wyzwalane:<br /><br />1. zboczem opadającym<br />2. zboczem narastającym<br />3. poziomem niskim<br />4. poziomem wysokim<br /><br />a w przypadku INT2 masz do dyspozycji TYLKO i wyłącznie <br /><br />1. zboczem opadającym<br />2. zboczem narastającym<br /><br /><a href="https://obrazkiforum.atnel.pl/54/a17c7c366ef319a6ad25c63900476c3f.png"  class="postlink"><img src="https://obrazkiforum.atnel.pl/thumb/54/a17c7c366ef319a6ad25c63900476c3f.png" alt="Obrazek" /></a><br /><br />Przerwania są rejestrowane asynchronicznie zboczami ale długość impulsów musi się mieścić w odpowiednim przedziale czasowym o czym dalej jest w nocie.<br /><br />I jest to napisane wyraźnie w każdej nocie które posiada akurat takie przerwanie. W czym problem? Po co czytasz co piszą ludzie, którzy akurat tego nie rozumieją?<br /><br /><div class="quotetitle">Slawek napisał(a):</div><div class="quotecontent"><br />ale jaki wpływ mają<br />te przerwania w stosunku do biblioteki V-USB?<br /></div><br />Jeśli chodzi o INT2 na ATmega1284 to właśnie sprawdziłem i jednak się myliłem - bo V-USB spokojnie działa nawet na INT2 dlatego że w tym procku to normalne przerwanie synchroniczne jednak <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /> a ja myślałem tak na szybko, że podobnie jak w m32 będzie asynchroniczne. I tu się właśnie zawsze kłania sięganie do noty PDF. A zatem krótko mówiąc na m1284P można odpalać na kilka sposobów na pinie PB2 <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /> bo i na INT2 i na PCINT10<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">#define USB_INTR_CFG            EICRA<br />#define USB_INTR_CFG_SET        ((1 &lt;&lt; ISC20) | (1 &lt;&lt; ISC21))<br />#define USB_INTR_CFG_CLR        0<br />#define USB_INTR_ENABLE         EIMSK<br />#define USB_INTR_ENABLE_BIT     INT2<br />#define USB_INTR_PENDING        EIFR<br />#define USB_INTR_PENDING_BIT    INTF2<br />#define USB_INTR_VECTOR         INT2_vect</div><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 26 sty 2021, o 09:59</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Slawek]]></name></author>
<updated>2021-01-26T07:13:31+01:00</updated>
<published>2021-01-26T07:13:31+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230771#p230771</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230771#p230771"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230771#p230771"><![CDATA[
Wiem że zostanę pogryziony za pytanie, ale może nie.<br />Pewnie też to było opisane, ale jak szukam to nie potrafię znaleźć <img src="https://forum.atnel.pl/images/smilies/icon_e_sad.gif" alt=":-(" title="Smutny" /><br /><br />O co dokładniej chodzi z tym przerwaniem synchronicznym i asynchronicznym. <br />Doszukałem się różnicy o co w nich ogólnie tylko chodzi i nawet ludzie opisują że Atmel wprowadził pewne zamieszanie w nich (myli ich opisy w stosunku do pinów), ale jaki wpływ mają<br />te przerwania w stosunku do biblioteki V-USB?<br />Tak ogólnie to dopiero teraz po suplemencie uświadomiłem sobie o takiej różnicy, zastanawiam się też jaki ma to wpływ na inne programy wykorzystujące przerwania zewnętrzne?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=69">Slawek</a> — 26 sty 2021, o 07:13</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2021-01-24T18:37:41+01:00</updated>
<published>2021-01-24T18:37:41+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230751#p230751</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230751#p230751"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230751#p230751"><![CDATA[
proszę:<br /><br /><div style="width: 583px; height: 471px; margin: 0 auto; padding-left: 26px; padding-top: 48px; background: url('https://www.atnel.pl/download/atnel_tv.png') no-repeat;"> <strong>iframe</strong> </div><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 24 sty 2021, o 18:37</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2021-01-24T14:44:20+01:00</updated>
<published>2021-01-24T14:44:20+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230749#p230749</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230749#p230749"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230749#p230749"><![CDATA[
jeszcze dzisiaj pokażę że wszystko działa z książki - KAŻDY przykład - a dodatkowo odpalę na twoich ustawieniach czyli PB1,2 czyli na PCINT10 oczywiście na ATmega1284P<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 24 sty 2021, o 14:44</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2021-01-15T18:36:29+01:00</updated>
<published>2021-01-15T18:36:29+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230605#p230605</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230605#p230605"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230605#p230605"><![CDATA[
tak sorki sprzętowo jednak się nie różnią<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 15 sty 2021, o 18:36</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[drakston]]></name></author>
<updated>2021-01-15T18:03:44+01:00</updated>
<published>2021-01-15T18:03:44+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230604#p230604</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230604#p230604"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230604#p230604"><![CDATA[
Wrzucę jak będę przy drugim kompie.<br /><br />Mam m1284.<br /><br />Na pewno to są różne procki ? wersja P oznacza Picopower czyli niższe zużycie prądu i ma dołożone jedyne co jakieś dodatkowe pierdoły oszczędzające energie.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=20843">drakston</a> — 15 sty 2021, o 18:03</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2021-01-15T12:24:04+01:00</updated>
<published>2021-01-15T12:24:04+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230602#p230602</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230602#p230602"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230602#p230602"><![CDATA[
ty masz procka ATmega1284P czy ATmega1284 ? bo to różne procki<br /><br />Poza tym podeślij mi ten kod z tego 1-go ćwiczenia który ci nie działa - bo u mnie śmiga że aż miło, więc na razie jedyne co przychodzi mi do głowy to złe połączenia niestety. Oczywiście mówię o procku m32.<br /><br />Ale sprawdzę niedługo na m1284P i nawet spróbuję się podłączyć na INt2 jak ty próbowałeś<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 15 sty 2021, o 12:24</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[drakston]]></name></author>
<updated>2021-01-15T12:02:17+01:00</updated>
<published>2021-01-15T12:02:17+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230601#p230601</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230601#p230601"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230601#p230601"><![CDATA[
Przy obojętnie jakiej kombinacji podpięcia z odpowiednim konfigiem - komunikat nie znaleziono urzadzenia<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=20843">drakston</a> — 15 sty 2021, o 12:02</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2021-01-15T11:31:43+01:00</updated>
<published>2021-01-15T11:31:43+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230599#p230599</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230599#p230599"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230599#p230599"><![CDATA[
<div class="quotetitle">drakston napisał(a):</div><div class="quotecontent"><br />Przykład 1 podstawowy z książki nie działa na żadnym porcie w przypadku Atmega1284.<br /></div><br />To niemożliwe - aż sam sprawdzę<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 15 sty 2021, o 11:31</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[drakston]]></name></author>
<updated>2021-01-15T10:40:24+01:00</updated>
<published>2021-01-15T10:40:24+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230598#p230598</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230598#p230598"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230598#p230598"><![CDATA[
Przykład 4 z HID działa na konfigu z przykładu i na moich ustawieniach i pozostałych czyli standardowo wejścia INT<br /><br />Przykład 1 podstawowy z książki nie działa na żadnym porcie w przypadku Atmega1284.<br /><br />Generalnie problem z usb w projekcie rozwiązałem w inny sposób także dzięki za pomoc.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=20843">drakston</a> — 15 sty 2021, o 10:40</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2021-01-09T22:37:35+01:00</updated>
<published>2021-01-09T22:37:35+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230541#p230541</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230541#p230541"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230541#p230541"><![CDATA[
<div class="quotetitle">drakston napisał(a):</div><div class="quotecontent"><br />Jutro rozpruje płytkę i przepnę usb na INT0<br /></div><br /><br />A nie no to spoko jak ci już działało to najważniejsze - bo właśnie znaczy że np wyeliminowane są błędy np połączeń<br /><br />Weź zatem na żywca CAŁY plilk usbconfig.h np z klawiatury HID ok i zmień na swoje piny PB 1 i 2 z przerwaniem PCINT10<br /><br />ale ważne żebyś wziął ten plik z ćwiczenia z książki a nie na czysto i go przerabiał ok?<br /><br />i daj znać<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 9 sty 2021, o 22:37</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[drakston]]></name></author>
<updated>2021-01-09T21:26:07+01:00</updated>
<published>2021-01-09T21:26:07+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230533#p230533</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230533#p230533"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230533#p230533"><![CDATA[
Po 1 ile tego schematu ma być? widać na nim złącze, jego numery pinów i cały tor usb do procesora, przecież więcej nie trzeba... ten sam tor był sprawdzany na atmega328p i komunikacja wg pierwszego przykładu z książki działała bez problemów.<br /><br />po 2, Pisałem że chce przerobić pierwszy przykład, że lecę wszystko wg. niego - pierwszy przykład to nie jest hid, tak? Sam Pan pisał w książce o przekopiowaniu czystego konfigu i konfiguracji wg tego pierwszego przykładu co sprowadzało się tylko do ustawienia portów, czestotliwości i nazwy ... zakładając że podłączamy się pod INT0 w wybranym procku.<br /><br />Jak dobrze pamiętam to w książce widniała informacja że każdy port typu INTx może być użyty do v-usb  dlatego na tej bazie u mnie w projekcie wybrałem INT2 bo szczerze mówiąc nic innego wolnego nie mam.<br /><br />Przeleciałem przykład pierwszy z książki ale nie działało, sugestia od Pana z ustawieniem konfigu przerwań, z poprawka o poprawną konfiguracje z noty procka który też nic nie daje. Pan mówi o przykładzie który jest na stronie 203 książki tak? czyli w teorii mam dobrze to wpisane.<br /><br />Jutro rozpruje płytkę i przepnę usb na INT0 a potem INT1, jak będzie działać to krótko mówiąc INT2 w atmega1284 nie nadaje się pod usb/albo trzeba czegoś więcej.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=20843">drakston</a> — 9 sty 2021, o 21:26</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2021-01-09T19:55:24+01:00</updated>
<published>2021-01-09T19:55:24+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230532#p230532</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230532#p230532"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230532#p230532"><![CDATA[
wiesz, troszkę łapię się za głowę jak widzę ten konfig ... oczywiście jeśli masz Orangebook'a - bo z tego co piszesz wygląda że masz OB.....<br /><br />No to po jasny gwint sam sobie robisz podwójne salto-mortale z pętlą na szyi ?<br /><br />Ja np spróbowałbym najpierw DOKŁADNIE tak jak jest w książce jakiś przykład - a masz przykład na m644P (to jest IDENTIKO to samo co m1284P) i z V-USB na tych pinach co w książce żeby mi ruszyło ....<br /><br />Jakby mi ruszyło to zmieniłbym tylko piny i przerwanie<br /><br />.... a nawet jakbym się uparł i nie chciał przetestować tego co w książce - to Qurczę tyle pracy włożyłem i w wyjaśnienie całego konfiga linia po linii ... (ale ok nawet mogę zrozumieć, że i tu można się pomylić gdy się człowiek bierze pierwszy raz za to) ...<br /><br />A ty nie ... Widzę, że wziąłeś sobie czysty fabryczny usbconfig.h i zajeżdżasz go po swojemu - wiedząc że możesz popełnić w nim błędy jeszcze w wielu miejscach. Po co tak ? Zobacz ile się już &quot;kopiesz z koniem&quot;<br /><br />Dlaczego nie użyjesz przykładu z książki (kody do książki) czyli jakiegoś folderu z biblioteką i tym plikiem cfg ? zmieniając tylko te piny i przerwania ?<br /><br />Na pierwszy rzut oka widzę, że mogą być w tym co pokazałeś babole ale to jest chore tak analizować to w ciemno - jaki to ma sens ? Tak możemy pisać przez 100 tys postów.<br /><br />Poza tym ja założyłem że ty chcesz to odpalić w trybie HID ... ale teraz się zastanawiam czy na pewno w HID ? czy nie ? też chyba jasno to nie wyniknęło z postów<br /><br />i na koniec - pokazałeś mikrofragmencik swojego schematu - ale nawet na schemacie nie widać która to u ciebie linia D+ a która D- .... czy ty już na tym etapie nie poległeś?<br /><br />-------------------------<br /><br />Mówię ci - zacznij od przykładu/kodu z książki tzn z któregoś dowolnego ćwiczenia bo tam masz PRZEŚLICZNIE przygotowane usbconfig.h i na dodatek z ładnymi sekcjami do przełączania dla pinów i różnych przerwań dla kilku różnych procków - tak warto sobie samemu w kodach robić, żeby później uniwersalnie móc to przenosić na różne procki - a ty robisz to po linuxowemu. Zajrzyj pan do tych ćwiczeń kilku do tych plików usbconfig.h i przeanalizuj jak to przygotowałem - zobaczysz że doznasz olśnienia<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 9 sty 2021, o 19:55</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[drakston]]></name></author>
<updated>2021-01-09T19:32:40+01:00</updated>
<published>2021-01-09T19:32:40+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230531#p230531</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230531#p230531"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230531#p230531"><![CDATA[
Kod main jest wpis wyżej, sama próba połączenia.<br /><br />cały usbconfig<br />[syntax=c]/* Name: usbconfig.h<br /> * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers<br /> * Author: Christian Starkjohann<br /> * Creation Date: 2005-04-01<br /> * Tabsize: 4<br /> * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH<br /> * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)<br /> */<br /><br />#ifndef __usbconfig_h_included__<br />#define __usbconfig_h_included__<br /><br />/*<br />General Description:<br />This file is an example configuration (with inline documentation) for the USB<br />driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is<br />also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may<br />wire the lines to any other port, as long as D+ is also wired to INT0 (or any<br />other hardware interrupt, as long as it is the highest level interrupt, see<br />section at the end of this file).<br />+ To create your own usbconfig.h file, copy this file to your project's<br />+ firmware source directory) and rename it to &quot;usbconfig.h&quot;.<br />+ Then edit it accordingly.<br />*/<br /><br />/* ---------------------------- Hardware Config ---------------------------- */<br /><br />#define USB_CFG_IOPORTNAME      B<br />/* This is the port where the USB bus is connected. When you configure it to<br /> * &quot;B&quot;, the registers PORTB, PINB and DDRB will be used.<br /> */<br />#define USB_CFG_DMINUS_BIT      1<br />/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.<br /> * This may be any bit in the port.<br /> */<br />#define USB_CFG_DPLUS_BIT       2<br />/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.<br /> * This may be any bit in the port. Please note that D+ must also be connected<br /> * to interrupt pin INT0! &#91;You can also use other interrupts, see section<br /> * &quot;Optional MCU Description&quot; below, or you can connect D- to the interrupt, as<br /> * it is required if you use the USB_COUNT_SOF feature. If you use D- for the<br /> * interrupt, the USB interrupt will also be triggered at Start-Of-Frame<br /> * markers every millisecond.&#93;<br /> */<br />#define USB_CFG_CLOCK_KHZ       16000<br />/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000,<br /> * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code<br /> * require no crystal, they tolerate +/- 1% deviation from the nominal<br /> * frequency. All other rates require a precision of 2000 ppm and thus a<br /> * crystal!<br /> * Since F_CPU should be defined to your actual clock rate anyway, you should<br /> * not need to modify this setting.<br /> */<br />#define USB_CFG_CHECK_CRC       0<br />/* Define this to 1 if you want that the driver checks integrity of incoming<br /> * data packets (CRC checks). CRC checks cost quite a bit of code size and are<br /> * currently only available for 18 MHz crystal clock. You must choose<br /> * USB_CFG_CLOCK_KHZ = 18000 if you enable this option.<br /> */<br /><br />/* ----------------------- Optional Hardware Config ------------------------ */<br /><br />/* #define USB_CFG_PULLUP_IOPORTNAME   D */<br />/* If you connect the 1.5k pullup resistor from D- to a port pin instead of<br /> * V+, you can connect and disconnect the device from firmware by calling<br /> * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h).<br /> * This constant defines the port on which the pullup resistor is connected.<br /> */<br />/* #define USB_CFG_PULLUP_BIT          4 */<br />/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined<br /> * above) where the 1.5k pullup resistor is connected. See description<br /> * above for details.<br /> */<br /><br />/* --------------------------- Functional Range ---------------------------- */<br /><br />#define USB_CFG_HAVE_INTRIN_ENDPOINT    0<br />/* Define this to 1 if you want to compile a version with two endpoints: The<br /> * default control endpoint 0 and an interrupt-in endpoint (any other endpoint<br /> * number).<br /> */<br />#define USB_CFG_HAVE_INTRIN_ENDPOINT3   0<br />/* Define this to 1 if you want to compile a version with three endpoints: The<br /> * default control endpoint 0, an interrupt-in endpoint 3 (or the number<br /> * configured below) and a catch-all default interrupt-in endpoint as above.<br /> * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature.<br /> */<br />#define USB_CFG_EP3_NUMBER              3<br />/* If the so-called endpoint 3 is used, it can now be configured to any other<br /> * endpoint number (except 0) with this macro. Default if undefined is 3.<br /> */<br />/* #define USB_INITIAL_DATATOKEN           USBPID_DATA1 */<br />/* The above macro defines the startup condition for data toggling on the<br /> * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1.<br /> * Since the token is toggled BEFORE sending any data, the first packet is<br /> * sent with the oposite value of this configuration!<br /> */<br />#define USB_CFG_IMPLEMENT_HALT          0<br />/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature<br /> * for endpoint 1 (interrupt endpoint). Although you may not need this feature,<br /> * it is required by the standard. We have made it a config option because it<br /> * bloats the code considerably.<br /> */<br />#define USB_CFG_SUPPRESS_INTR_CODE      0<br />/* Define this to 1 if you want to declare interrupt-in endpoints, but don't<br /> * want to send any data over them. If this macro is defined to 1, functions<br /> * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if<br /> * you need the interrupt-in endpoints in order to comply to an interface<br /> * (e.g. HID), but never want to send any data. This option saves a couple<br /> * of bytes in flash memory and the transmit buffers in RAM.<br /> */<br />#define USB_CFG_INTR_POLL_INTERVAL      10<br />/* If you compile a version with endpoint 1 (interrupt-in), this is the poll<br /> * interval. The value is in milliseconds and must not be less than 10 ms for<br /> * low speed devices.<br /> */<br />#define USB_CFG_IS_SELF_POWERED         0<br />/* Define this to 1 if the device has its own power supply. Set it to 0 if the<br /> * device is powered from the USB bus.<br /> */<br />#define USB_CFG_MAX_BUS_POWER           100<br />/* Set this variable to the maximum USB bus power consumption of your device.<br /> * The value is in milliamperes. &#91;It will be divided by two since USB<br /> * communicates power requirements in units of 2 mA.&#93;<br /> */<br />#define USB_CFG_IMPLEMENT_FN_WRITE      0<br />/* Set this to 1 if you want usbFunctionWrite() to be called for control-out<br /> * transfers. Set it to 0 if you don't need it and want to save a couple of<br /> * bytes.<br /> */<br />#define USB_CFG_IMPLEMENT_FN_READ       0<br />/* Set this to 1 if you need to send control replies which are generated<br /> * &quot;on the fly&quot; when usbFunctionRead() is called. If you only want to send<br /> * data from a static buffer, set it to 0 and return the data from<br /> * usbFunctionSetup(). This saves a couple of bytes.<br /> */<br />#define USB_CFG_IMPLEMENT_FN_WRITEOUT   0<br />/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints.<br /> * You must implement the function usbFunctionWriteOut() which receives all<br /> * interrupt/bulk data sent to any endpoint other than 0. The endpoint number<br /> * can be found in 'usbRxToken'.<br /> */<br />#define USB_CFG_HAVE_FLOWCONTROL        0<br />/* Define this to 1 if you want flowcontrol over USB data. See the definition<br /> * of the macros usbDisableAllRequests() and usbEnableAllRequests() in<br /> * usbdrv.h.<br /> */<br />#define USB_CFG_DRIVER_FLASH_PAGE       0<br />/* If the device has more than 64 kBytes of flash, define this to the 64 k page<br /> * where the driver's constants (descriptors) are located. Or in other words:<br /> * Define this to 1 for boot loaders on the ATMega128.<br /> */<br />#define USB_CFG_LONG_TRANSFERS          0<br />/* Define this to 1 if you want to send/receive blocks of more than 254 bytes<br /> * in a single control-in or control-out transfer. Note that the capability<br /> * for long transfers increases the driver size.<br /> */<br />/* #define USB_RX_USER_HOOK(data, len)     if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */<br />/* This macro is a hook if you want to do unconventional things. If it is<br /> * defined, it's inserted at the beginning of received message processing.<br /> * If you eat the received message and don't want default processing to<br /> * proceed, do a return after doing your things. One possible application<br /> * (besides debugging) is to flash a status LED on each packet.<br /> */<br />/* #define USB_RESET_HOOK(resetStarts)     if(!resetStarts){hadUsbReset();} */<br />/* This macro is a hook if you need to know when an USB RESET occurs. It has<br /> * one parameter which distinguishes between the start of RESET state and its<br /> * end.<br /> */<br />/* #define USB_SET_ADDRESS_HOOK()              hadAddressAssigned(); */<br />/* This macro (if defined) is executed when a USB SET_ADDRESS request was<br /> * received.<br /> */<br />#define USB_COUNT_SOF                   0<br />/* define this macro to 1 if you need the global variable &quot;usbSofCount&quot; which<br /> * counts SOF packets. This feature requires that the hardware interrupt is<br /> * connected to D- instead of D+.<br /> */<br />/* #ifdef __ASSEMBLER__<br /> * macro myAssemblerMacro<br /> *     in      YL, TCNT0<br /> *     sts     timer0Snapshot, YL<br /> *     endm<br /> * #endif<br /> * #define USB_SOF_HOOK                    myAssemblerMacro<br /> * This macro (if defined) is executed in the assembler module when a<br /> * Start Of Frame condition is detected. It is recommended to define it to<br /> * the name of an assembler macro which is defined here as well so that more<br /> * than one assembler instruction can be used. The macro may use the register<br /> * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages<br /> * immediately after an SOF pulse may be lost and must be retried by the host.<br /> * What can you do with this hook? Since the SOF signal occurs exactly every<br /> * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in<br /> * designs running on the internal RC oscillator.<br /> * Please note that Start Of Frame detection works only if D- is wired to the<br /> * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES!<br /> */<br />#define USB_CFG_CHECK_DATA_TOGGLING     0<br />/* define this macro to 1 if you want to filter out duplicate data packets<br /> * sent by the host. Duplicates occur only as a consequence of communication<br /> * errors, when the host does not receive an ACK. Please note that you need to<br /> * implement the filtering yourself in usbFunctionWriteOut() and<br /> * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable<br /> * for each control- and out-endpoint to check for duplicate packets.<br /> */<br />#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH   0<br />/* define this macro to 1 if you want the function usbMeasureFrameLength()<br /> * compiled in. This function can be used to calibrate the AVR's RC oscillator.<br /> */<br />#define USB_USE_FAST_CRC                0<br />/* The assembler module has two implementations for the CRC algorithm. One is<br /> * faster, the other is smaller. This CRC routine is only used for transmitted<br /> * messages where timing is not critical. The faster routine needs 31 cycles<br /> * per byte while the smaller one needs 61 to 69 cycles. The faster routine<br /> * may be worth the 32 bytes bigger code size if you transmit lots of data and<br /> * run the AVR close to its limit.<br /> */<br /><br />/* -------------------------- Device Description --------------------------- */<br /><br />#define  USB_CFG_VENDOR_ID       0xc0, 0x16 /* = 0x16c0 = 5824 = voti.nl */<br />/* USB vendor ID for the device, low byte first. If you have registered your<br /> * own Vendor ID, define it here. Otherwise you may use one of obdev's free<br /> * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules!<br /> * *** IMPORTANT NOTE ***<br /> * This template uses obdev's shared VID/PID pair for Vendor Class devices<br /> * with libusb: 0x16c0/0x5dc.  Use this VID/PID pair ONLY if you understand<br /> * the implications!<br /> */<br />#define  USB_CFG_DEVICE_ID       0xdc, 0x05 /* = 0x05dc = 1500 */<br />/* This is the ID of the product, low byte first. It is interpreted in the<br /> * scope of the vendor ID. If you have registered your own VID with usb.org<br /> * or if you have licensed a PID from somebody else, define it here. Otherwise<br /> * you may use one of obdev's free shared VID/PID pairs. See the file<br /> * USB-IDs-for-free.txt for details!<br /> * *** IMPORTANT NOTE ***<br /> * This template uses obdev's shared VID/PID pair for Vendor Class devices<br /> * with libusb: 0x16c0/0x5dc.  Use this VID/PID pair ONLY if you understand<br /> * the implications!<br /> */<br />#define USB_CFG_DEVICE_VERSION  0x00, 0x01<br />/* Version number of the device: Minor number first, then major number.<br /> */<br />#define USB_CFG_VENDOR_NAME     'o', 'b', 'd', 'e', 'v', '.', 'a', 't'<br />#define USB_CFG_VENDOR_NAME_LEN 8<br />/* These two values define the vendor name returned by the USB device. The name<br /> * must be given as a list of characters under single quotes. The characters<br /> * are interpreted as Unicode (UTF-16) entities.<br /> * If you don't want a vendor name string, undefine these macros.<br /> * ALWAYS define a vendor name containing your Internet domain name if you use<br /> * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for<br /> * details.<br /> */<br />#define USB_CFG_DEVICE_NAME     'T', 'e', 'm', 'p', 'l', 'a', 't', 'e'<br />#define USB_CFG_DEVICE_NAME_LEN 8<br />/* Same as above for the device name. If you don't want a device name, undefine<br /> * the macros. See the file USB-IDs-for-free.txt before you assign a name if<br /> * you use a shared VID/PID.<br /> */<br />/*#define USB_CFG_SERIAL_NUMBER   'N', 'o', 'n', 'e' */<br />/*#define USB_CFG_SERIAL_NUMBER_LEN   0 */<br />/* Same as above for the serial number. If you don't want a serial number,<br /> * undefine the macros.<br /> * It may be useful to provide the serial number through other means than at<br /> * compile time. See the section about descriptor properties below for how<br /> * to fine tune control over USB descriptors such as the string descriptor<br /> * for the serial number.<br /> */<br />#define USB_CFG_DEVICE_CLASS        0xff    /* set to 0 if deferred to interface */<br />#define USB_CFG_DEVICE_SUBCLASS     0<br />/* See USB specification if you want to conform to an existing device class.<br /> * Class 0xff is &quot;vendor specific&quot;.<br /> */<br />#define USB_CFG_INTERFACE_CLASS     0   /* define class here if not at device level */<br />#define USB_CFG_INTERFACE_SUBCLASS  0<br />#define USB_CFG_INTERFACE_PROTOCOL  0<br />/* See USB specification if you want to conform to an existing device class or<br /> * protocol. The following classes must be set at interface level:<br /> * HID class is 3, no subclass and protocol required (but may be useful!)<br /> * CDC class is 2, use subclass 2 and protocol 1 for ACM<br /> */<br />/* #define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH    42 */<br />/* Define this to the length of the HID report descriptor, if you implement<br /> * an HID device. Otherwise don't define it or define it to 0.<br /> * If you use this define, you must add a PROGMEM character array named<br /> * &quot;usbHidReportDescriptor&quot; to your code which contains the report descriptor.<br /> * Don't forget to keep the array and this define in sync!<br /> */<br /><br />/* #define USB_PUBLIC static */<br />/* Use the define above if you #include usbdrv.c instead of linking against it.<br /> * This technique saves a couple of bytes in flash memory.<br /> */<br /><br />/* ------------------- Fine Control over USB Descriptors ------------------- */<br />/* If you don't want to use the driver's default USB descriptors, you can<br /> * provide our own. These can be provided as (1) fixed length static data in<br /> * flash memory, (2) fixed length static data in RAM or (3) dynamically at<br /> * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more<br /> * information about this function.<br /> * Descriptor handling is configured through the descriptor's properties. If<br /> * no properties are defined or if they are 0, the default descriptor is used.<br /> * Possible properties are:<br /> *   + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched<br /> *     at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is<br /> *     used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if<br /> *     you want RAM pointers.<br /> *   + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found<br /> *     in static memory is in RAM, not in flash memory.<br /> *   + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash),<br /> *     the driver must know the descriptor's length. The descriptor itself is<br /> *     found at the address of a well known identifier (see below).<br /> * List of static descriptor names (must be declared PROGMEM if in flash):<br /> *   char usbDescriptorDevice&#91;&#93;;<br /> *   char usbDescriptorConfiguration&#91;&#93;;<br /> *   char usbDescriptorHidReport&#91;&#93;;<br /> *   char usbDescriptorString0&#91;&#93;;<br /> *   int usbDescriptorStringVendor&#91;&#93;;<br /> *   int usbDescriptorStringDevice&#91;&#93;;<br /> *   int usbDescriptorStringSerialNumber&#91;&#93;;<br /> * Other descriptors can't be provided statically, they must be provided<br /> * dynamically at runtime.<br /> *<br /> * Descriptor properties are or-ed or added together, e.g.:<br /> * #define USB_CFG_DESCR_PROPS_DEVICE   (USB_PROP_IS_RAM | USB_PROP_LENGTH(18))<br /> *<br /> * The following descriptors are defined:<br /> *   USB_CFG_DESCR_PROPS_DEVICE<br /> *   USB_CFG_DESCR_PROPS_CONFIGURATION<br /> *   USB_CFG_DESCR_PROPS_STRINGS<br /> *   USB_CFG_DESCR_PROPS_STRING_0<br /> *   USB_CFG_DESCR_PROPS_STRING_VENDOR<br /> *   USB_CFG_DESCR_PROPS_STRING_PRODUCT<br /> *   USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER<br /> *   USB_CFG_DESCR_PROPS_HID<br /> *   USB_CFG_DESCR_PROPS_HID_REPORT<br /> *   USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver)<br /> *<br /> * Note about string descriptors: String descriptors are not just strings, they<br /> * are Unicode strings prefixed with a 2 byte header. Example:<br /> * int  serialNumberDescriptor&#91;&#93; = {<br /> *     USB_STRING_DESCRIPTOR_HEADER(6),<br /> *     'S', 'e', 'r', 'i', 'a', 'l'<br /> * };<br /> */<br /><br />#define USB_CFG_DESCR_PROPS_DEVICE                  0<br />#define USB_CFG_DESCR_PROPS_CONFIGURATION           0<br />#define USB_CFG_DESCR_PROPS_STRINGS                 0<br />#define USB_CFG_DESCR_PROPS_STRING_0                0<br />#define USB_CFG_DESCR_PROPS_STRING_VENDOR           0<br />#define USB_CFG_DESCR_PROPS_STRING_PRODUCT          0<br />#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER    0<br />#define USB_CFG_DESCR_PROPS_HID                     0<br />#define USB_CFG_DESCR_PROPS_HID_REPORT              0<br />#define USB_CFG_DESCR_PROPS_UNKNOWN                 0<br /><br /><br />#define usbMsgPtr_t unsigned short<br />/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to<br /> * a scalar type here because gcc generates slightly shorter code for scalar<br /> * arithmetics than for pointer arithmetics. Remove this define for backward<br /> * type compatibility or define it to an 8 bit type if you use data in RAM only<br /> * and all RAM is below 256 bytes (tiny memory model in IAR CC).<br /> */<br /><br />/* ----------------------- Optional MCU Description ------------------------ */<br /><br />/* The following configurations have working defaults in usbdrv.h. You<br /> * usually don't need to set them explicitly. Only if you want to run<br /> * the driver on a device which is not yet supported or with a compiler<br /> * which is not fully supported (such as IAR C) or if you use a differnt<br /> * interrupt than INT0, you may have to define some of these.<br />*/<br />#define USB_INTR_CFG            PCMSK1<br />#define USB_INTR_CFG_SET        (1&lt;&lt;PCINT10)<br />#define USB_INTR_CFG_CLR        0 <br />#define USB_INTR_ENABLE         PCICR<br />#define USB_INTR_ENABLE_BIT     PCIE1<br />#define USB_INTR_PENDING        PCIFR<br />#define USB_INTR_PENDING_BIT    PCIF1 <br />#define USB_INTR_VECTOR         PCINT1_vect<br /> <br />#endif /* __usbconfig_h_included__ */[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=20843">drakston</a> — 9 sty 2021, o 19:32</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2021-01-09T19:06:35+01:00</updated>
<published>2021-01-09T19:06:35+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230530#p230530</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230530#p230530"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230530#p230530"><![CDATA[
Pokaż obydwie części konfiga twojego teraz - czyli jak masz PINY i te przerwania<br /><br />Poza tym czy wgrywasz jakąś najprostszą konfigurację do testu czy kombinujesz od razu z czymś ciężkim i nie wiadomo gdzie masz błąd<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 9 sty 2021, o 19:06</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[drakston]]></name></author>
<updated>2021-01-09T18:30:01+01:00</updated>
<published>2021-01-09T18:30:01+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230529#p230529</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230529#p230529"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230529#p230529"><![CDATA[
wg. noty powinno być tak<br /><br />[syntax=c]#define USB_INTR_CFG            PCMSK1<br />#define USB_INTR_CFG_SET        (1&lt;&lt;PCINT10)<br />#define USB_INTR_CFG_CLR        0 <br />#define USB_INTR_ENABLE         PCICR<br />#define USB_INTR_ENABLE_BIT     PCIE1<br />#define USB_INTR_PENDING        PCIFR<br />#define USB_INTR_PENDING_BIT    PCIF1 <br />#define USB_INTR_VECTOR         PCINT1_vect[/syntax]<br /><br />efekt taki że co pare sekund odświeża listę urządzeń w menedżerze i wyświetla okienko nie rozpoznano urządzenia.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=20843">drakston</a> — 9 sty 2021, o 18:30</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2021-01-09T13:40:12+01:00</updated>
<published>2021-01-09T13:40:12+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230522#p230522</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230522#p230522"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230522#p230522"><![CDATA[
<div class="quotetitle">drakston napisał(a):</div><div class="quotecontent"><br />O czym zapomniałem?<br /></div><br />nie wiem ale jak ja pokazywałem w przykładzie PCINT27 to był np PCMSK3 .... natomiast PCINT10 jest daleko od niego - na pewno o 8 bitów - więc wątpię (nie zaglądając teraz do noty PDF - ty sobie zajrzyj) bo pisałem ci żebyś zwrócił uwagę na wszyskie PCMSK<span style="color: #FF0000">x</span> i tak dalej - a ty sobie niefrasobliwie przepisałeś wszędzie z trójką.<br /><br />Zajrzyj do mojego postu wyżej<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 9 sty 2021, o 13:40</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[drakston]]></name></author>
<updated>2021-01-09T12:57:00+01:00</updated>
<published>2021-01-09T12:57:00+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230521#p230521</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230521#p230521"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230521#p230521"><![CDATA[
no to tak od początku<br />kawałek schematu z usb<br /><a href="https://obrazkiforum.atnel.pl/20843/ca086621d6bbf073e58d17b90961aea4.JPG"  class="postlink"><img src="https://obrazkiforum.atnel.pl/thumb/20843/ca086621d6bbf073e58d17b90961aea4.JPG" alt="Obrazek" /></a><br /><br />Chciałem przerobić przerwszy przykład komunikacji z książki, czyli po prostu żeby PC wykrył mi urządzenie. Biblioteka wykorzystana czysta, domyśla konfiguracja, lecę wg przykładu.<br /><br />Przy pierwszych próbach miałem podłączoną ścieżkę D+ do dwóch pinów, wywalało cały czas nie znalezione urządzenie. Dzisiaj jak się wyspałem w końcu <img src="https://forum.atnel.pl/images/smilies/icon_e_smile.gif" alt=":)" title="Szczęśliwy" /> kapnąłem że przecież nie obsługuje tego pinu nigdzie w kodzie więc stoi tam stan niski albo hi-z i pewnie wali mi transmisje do masy...<br /><br />Ścieżka ucięta, kod jak niżej<br />[syntax=c]#define USB_CFG_IOPORTNAME      B<br />/* This is the port where the USB bus is connected. When you configure it to<br /> * &quot;B&quot;, the registers PORTB, PINB and DDRB will be used.<br /> */<br />#define USB_CFG_DMINUS_BIT      1<br />/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.<br /> * This may be any bit in the port.<br /> */<br />#define USB_CFG_DPLUS_BIT       2<br />/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.<br /> * This may be any bit in the port. Please note that D+ must also be connected<br /> * to interrupt pin INT0! &#91;You can also use other interrupts, see section<br /> * &quot;Optional MCU Description&quot; below, or you can connect D- to the interrupt, as<br /> * it is required if you use the USB_COUNT_SOF feature. If you use D- for the<br /> * interrupt, the USB interrupt will also be triggered at Start-Of-Frame<br /> * markers every millisecond.&#93;<br /> */<br />#define USB_CFG_CLOCK_KHZ       16000[/syntax]<br />[syntax=c]#define USB_INTR_CFG            PCMSK3<br />#define USB_INTR_CFG_SET        (1&lt;&lt;PCINT10)<br />#define USB_INTR_CFG_CLR        0 <br />#define USB_INTR_ENABLE         PCICR<br />#define USB_INTR_ENABLE_BIT     PCIE3<br />#define USB_INTR_PENDING        PCIFR <br />#define USB_INTR_PENDING_BIT    PCIF3 <br />#define USB_INTR_VECTOR         PCINT3_vect[/syntax]<br />[syntax=c]#include &lt;avr/io.h&gt;<br />#include &lt;avr/interrupt.h&gt;<br />#include &lt;avr/pgmspace.h&gt;<br />#include &lt;avr/eeprom.h&gt;<br />#include &lt;util/delay.h&gt;<br />#include &lt;avr/wdt.h&gt;<br />//#include &quot;light_ws2812.h&quot;<br />//#include &quot;LCD4x40.h&quot;<br />#include &quot;usbdrv.h&quot;<br /><br />void usb_reset( void );<br /><br /><br /><br /><br />//struct cRGB led&#91;8&#93;; <br /><br />usbMsgLen_t usbFunctionSetup(uchar data&#91;8&#93;){<br /><br />return  0;<br />}<br /><br />int main()<br />{<br />//LCD_wlaczE2();<br />//LCD_Initalize();<br />//LCD_Clear_0();<br />//LCD_Clear_1();<br />//LCD_EkranPowitalny();<br />wdt_enable(WDTO_1S);// aktywacja watchdoga na 1 s<br />usbInit();// inicjalizacja V-USB<br />usb_reset();// reset urządzenia na magistrali USB<br /><br />sei();<br /><br />/*<br /><br />led&#91;0&#93;.r=50;led&#91;0&#93;.g=00;led&#91;0&#93;.b=00;<br />led&#91;1&#93;.r=00;led&#91;1&#93;.g=40;led&#91;1&#93;.b=00;<br />led&#91;2&#93;.r=00;led&#91;2&#93;.g=40;led&#91;2&#93;.b=00;<br />led&#91;3&#93;.r=00;led&#91;3&#93;.g=40;led&#91;3&#93;.b=00;<br />led&#91;4&#93;.r=00;led&#91;4&#93;.g=40;led&#91;4&#93;.b=00;<br />led&#91;5&#93;.r=00;led&#91;5&#93;.g=40;led&#91;5&#93;.b=00;<br />led&#91;6&#93;.r=00;led&#91;6&#93;.g=40;led&#91;6&#93;.b=00;<br />led&#91;7&#93;.r=00;led&#91;7&#93;.g=40;led&#91;7&#93;.b=00;<br />ws2812_setleds(led,8);<br />_delay_ms(10);<br />*/<br />while (1);<br />{<br />usbPoll();// zdarzenie do obsługi USB<br />wdt_reset();// resetuj watchdog<br />}<br /><br />}<br /><br />void usb_reset( void ) {<br />usbDeviceDisconnect();<br />uint8_t i = 0;<br />while(--i){         // odłączenie się do magistrali USB<br />    wdt_reset();    // na czas większy niż ok 250 ms<br />    _delay_ms(1);   //<br />}<br />usbDeviceConnect();<br />}<br /><br /><br /><br />#ifdef WDIF<br />    void __init3( void )  __attribute__ (( section( &quot;.init3&quot; ), naked, used ));<br />    void __init3( void )<br />    {<br />        /* wyłączenie watchdoga (w tych mikrokontrolerach, w których watchdog<br />         * ma możliwość generowania przerwania pozostaje on też aktywny po<br />         * resecie) */<br />        MCUSR = 0;<br />        _WD_CONTROL_REG = 1 &lt;&lt; _WD_CHANGE_BIT | 1 &lt;&lt; WDE;<br />        _WD_CONTROL_REG = 0;<br />    }<br />#endif[/syntax]<br /><br />i zima... nie ma nawet że nie rozpoznano urządzenia... Sprawdziłem na oscyloskopie to D- widać że jest trochę ponad 200ms stan niski, potem ramki informacji i i tak w kółko. na D+ lecą 3 krótkie ramki razem co jakiś czas.<br /><br />O czym zapomniałem?<br /><br />aha sprawdziłem też bez dodatkowej konfiguracji przerwania i też brak reakcji.<br /><br />dodam jeszcze że na pozostałych PORTB mam piny z danymi do LCD ale jest odpięte wszystko i kod do lcd zakomentowany więc nie powinno to robić problemu.<br /><br />Zegar leci na 16mhz, gdzie trzeba zdefiniowany. Brak błędów przy kompilacji, działam w AVRstudio. Robiłem ten przykład na atmega328p z wykorzystaniem portu INT0 i śmigało.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=20843">drakston</a> — 9 sty 2021, o 12:57</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2021-01-09T04:05:46+01:00</updated>
<published>2021-01-09T04:05:46+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230510#p230510</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230510#p230510"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230510#p230510"><![CDATA[
<div class="quotetitle">drakston napisał(a):</div><div class="quotecontent"><br />Jak rozumiem muszę się wokół tego w pliku zakręcić?<br /></div><br />W kodach przykładowych do książki masz ładnie wszystkie najpotrzebniejsze sekcje w tym tą którą tu pokazałeś - wystarczy że inną tzn dla innego procka zakomentujesz a odkomentujesz właśnie tą - i już będzie ci śmigać. Tu w tym wypadku będzie używany PCINT27 zamiast INTx<br /><br />Jeśli się upierasz na INT2 to hmmm musisz sprawdzić ale z tego co pamiętam to to przerwanie się nie nadaje bo jest asynchroniczne w porównaniu do INT0 albo INT1 ... ale ponieważ to procek m1284p to spokojnie możesz użyć przerwania PCINTx tylko sprawdź jaki to numerek PCINT w nocie PDF i ew podmień pozostałe nazwy jak <br /><br />PCMSKx<br />PCIEx<br />PCIFx<br />PCINTx_vect<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 9 sty 2021, o 04:05</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[drakston]]></name></author>
<updated>2021-01-08T22:18:41+01:00</updated>
<published>2021-01-08T22:18:41+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230503#p230503</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230503#p230503"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230503#p230503"><![CDATA[
usb mam podpięte pod poniższe piny<br /><div class="quotetitle"><b>Quote:</b></div><div class="quotecontent"><br />#define USB_CFG_IOPORTNAME      B<br />/* This is the port where the USB bus is connected. When you configure it to<br /> * &quot;B&quot;, the registers PORTB, PINB and DDRB will be used.<br /> */<br />#define USB_CFG_DMINUS_BIT      1<br />/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.<br /> * This may be any bit in the port.<br /> */<br />#define USB_CFG_DPLUS_BIT       2<br /></div><br /><br />Wrócilem do ksiązki i doczytałem tą sekcje<br /><br /><div class="quotetitle"><b>Quote:</b></div><div class="quotecontent"><br />jeśli zechcemy<br />użyć mikrokontrolerów ATmega644P lub ATmega1284P (odpowiednik, jeśli<br />chodzi o wyprowadzenia, tak jak ATmega32), to proponujemy w ramach<br />ćwiczeń wykorzystać przerwanie PCINTx dostępne również na pinie INT1,<br />czyli PCINT27. W takim przypadku konfiguracja będzie wyglądała tak:<br />/* -------------------------- Hardware Config ------------------------ */<br />#define USB_CFG_IOPORTNAME D<br />#define USB_CFG_DMINUS_BIT 5 // pin PD5<br />#define USB_CFG_DPLUS_BIT 3 // pin PCINT27 (PD3) dla ATmega644/1284<br />/* -------------------- Optional MCU Description --------------------- */<br />#define USB_INTR_CFG PCMSK3<br />#define USB_INTR_CFG_SET (1 &lt;&lt; PCINT27)<br />#define USB_INTR_CFG_CLR 0<br />#define USB_INTR_ENABLE PCICR<br />#define USB_INTR_ENABLE_BIT PCIE3<br />#define USB_INTR_PENDING PCIFR<br />#define USB_INTR_PENDING_BIT PCIF3<br />#define USB_INTR_VECTOR PCINT3_vect<br /></div><br /><br />Jak rozumiem muszę się wokół tego w pliku zakręcić?<br /><br />Można gdzieś znaleźć opis/rozwinięcie powyższych definicji ?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=20843">drakston</a> — 8 sty 2021, o 22:18</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2021-01-08T22:07:47+01:00</updated>
<published>2021-01-08T22:07:47+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230501#p230501</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230501#p230501"/>
<title type="html"><![CDATA[Re: V-USB - ATMEGA1284 - intx]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23523&amp;p=230501#p230501"><![CDATA[
pamiętaj że to nie tylko sekcja INTx ale i piny - na początku pliku<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 8 sty 2021, o 22:07</p><hr />
]]></content>
</entry>
</feed>