You Are Here: Home » AVR ATmega Projects » HUB ISP – Solving the USB-Only “Chicken or Egg” Problem using ATMEGA328P

HUB ISP – Solving the USB-Only “Chicken or Egg” Problem using ATMEGA328P




Many excellent ISP (In System Programming) designs exist for 8 bit AVR microcontrollers. However, most require a pre-programmed microcontroller, or the “Chicken or Egg” problem: you can’t program microcontrollers unless you have one already programmed.

Parallel Port or Serial Port solutions have existed, but many modern computers no longer have these ports. The FTDI USB-to-serail chip can be used as well. Until now it’s been widely thought impossible to solve the Chicken or Egg problem using only USB, without preprogrammed or specialized USB chips.

Program ATMEGA328P Chip

HUB ISP can write an AVR chip using only a USB hub, one cheap/common logic chip, and a few resistors.

Not For Beginners, or Anyone Who Values Their Time

If you are just getting started with AVR microcontrollers, ISP programming is not a good place to begin, even if you buy a ready made programmer, and certainly not by trying to build your own!

Ready-to-use boards like Teensy (yes, a shameless plug, as I make this one) or Arduino just plug into any USB port and are ready to go, with easy to use software tools. Troubleshooting electronics and software can be taxing even for experienced engineers, so it’s highly recommended to start with a foundation that’s as trouble-free as possible. HUB ISP is, well… not.

HUB ISP is certainly not a viable replacement for regular “chicken or egg” AVR ISP programmers, which are much faster and more reliable, and maybe even cheaper… eg, Teensy running the ArduinoISP code (yup, another shameless plug).

However, if you love to tinker or you’re just curious how this could possibly work with only USB and no programmable chip, without even any parts designed for USB, only logic gates and resistors, then read on!

Materials Required

Or “we don’t need no steenking programmed chips!”

 

QtyItem
1USB Hub + Cable (if not part of the hub)
4Expendable USB Cables
174HCT00 or 74HC00 chip (HCT=best, HC=ok)
4Resistors, 4.7K
2Resistors, 330 ohm (220 to 470 would work just fine)
2LEDs – for testing
2Capacitors, 0.1uF
1Crystal + 2 capacitors (only needed for reprogramming chips)
1Pushbutton (or you can momentarily touch reset pin to +5 volts)
1Breadboard + Wires, or some way to connect stuff
1Cardboard and double-stick tape
1PC running Linux, with a USB port of course!

 

Step 1: Compile Code with HUB ID Numbers

First, download the source code. GPLv3 License.

Update: charliex has attempted a HUB ISP port to Microsoft Windows. It’s untested so far.

Before compiling, plug in your hub and type “lsusb” to find its vendor and product ID numbers.

 

For more detail: HUB ISP – Solving the USB-Only “Chicken or Egg” Problem using ATMEGA328P

Leave a Comment

You must be logged in to post a comment.

Read previous post:
Watch Board
Prototype of Pulsar Heart Rate Watch Board

Using a reflow oven (custom made), I was able to assemble the bluetooth watch board with the system on chip...

Close
Scroll to top