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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2015-12-08T02:02:57+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=4&amp;t=13802&amp;mode</id>
<entry>
<author><name><![CDATA[PioDer]]></name></author>
<updated>2015-12-08T02:02:57+01:00</updated>
<published>2015-12-08T02:02:57+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=13802&amp;p=147384#p147384</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=13802&amp;p=147384#p147384"/>
<title type="html"><![CDATA[[enc28j60]Nie zawsze wysyła pakiety - błędna funkcja?]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=13802&amp;p=147384#p147384"><![CDATA[
Witam!<br />Po większym obciążeniu enc28j60, układ nie wysyła niektórych pakietów. Podrzucam kod źródłowy do f-kcji wysłającej, zgodna z tuxgraphics. Na początku myślałem, że to wina wycieku pamięci, ale wygląda to tak, że dane dochodzą do tej funkcji w całości.<br /><br />[syntax=c]void enc28j60PacketSend(uint16_t len, uint8_t* packet)<br />{<br />// ENC28J60 Errata: Issue 12<br />while (enc28j60ReadOp(ENC28J60_READ_CTRL_REG, ECON1) &amp; ECON1_TXRTS)<br />{<br />if( (enc28j60Read(EIR) &amp; EIR_TXERIF) ) <br />{<br />enc28j60WriteOp(ENC28J60_BIT_FIELD_SET, ECON1, ECON1_TXRST);<br />enc28j60WriteOp(ENC28J60_BIT_FIELD_CLR, ECON1, ECON1_TXRST);<br />}<br />}<br /><br />// Set the write pointer to start of transmit buffer area<br />enc28j60Write(EWRPTL, TXSTART_INIT&amp;0xFF);<br />enc28j60Write(EWRPTH, TXSTART_INIT&gt;&gt;8);<br />// Set the TXND pointer to correspond to the packet size given<br />enc28j60Write(ETXNDL, (TXSTART_INIT+len)&amp;0xFF);<br />enc28j60Write(ETXNDH, (TXSTART_INIT+len)&gt;&gt;8);<br /><br />// write per-packet control byte<br />enc28j60WriteOp(ENC28J60_WRITE_BUF_MEM, 0, 0x00);<br /><br />// copy the packet into the transmit buffer<br />enc28j60WriteBuffer(len, packet);<br /><br />// send the contents of the transmit buffer onto the network<br />enc28j60WriteOp(ENC28J60_BIT_FIELD_SET, ECON1, ECON1_TXRTS);<br />}[/syntax]<br /><br />Pozdrawiam<br /><br /><strong>EDIT:</strong> czy ktoś jest w stanie odnieść się do Issue 13 z erraty ENC28J60:<br /><div class="quotetitle"><b>Quote:</b></div><div class="quotecontent"><br />When transmitting in Half-Duplex mode with some link partners, the PHY will sometimes incorrectly interpret a received link pulse as a collision event. If less than, or equal to, MACLCON2 bytes have been transmitted when the false collision occurs, the MAC will abort the current transmission, wait a random back-off delay and then automatically attempt to retransmit the packet from the beginning – as it would for a genuine collision. If greater than MACLCON2 bytes have been transmitted when the false collision occurs, the event will be considered a late collision by the MAC and the packet will be aborted without retrying. This causes the packet to not be delivered to the remote node. In some cases, the abort will fail to reset the transmit state machine.<br /></div><br /><br />Czy ktoś to weryfikował/poprawiał? Albo czy wersja z tuxgraphics jest OK?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=12054">PioDer</a> — 8 gru 2015, o 02:02</p><hr />
]]></content>
</entry>
</feed>