123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <title>avrNetStack (#) xythobuz.de</title>
- <meta name="description" content="Modular AVR TCP/IP Stack with Ethernet and WiFi support" />
- <meta name="keywords" content="xythobuz" />
- <link rel="author" href="/xythobuz@xythobuz.de">
- <link rel="shortcut icon" href="/img/favicon.ico">
- <script type="text/javascript" src="/js/sh_main.js"></script>
- <link type="text/css" rel="stylesheet" href="/css/sh_bright.min.css" />
- <link rel="stylesheet" href="/css/style.css" type="text/css" media="screen" />
- <link rel="alternate" type="application/rss+xml" title="Blog" href="/rss.xml">
- <link rel="stylesheet" href="/css/gh-fork-ribbon.css" />
- <link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'>
- <script type='text/javascript'>
- /* <![CDATA[ */
- (function() {
- var s = document.createElement('script');
- var t = document.getElementsByTagName('script')[0];
- s.type = 'text/javascript';
- s.async = true;
- s.src = '//api.flattr.com/js/0.6/load.js?mode=auto&uid=xythobuz&category=text';
- t.parentNode.insertBefore(s, t);
- })();
- /* ]]> */
- </script>
- </head>
- <body onload="sh_highlightDocument('/js/sh/', '.min.js');">
- <div class="github-fork-ribbon-wrapper right">
- <div class="github-fork-ribbon"><a href="
- https://github.com/xythobuz/avrNetStack
- ">Fork me on GitHub</a></div></div>
- <div id="header">
- <h1>xythobuz.de</h1>
- <p><a href="http://xythobuz.de/lastmusic">♫</a></p>
- <h2>avrNetStack</h2>
- </div>
-
- <div class="colmask leftmenu"><div class="colleft">
- <div class="content">
-
- <h1>avrNetStack</h1>
- <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).
- Select your MCU and hardware driver in the makefile.
- Compile with "make lib" to create a static library.
- 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.
- 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>
- <p><a href="/img/net.jpg"><img alt="Foto 1" src="/img/net_small.jpg" /></a>
- <a href="/img/net2.jpg"><img alt="Foto 2" src="/img/net2_small.jpg" /></a>
- <a href="/img/teaser2.png"><img alt="Foto 2" src="/img/teaser2_small.png" /></a></p>
- <h2>License</h2>
- <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>
- <pre>
- © 2009 Async Labs Inc.
- © 2012 Thomas Buck
- </pre>
-
- <p>Everything else, if not mentioned otherwise elsewhere, is released under a BSD 2-Clause License. See the accompanying COPYING file.</p>
- <h2>Software Overview</h2>
- <h3>ENC28J60 Driver</h3>
- <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.
- 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.
- You can change the size and location of the Receive and Transmit Segments in the ENC28J60 SRAM.</p>
- <h3>MRF24WB0MA Driver</h3>
- <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>
- <h3>Hardware Libraries</h3>
- <p>avrNetStack includes UART, SPI and Timer libs aswell as a basic task switcher and scheduler.
- 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.
- 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.
- If you want to use the UART with your own software don't include another UART library. Use the functions from serial.h!
- 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.
- 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>
- <h3>Debug Output</h3>
- <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.
- debug.h also includes a custom assert implementation.</p>
- <h3>Controller Module</h3>
- <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>
- <h3>MAC Module</h3>
- <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>
- <h3>ARP Module</h3>
- <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.
- If the Cache has no hit, an ARP Packet is issued, so that the higher layer can try again later.</p>
- <h3>IPv4 Module</h3>
- <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.
- It buffers outgoing IPv4 Packets to get the target MAC from the ARP Module automatically.</p>
- <h3>ICMP Module</h3>
- <p>Handles received ICMP Packets. Can answer and send out echo requests.
- A single handler for echo replies can be registered. This is used to implement a simple Ping Utility in "test/main.c".</p>
- <h3>UDP Module</h3>
- <p>Handles the really simple User Datagram Protocol. A handler for every port can be registered and UDP packets can be transmitted.</p>
- <h3>NTP Module</h3>
- <p>Simple NTP (SNTP) Client. Will update systemTime automagically to the current unix timestamp some time after calling ntpIssueRequest().</p>
-
- <span id="flattr">
- <a class="FlattrButton" href="http://www.xythobuz.de/avrnetstack.html" title="avrNetStack">Modular AVR TCP/IP Stack with Ethernet and WiFi support</a>
- </span>
- <span id="twitter">
- <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>
- </span>
- <span id="reddit">
- <script type="text/javascript">reddit_url = "http://www.xythobuz.de/avrnetstack.html";</script>
- <script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script>
- </span>
- <span id="github">
- <a href="https://github.com/xythobuz/avrNetStack" class="gitforked-button gitforked-forks gitforked-watchers">Fork</a>
- </span>
-
- <div id="print"><script>var pfHeaderImgUrl = '';var pfHeaderTagline = '';var pfdisableClickToDel = 0;var pfHideImages = 0;var pfImageDisplayStyle = 'right';var pfDisablePDF = 0;var pfDisableEmail = 0;var pfDisablePrint = 0;var pfCustomCSS = '';var pfBtVersion='1';(function(){var js, pf;pf = document.createElement('script');pf.type = 'text/javascript';if('https:' == document.location.protocol){js='https://pf-cdn.printfriendly.com/ssl/main.js'}else{js='http://cdn.printfriendly.com/printfriendly.js'}pf.src=js;document.getElementsByTagName('head')[0].appendChild(pf)})();</script><a href="http://www.printfriendly.com" style="color:#6D9F00;text-decoration:none;" class="printfriendly" onclick="window.print();return false;" title="Printer Friendly and PDF"><img style="border:none;margin:0 6px" src="https://pf-cdn.printfriendly.com/images/icons/pf-print-icon.gif" width="16" height="15" alt="Print Friendly Version of this page" />Print <img style="border:none;margin:0 6px" src="https://pf-cdn.printfriendly.com/images/icons/pf-pdf-icon.gif" width="12" height="12" alt="Get a PDF version of this webpage" />PDF</a></div>
- <div id="disqus_thread"></div>
- <script type="text/javascript">
- var disqus_shortname = "xythobuz";
- (function() {
- var dsq = document.createElement("script"); dsq.type = "text/javascript"; dsq.async = true;
- dsq.src = "http://" + disqus_shortname + ".disqus.com/embed.js";
- (document.getElementsByTagName("head")[0] || document.getElementsByTagName("body")[0]).appendChild(dsq);
- })();
- </script>
- <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
- <a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
-
- </div>
- <div class="nav">
- <h3>Thomas Buck</h3>
-
- <div id="logo"><img id="logoImg" src="http://www.gravatar.com/avatar/8d18fec40a74782052fb4c007d212475?s=180" alt="Avatar"></div>
-
- <p id="bio">
- I'm a 19 year old Information Engineering student from Germany, mostly building cool stuff with AVR microcontrollers. All of my projects are released as <a href="http://www.gnu.org/philosophy/free-sw.html">Free Software</a> on my <a href="https://github.com/xythobuz">GitHub Profile</a>. It would be nice if you could use this <a href="http://www.amazon.de/?_encoding=UTF8&camp=1638&creative=19454&linkCode=ur2&site-redirect=de&tag=xythobuzorg-21">Amazon.de Affiliate Link</a>.
- </p>
-
- <ul id="menuList">
- <li><a href="/index.html">Home</a></li>
- <li><a href="/blog.html">Blog</a></li>
- <li><a href="/contact.html">Contact</a></li>
- <li> </li>
- <li><a href="/ledcube.html">8x8x8 LED Cube</a></li>
- <li><a href="/yasab.html">YASAB AVR Bootloader</a></li>
- <li><a href="/avrnetstack.html">avrNetStack</a></li>
- <li><a href="/xycontrol.html">xyControl</a></li>
- <li><a href="/avrserial.html">AVR Serial Library</a></li>
- <li><a href="/serialdebug.html">Serial Debug</a></li>
- <li><a href="/ledmatrix.html">LED Matrix</a></li>
- <li><a href="/ssop28.html">SSOP28 - DIL Adapter</a></li>
- <li><a href="/xyrobot.html">xyRobot</a></li>
- <li><a href="/bluetooth.html">Bluetooth UART (BTM-222)</a></li>
- <li><a href="/k6x4008.html">K6x4008 SRAM</a></li>
- <li><a href="/xyrobotremote.html">xyRobotRemote</a></li>
- <li><a href="/rremote.html">rRemote</a></li>
- <li> </li>
- <li><a href="/c250.html">Mio C250 Unlock</a></li>
- <li><a href="/nas.html">IB-NAS6210 Linux</a></li>
- <li><a href="/ultimatenotifier.html">Ultimate Notifier Script</a></li>
- <li><a href="/serialhelper.html">Serial Helper</a></li>
- </ul>
-
- <div id="recent">
- Recent blog posts:
- <ul id="recentList">
- <li class="recentList"><a href="/2013_05_20_just_cause.html">Just Cause 2 Capture</a></li><li class="recentDate">2013-05-20</li>
- <li class="recentList"><a href="/2013_05_17_itunes.html">Musik Script History</a></li><li class="recentDate">2013-05-17</li>
- <li class="recentList"><a href="/2013_05_09_itunes.html">Musikgeschmack</a></li><li class="recentDate">2013-05-09</li>
- <li class="recentList"><a href="/2013_05_05_debian.html">Debian Update</a></li><li class="recentDate">2013-05-05</li>
- <li class="recentList"><a href="/2013_04_26_iphone_lens.html">iPhone Linse</a></li><li class="recentDate">2013-04-26</li>
- </ul>
- </div>
- </div>
- </div></div>
-
- <img id="dude" alt="The Dude abides..." src="/img/dude.png">
- <img id="walter" alt="Mark it zero!" src="/img/walter.png">
-
- <div id="footer">
- Built with <a href="http://bitbucket.org/obensonne/poole">Poole</a>
- ·
- Licensed as <a href="http://creativecommons.org/licenses/by/3.0">CC-BY</a>
- ·
- <a href="http://validator.w3.org/check?uri=referer">Validate HTML</a>
- ·
- <a href="http://jigsaw.w3.org/css-validator/validator?uri=xythobuz.de%2Fstyle.css&profile=css3">Validate CSS</a>
- ·
- <a href="http://feed1.w3.org/check.cgi?url=http://www.xythobuz.de/rss.xml">Validate RSS</a>
- ·
- <a href="http://www.validome.org/google/validate?url=http://www.xythobuz.de&googleTyp=SITEMAP">Validate Sitemap</a>
- </div>
- <img src="/stats/count.php?img" alt="Analytics">
- <script src="http://gitforked.com/api/1.1/button.js" type="text/javascript"></script>
- <script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-39163591-1']);
- _gaq.push(['_setDomainName', 'xythobuz.org']);
- _gaq.push(['_setAllowLinker', true]);
- _gaq.push(['_trackPageview']);
- setTimeout("_gaq.push(['_trackEvent', '30_seconds', 'read'])", 30000);
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
- </script>
- </body>
- </html>
|