Giter Club home page Giter Club logo

avr-enc28j60-examples's Introduction

AVR TCP/IP Examples

In this repo you will find ready to go examples that allow you to get your microcontroller connected to the internet immediately. All of the code examples have been tested with the ATmega328p and ATmega128. In order to achieve TCP/IP capabilities we will be making use of the wonderful tuxgraphics TCP/IP stack.

Prerequisites

Besides having an ATmega328p or ATmega128 microcontroller these tutorials assume you are using the Microchip ENC28J60 ethernet controller module. You can pick this module up fairly cheaply at a variety of places:

Getting Started

Hooking up the ENC28J260 module to your micocontroller is very straight forward:

Pin Function ATmega328p ATmega128 Arduino UNO & Duemilanove
CS PB2 PB0 Digital Pin 10
MOSI PB3 PB2 Digital Pin 11
MISO PB4 PB3 Digital Pin 12
SCK PB5 PB1 Digital Pin 13

Loading An Example

If you haven't noticed yet there are two directories of code. The tuxlib directory has all of the tuxgraphics TCP/IP library source code. The examples directory will have multiple examples and individual makefiles for each. Before you compile and load the program you may need to make some changes to the makefile that is in the example folder. In the makefile you can change:

  • Target microcontroller type - DUDECPUTYPE and MCU
  • Programmer - PROGRAMMER
  • The port your programmer is using - PORT

After you modify the makefile compilation and installation are easy. From the console run:

  • make to compile the source code of the example
  • make load to load the code onto your microcontroller

Because most of these examples are based on the tuxgraphics library make sure to check out their documentation as well.

General Tips / Troubleshooting

So lets say you compile and load the UDP_Client_Send example and are unsure if your data is actually being sent. This is a great oppurtunity to learn how to use Wireshark. Wireshark is a network analyzing tool that allows you to monitor and record network packets. Once you install wireshark it is pretty easy to find the packets you are looking for. All we need to do is look for traffic that has the IP address of our microcontroller. Keep in mind the IP address of the microcontroller is typically stored in the variable local_host. Once in wireshark all we need to do is apply a simple filter and we can tell if traffic is being generated:

alt tag

avr-enc28j60-examples's People

Contributors

ptrks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.