My static website generator using poole https://www.xythobuz.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

avrnetstack.html 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <html>
  2. <head>
  3. <meta charset="utf-8" />
  4. <title>avrNetStack - xythobuz.org</title>
  5. <meta name="description" content="Modular AVR TCP/IP Stack with Ethernet and WiFi support" />
  6. <meta name="keywords" content="xythobuz" />
  7. <link rel="author" href="/xythobuz@xythobuz.org">
  8. <link rel="shortcut icon" href="/img/favicon.ico">
  9. <script type="text/javascript" src="/js/sh_main.js"></script>
  10. <link type="text/css" rel="stylesheet" href="/css/sh_bright.min.css" />
  11. <link rel="stylesheet" href="/css/style.css" type="text/css" media="screen" />
  12. <link rel="alternate" type="application/rss+xml" title="Blog Feed" href="/rss.xml">
  13. <link rel="stylesheet" href="/css/gh-fork-ribbon.css" />
  14. <link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'>
  15. <script type='text/javascript'>
  16. /* <![CDATA[ */
  17. (function() {
  18. var s = document.createElement('script');
  19. var t = document.getElementsByTagName('script')[0];
  20. s.type = 'text/javascript';
  21. s.async = true;
  22. s.src = '//api.flattr.com/js/0.6/load.js?mode=auto&uid=xythobuz&category=text';
  23. t.parentNode.insertBefore(s, t);
  24. })();
  25. /* ]]> */
  26. </script>
  27. </head>
  28. <body onload="sh_highlightDocument('/js/sh/', '.min.js');">
  29. <div class="github-fork-ribbon-wrapper right">
  30. <div class="github-fork-ribbon"><a href="
  31. https://github.com/xythobuz/avrNetStack
  32. ">Fork me on GitHub</a></div></div>
  33. <div id="header">
  34. <h1>xythobuz.org</h1>
  35. <h2>avrNetStack</h2>
  36. </div>
  37. <div id="lang"><span id="lang">Translation:
  38. <a href='avrnetstack.html'>en</a>
  39. </span></div>
  40. <div class="colmask leftmenu"><div class="colleft">
  41. <div class="content">
  42. <div id="flattr">
  43. <a class="FlattrButton" href="http://www.xythobuz.org/avrnetstack.html" title="avrNetStack">Modular AVR TCP/IP Stack with Ethernet and WiFi support</a>
  44. </div>
  45. <div id="twitter">
  46. <a href="https://twitter.com/share" class="twitter-share-button" data-via="xythobuz" data-dnt="true" data-related="xythobuz" data-count="vertical">Tweet</a><script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
  47. </div>
  48. <div id="reddit">
  49. <script type="text/javascript">reddit_url = "http://www.xythobuz.org/avrnetstack.html";</script>
  50. <script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script>
  51. </div>
  52. <div id="github">
  53. <a href="https://github.com/xythobuz/avrNetStack" class="gitforked-button gitforked-forks gitforked-watchers">Fork</a>
  54. </div>
  55. <h1>avrNetStack</h1>
  56. <p><a href="https://github.com/xythobuz/avrNetStack">avrNetStack</a> aims to be a very modular Networking Stack running on AVR Microcontrollers and supporting different Network Hardware (ENC28J60, MRF24WB).
  57. Select your MCU and hardware driver in the makefile.
  58. Compile with "make lib" to create a static library.
  59. Compile with "make test" to create a test hex file to use with the hardware found in Hardware/avrNetStack.sch. You need Eagle 6, available for free from cadsoft.
  60. In the future, a PCB will be designed that can act as WLAN / LAN Module for your AVR Project, in addition to this software.</p>
  61. <p><a href="/img/net.jpg"><img alt="Foto 1" src="/img/net_small.jpg" /></a>
  62. <a href="/img/net2.jpg"><img alt="Foto 2" src="/img/net2_small.jpg" /></a>
  63. <a href="/img/teaser2.png"><img alt="Foto 2" src="/img/teaser2_small.png" /></a></p>
  64. <h2>License</h2>
  65. <p>All files in "lib/drivers/asynclabs" are released under the <a href="http://www.gnu.org/licenses/gpl-2.0.html">GPLv2</a>.</p>
  66. <pre>
  67. &copy; 2009 Async Labs Inc.
  68. &copy; 2012 Thomas Buck
  69. </pre>
  70. <p>Everything else, if not mentioned otherwise elsewhere, is released under a BSD 2-Clause License. See the accompanying COPYING file.</p>
  71. <h2>Software Overview</h2>
  72. <h3>ENC28J60 Driver</h3>
  73. <p>This is a self-written driver for <a href="http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en022889">Microchips ENC28J60</a>, based on it's <a href="http://ww1.microchip.com/downloads/en/DeviceDoc/39662d.pdf">datasheet</a> and the <a href="http://ww1.microchip.com/downloads/en/DeviceDoc/80349c.pdf">silicon errata</a>. It is operating (more or less) stable.
  74. The 8KB Buffer in the ENC28J60 is not really used, as all received Packets are placed in RAM before using their data. It will be used as FIFO for Packets that are received before the CPU is able to work on them.
  75. You can change the size and location of the Receive and Transmit Segments in the ENC28J60 SRAM.</p>
  76. <h3>MRF24WB0MA Driver</h3>
  77. <p>This is based on Stefan Heeschs modified version of Asynclabs G2100 Driver, released in <a href="http://www.mikrocontroller.net/topic/175463#1945568">this forum thread</a>, modified to work with this Networking Stack. This is a heavy work in progress.</p>
  78. <h3>Hardware Libraries</h3>
  79. <p>avrNetStack includes UART, SPI and Timer libs aswell as a basic task switcher and scheduler.
  80. The UART lib uses FIFO Buffers for receiving and transmitting interrupt driven. Change the Buffer size in 'include/serial.h', if you want. For debugging, you can run the serial library in a blocking mode.
  81. The Time lib supports 16MHz and 20MHz on a small selection of hardware devices. If you get compile errors after changing the target plattform in the makefile, you have to extend these libraries to support your target.
  82. If you want to use the UART with your own software don't include another UART library. Use the functions from serial.h!
  83. You need to call scheduler() and tasks() in you main-loop and also enable interrupts to use the Networking Stack. Both are completely dynamic, so you can use them for your application logic, too.
  84. The std module is a wrapper for the libc memory allocation functions. It is used to keep track of memory allocations for debugging purposes.</p>
  85. <h3>Debug Output</h3>
  86. <p>Every software modules debug output can be individually turned off or on. Just set the "#define DEBUG" at the start of the file to 1' or higher. To add debug output, use debugPrint() to print. If you need some more code to generate your output, put it in a "#if DEBUG == 1 ... #endif" block.
  87. debug.h also includes a custom assert implementation.</p>
  88. <h3>Controller Module</h3>
  89. <p>Controls the operation of the whole network stack. It contains only one function for the main program, networkInit. It is to be called once afer System Reset and performs initialization of all necessary hardware and buffers, etc. Also, some definitions can be uncommented in the controller.h file to deactivate parts of the stack. This could allow you to run a subset of the stack on a smaller AVR.</p>
  90. <h3>MAC Module</h3>
  91. <p>These are the Network Hardware drivers. Different MAC implementations will exist in the future, right now only the ENC28J60 is supported. This allows sending Ethernet Packets, as well as receiving them. Received Packets are given to the appropriate next layer by the controller.</p>
  92. <h3>ARP Module</h3>
  93. <p>Handles received ARP Packets, maintains an ARP Cache and gives functions of higher layers a method to obtain a MAC Address from an IP Address.
  94. If the Cache has no hit, an ARP Packet is issued, so that the higher layer can try again later.</p>
  95. <h3>IPv4 Module</h3>
  96. <p>Handles received IPv4 Packets. Received valid Datagrams are given to the appropriate next stack layer. Also, IPv4 Packets can be transmitted with this module.
  97. It buffers outgoing IPv4 Packets to get the target MAC from the ARP Module automatically.</p>
  98. <h3>ICMP Module</h3>
  99. <p>Handles received ICMP Packets. Can answer and send out echo requests.
  100. A single handler for echo replies can be registered. This is used to implement a simple Ping Utility in "test/main.c".</p>
  101. <h3>UDP Module</h3>
  102. <p>Handles the really simple User Datagram Protocol. A handler for every port can be registered and UDP packets can be transmitted.</p>
  103. <h3>NTP Module</h3>
  104. <p>Simple NTP (SNTP) Client. Will update systemTime automagically to the current unix timestamp some time after calling ntpIssueRequest().</p>
  105. <div id="disqus_thread"></div>
  106. <script type="text/javascript">
  107. var disqus_shortname = "xythobuz";
  108. (function() {
  109. var dsq = document.createElement("script"); dsq.type = "text/javascript"; dsq.async = true;
  110. dsq.src = "http://" + disqus_shortname + ".disqus.com/embed.js";
  111. (document.getElementsByTagName("head")[0] || document.getElementsByTagName("body")[0]).appendChild(dsq);
  112. })();
  113. </script>
  114. <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
  115. <a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
  116. </div>
  117. <div class="nav">
  118. <h3>Thomas Buck</h3>
  119. <div id="logo"><img id="logo" src="http://www.gravatar.com/avatar/8d18fec40a74782052fb4c007d212475?s=180" alt="Avatar"></div>
  120. <p id="bio">
  121. 19 year old Information Engineering student from Germany.
  122. Making cool stuff, mostly with AVR microcontrollers.
  123. </p>
  124. <iframe src="http://githubbadge.appspot.com/badge/xythobuz?a=0" style="border: 0;height: 142px;width: 200px;overflow: hidden;" frameBorder=0></iframe>
  125. <ul id="menuList">
  126. <li><a href="/index.html">Home</a></li>
  127. <li><a href="/blog.html">Blog</a></li>
  128. <li><a href="/contact.html">Contact</a></li>
  129. <br>
  130. <li><a href="/ledcube.html">8x8x8 LED Cube</a></li>
  131. <li><a href="/yasab.html">YASAB AVR Bootloader</a></li>
  132. <li><a href="/avrnetstack.html">avrNetStack</a></li>
  133. <li><a href="/avrserial.html">AVR Serial Library</a></li>
  134. <li><a href="/serialdebug.html">Serial Debug</a></li>
  135. <li><a href="/ledmatrix.html">LED Matrix</a></li>
  136. <li><a href="/ssop28.html">SSOP28 - DIL Adapter</a></li>
  137. <li><a href="/xyrobot.html">xyRobot</a></li>
  138. <li><a href="/bluetooth.html">Bluetooth UART (BTM-222)</a></li>
  139. <li><a href="/k6x4008.html">K6x4008 SRAM</a></li>
  140. <li><a href="/xyrobotremote.html">xyRobotRemote</a></li>
  141. <li><a href="/rremote.html">rRemote</a></li>
  142. <br>
  143. <li><a href="/c250.html">Mio C250 Unlock</a></li>
  144. <li><a href="/nas.html">IB-NAS6210 Linux</a></li>
  145. <li><a href="/ultimatenotifier.html">Ultimate Notifier Script</a></li>
  146. <li><a href="/serialhelper.html">Serial Helper</a></li>
  147. </ul>
  148. <div id="recent">
  149. Recent blog posts:
  150. <ul id="recentList">
  151. <li class="recentList"><a href="/2013_03_25_doxygen.html">xyControl Doxygen Dokumentation</a></li><li class="recentDate">2013-03-25</li>
  152. <li class="recentList"><a href="/2013_03_16_pid.html">xyCopter PID-Parameter</a></li><li class="recentDate">2013-03-16</li>
  153. <li class="recentList"><a href="/2013_03_13_test_rig.html">Quadrocopter Test Rig Video</a></li><li class="recentDate">2013-03-13</li>
  154. <li class="recentList"><a href="/2013_03_12_test_rig.html">Quadrocopter Testvorrichtung</a></li><li class="recentDate">2013-03-12</li>
  155. <li class="recentList"><a href="/2013_03_10_yasab.html">xyCopter loves YASAB</a></li><li class="recentDate">2013-03-10</li>
  156. </ul>
  157. </div>
  158. </div>
  159. </div></div>
  160. <img id="dude" alt="The Dude" src="/img/dude.png">
  161. <div id="footer">
  162. Built with <a href="http://bitbucket.org/obensonne/poole">Poole</a>
  163. &middot;
  164. Licensed as <a href="http://creativecommons.org/licenses/by/3.0">CC-BY</a>
  165. &middot;
  166. <a href="http://validator.w3.org/check?uri=referer">Validate HTML</a>
  167. &middot;
  168. <a href="http://jigsaw.w3.org/css-validator/validator?uri=xythobuz.org%2Fstyle.css&amp;profile=css3">Validate CSS</a>
  169. &middot;
  170. <a href="http://feed1.w3.org/check.cgi?url=http://www.xythobuz.org/rss.xml">Validate RSS</a>
  171. &middot;
  172. <a href="http://www.validome.org/google/validate?url=http://www.xythobuz.org&amp;googleTyp=SITEMAP">Validate Sitemap</a>
  173. </div>
  174. <script src="http://gitforked.com/api/1.1/button.js" type="text/javascript"></script>
  175. </body>
  176. </html>