Updating firmware on AVR chips
Posted in Autonomous Bassline on May 10th, 2010 by Dann Green – Be the first to commentA number of 4ms devices use an AVR microcontroller. These chips run a small program. On most 4ms devices that use an AVR chip, there’s a 6-pin header (2 rows of 3 pins) near the chip. This header lets you update, upgrade, or hack the AVR chip.
Here’s how to do it:
You will need…
ISP (In-circuit Programmer): I recommend the AVR ISP MKII available from Mouser for $34, or elsewhere sometimes cheaper! In Europe, try Farnell
- A computer with a USB port. Windows actually has the most seamless installer, but I also use Mac and Linux to burn code just fine. Download and install one of these:
- Windows: AVR Studio 4, download it from atmel.com. Scroll down and get the latest version (4.18, build 684). You’ll have to “register” by typing in a real or fake name and address.
- Mac OS X: OSX-AVR which is actually Crosspack
- Linux: You just need the avrdude program to burn code, but can install the whole avr-gcc toolchain if you might be compiling your own firmware.
- The hex file: This is the actual file that contains the firmware update. If you’re upgrading a device, this will be available for download on the device’s web page. If you’re an advanced hacker, you’ll probably compile your own code using avr-gcc (part of AVR Studio) which will generate a hex file for you. The file should end in .hex
Detailed instructions:

Plug the AVR ISP mkII into the 6-pin header of your device, making sure to line the red stripe up with the printed white box on the PCB
Windows (AVR Studio 4):
- Download and install AVR Studio 4 from atmel.com. Make sure you are downloading AVRStudio4Setup.exe, not just a service pack upgrade!
- Run the installer and click OK/Next to everything. Yes, you want the “Jungo/USB” driver to be installed.
- Plug in your AVR ISP mkII into the USB port and make sure Windows finds and automatically installs the drivers. The green light near the USB plug should come on.
- Power your device up (that is, plug your Rotating Clock Divider into your Eurorack system, or power up your Bend Matrix, etc…). Your device should be running normally, but don’t plug any patch cables into it
- Plug the 6-pin ISP header of the AVRISP mkII into your device. Note the orientation: the red stripe should go towards the white box that’s printed on the PCB: see photo above.
- The light near the 6-pin cable on the AVRISP mkII should turn green, indicating that it detects power. If you plugged it in backwards, it might flash orange. Nothing’s damaged, just flip it around…
- Run AVRStudio 4
- Click the little “AVR Programmer” icon:

- If it doesn’t automatically detect your AVR ISP mkII, then select it from the box on the left, and click “USB”, and then click “Connect…”
- Click on the “Main” tab, and select “ISP mode” from the bottom box. Click “Settings” and choose an ISP Frequency of 125kHz.
- Select “ATmega168″ for the RCD, or ATtiny84 for the ABG, or ATmega32 for the BM, from the top drop-down box. Click “Read Signature” and it should say “Signature matches device”
- Click the “Program” tab. Under “Flash” click the “…” button next to “Input HEX File” (the top one). Make sure you’re not under EEPROM! Select your hex file that you downloaded (or compiled yourself)
- Now, click “Program” (again, under the Flash section, not under the EEPROM section). It should give you no errors at the bottom of the window
- Unplug your ISP 6-pin header and you should be good to go!
Please let me know if you have any problems!
Mac OSX (Crosspack):
- Download and install Crosspack from here: http://www.obdev.at/products/crosspack/index.html]
- Download the hex file for your upgrade. Save the file in your Home directory, so you can find it easily with the Terminal.
- Plug in your AVR ISP mkII. The green light by the USB plug might not come on.
- Do steps 4, 5, and 6 of the Windows installation (power up your device, plug in the AVR ISP mkII, make sure the green light comes on)
- Open up your Terminal program (in Utilities folder)
- In Terminal, type “ls” and hit enter. You should see the name of the hex file that you saved in your Home directory (along with everything else in your Home directory). If not, you didn’t save it in the right place.
- Now tell it to burn the code. For the RCD, type this command:
avrdude -P usb -c avrispmkII -p atmega168 -U flash:w:clocker.hex -v -v
And press enter. This assumes your hex file is named “clocker.hex”. It should say “avrdude: Thank you” and have no errors above that. If all goes well, unplug your 6-pin cable and your RCD is updated!
If you’re using a fresh chip, you’ll need to use this command to burn the fuses:
avrdude -P usb -c avrispmkII -p atmega168 -U hfuse:w:0xd7:m -U lfuse:w:0xef:m -U efuse:w:0x01:m -U flash:w:clocker.hex
Linux:
- Install avrdude. You can probably install it with your package manager, such as Aptitude: (type “sudo aptitude install avrdude”), or Ubuntu’s Synaptic
- Follow the OSX instructions starting at step 2. Hint, if avrdude is not finding a usb connection, you might need to type “sudo” before the avrdude commands. Then it’ll ask you for your password before running avrdude.






