Bitbang Ethernet

Implementation UDP into microcontroller Igor Atmel-UDP device:
UDP/IP infrared remote control
web page shows implementation UDP/IP on firmware level (similar as emulation of RS232 interface or USB interface).


What makes it really cool is that the ethernet is bitbanged using nothing but the bare pins of an ATMEGA168. The downside is that this Ethernet implementation is 10 Mbit/s transmit-only: it cannot receive network packets. In think this is a cool hack, that could be enough for some projects.

By the way ATMEGA168 is same chip as used on Arduino Diecimila. Maybe this idea could be adapted to Arduino boards as well if the board is modufied for this (Arduino runs on 16 MHz, this circuits needs 20 MHz clock).

If you want a real full standard Ethernet interface that can transmit and receive, you need to use a real Ethernet controller for it (Ethernet chip or interface built into the microcontroller).


  1. Johnb808 says:

    Great, thanks for sharing this blog.Really thank you!

  2. Tomi Engdahl says:

    Bit-banging Ethernet On An ATTiny85

    [Cnlohr] just published an ingenious but dangerous way to send Ethernet packets using an ATTiny85. The ATtiny directly drives one pair of differential TX wires of a standard Ethernet cable. Doing so will force the TX signal ground to be the same as the ATTiny’s and in some cases may put 48V on your AVR if your cable is plugged into a Power Over Ethernet switch… which may be a problem.

    the microcontroller is clocked at 20Mhz to bit-bang the Manchester encoded electrical signals. Using a neat trick his home switch will detect his platform as a 10MBit Ethernet switch which can then send hard-coded packets to his computer.

  3. Tomi Engdahl says:

    A simplex 10Base-T send-only ethernet stack for AVRs

    This is a really dangerous project. Use at your own risk.

    By directly ethernet without magnetics to an AVR, you may cause serious damage, fire, or anything else crazy if there is a DC offset. It does not follow 802.3 standards for 10Base-T Ethernet.

    You are still responsible for sending the NLP pulses every 16 +/- 8ms.

    Right now, port PB3,PB4 are the TX+/TX- pins. A switch can be connected between PB0 and PB1 and another switch may be connected btween PB2 and PB1.

  4. Tomi Engdahl says:

    Implementation UDP into microcontroller Igor Atmel-UDP device:
    UDP/IP infrared remote control

    Purpose of this article is to inform readers about implementations UDP protocol (only transmitting) into singlechip microcontroller, which this interface directly not supports. Simply: implementation UDP/IP on firmware level (similar as emulation of RS232 interface in microcontrollers, which not have RS232 support).

  5. Tomi Engdahl says:

    Interesting points from

    Device supports only transmitting, because receiving is not possible at this microcontroller speed. Therefore we must use device on full duplex networks only! Otherwise is probability that on network occurs collisions during device transmitting and because device not checks collisions (not receiving), then the transmitted code is not delivered to destination.

    Buffer is transmitted by UDP/IP protocol as broadcast to specified network. Default destination firmware values are:

    destination IP= (broadcast to adresses)
    destination port=6668, source port=6668
    destination MAC=FF-FF-FF-FF-FF-FF (broadcast)

    but can be easily changed

    I develop for programmers DLL library “IgorUDP.dll”, which offers access to the device from your programs in the simple way. It contains only 3 functions: InitUDP, CloseUDP and DoGetInfraCode.


Leave a Comment

Your email address will not be published. Required fields are marked *