Programming AVRs With A BumbleB

Inside LUFA is a neat project called AVRISP. With this code, your BumbleB becomes a programmer for other AVRs. The project can be found in ./Projects/AVRISP. With a few changes we can use this code and BumbleB to program other AVRs and even other Bumble-Bs.

Bumble-B AVRISP -> ATMega168 Example
Bumble-B AVRISP -> ATMega168 Example

Wiring

In this schematic, the MOSI, MISO, and SCLK pins of Bumble-B are connected to similar pins on the target AVR. The RESET pin of the target AVR is connected to PC6 on the BumbleB with a 4.7k to 10k pull-up resistor. The resistor seems necessary for some target AVR models but not all.

Configuration

Follow these directions to build the code (or see below for a binary download):

  1. In 'makefile', change MCU = at90usb162
  2. In 'makefile', change BOARD = BUMBLEB
  3. In 'makefile', change F_CPU = 16000000
  4. In 'makefile', update the RESET port to PC6, change to the following:
    CDEFS += -DRESET_LINE_PORT=PORTC
    CDEFS += -DRESET_LINE_PIN=PINC
    CDEFS += -DRESET_LINE_DDR=DDRC
    CDEFS += -DRESET_LINE_MASK="(1 << 6)"
  5. Type `make` to build.

If all went well, you will now have AVRISP.hex and AVRISP.eep files in the build directory. Use Atmel Flip to flash the .hex and EEPROM files. Note: Flip doesn't recognize the ".eep" file extension, change the file type to "All Files" in the hex loader screen.

When you first run this code, Windows will ask you for a driver. It can be found in C:\Program Files\Atmel\AVR Tools\usb if you have AVRStudio installed.

In AVRStudio, do Tools -> Program AVR -> Connect ; AVRISP mkII, USB -> Connect ; Change device to your target. You now should be able to read the signature of the device, program the flash, read the fuses, etc.

Precompiled Binaries for BumbleB

 
 
 

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options