The 8-bit Web Server

Even [maurycyz] doesn’t think it is a good idea, but it is possible to use an AVR 8-bit CPU to serve web pages. Of course, it is a vastly simplified web server, but it does serve pages — OK, technically just one page — to the public Internet.

Working backward, it is fairly easy to get the microcontroller to note an HTTP request and then simply spit out a prerecorded HTTP response to provide the page. The hard part is connecting the little processor to the network. The server is dead simple, just a CPU and a scant number of components like filter caps and LEDs. The trick is to use SLIP, an ancient protocol used to connect dial-up modem terminals to the network.

Linux supports SLIP, so the MCU connects to a Linux computer via SLIP. Then the Linux computer uses WireGuard to network with the remote web server that serves [maurycyz’s] site. The SLIP implementation assumes that IP packets aren’t fragmented, which is normally true these days. TCP was a bit more complicated since you have to track the connection state and possibly re-transmit lost packets. Still, nothing the AVR with 8 K of RAM and 64 K of flash can’t handle.

Practical? No. Cool? Sort of. Funny that a disposable vape has more CPU power. Of course, something like an ESP32 is an obvious choice.

22 thoughts on “The 8-bit Web Server

    1. haha, that’s a funny article. IoT before it was a buzz word and long before we had the frameworks to make it happen.

      These tiny disposable web servers could be good for guerilla news campaigns, but the problem becomes how to find the news. ESP32s with AP/STA mode advertising what it is in the SSID would probably reach a larger audience over the life of such a signal and the freshness of the news itself.

  1. You could connect a Wiznet W5100 to the AVR to get an ethernet connection. That’s what I did with a weather station I built. It was quite a bit faster since it was connected over SPI at several mbps.

  2. Nut/OS ran on an Avr (Atmega) with a web server and both PPP and Ethernet support 20+ years ago. Multiple web pages that could be either static files on an external flash chip with a simple filesystem or code generated html. All while doing several other things as well. It was simple compared to other web servers, but it worked well enough.

    1. Apples to oranges. From what I recall, it was vastly more complicated, it had separate chips for Ethernet, RS232, something like 512 kB of external SRAM and flash, etc. It seemed more like an attempt to build an SBC in the days before SBCs than an exercise in minimalism.

  3. I wonder about using a handful of serial in serial out shift registers.
    Let the microcontroller feed the bits in at it’s own pace, then swap the clock with something fast enough for ethernet and let the shift register but bang out the data.

    1. Wiznet chips do that. Wiznet shields for arduinos, but there are also W5500-EVB-PICO that’s rp2040 with the TCP/IP stack chip on the same board. (buy direct from the maker, other resellers charge three prices).

  4. ” Of course, it is a vastly simplified web server, but it does serve pages — OK, technically just one page — to the public Internet.”
    “Then the Linux computer uses WireGuard to network with the remote web server that serves [maurycyz’s] site.”

    So that’s what users of the public internet see. How is this a webserver? Physically it’s beautiful on that base.

  5. This is no big deal. The iBoot by Dataprobe has an multiple page web server with authentication and everything. The original version was written all in assembly and used a NIC. What you have here is no big deal.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.