Firmware Programming

How to program the firmware in a digital module

Some of my modules (Envelope2, LFO-DigiVC) use an ATmega328P microcontroller chip running firmware that is programmed using the Arduino development environment. The firmware source code is provided as an Arduino sketch.

After the firmware is compiled, the executable code must be downloaded to the microcontroller. There are a few different ways to do this.

In-Place Programming

The modules that I designed have a serial programming header so they can be programmed just like an Arduino board. To program a module this way you will need:

To program the module’s firmware:

  1. Important: Make sure the module is not powered. Either turn off the Eurorack system’s power or unplug the Eurorack power cable from the module.
  2. Connect the module to the computer using the FTDI USB-serial cable. The header connector on the cable connects to the 6-pin header on the module. Make sure it’s connected the right way around. The black wire is ground.
  3. On the computer, run the Arduino IDE software and load the appropriate sketch (.ino file) for the module.
  4. In the Tools menu, select these settings:
    • Board: Select “Arduino Duemilanove or Diecimila” or “Arduino Uno” depending on which bootloader is on the chip
    • Processor: ATmega328P
    • Port: Select the port corresponding to the FTDI USB-serial cable
  5. Select the Sketch > Upload command to compile and upload the firmware.
  6. Unplug the FTDI cable and re-connect the module’s power cable.

Other Methods

There are other ways to get the firmware onto the microcontroller chip. For example, you can program the firmware onto an Arduino-compatible dev board that has a removable ATmega328P chip (e.g. Arduino UNO or similar) then put the chip into your module. Or, you can program the Arduino bootloader onto the chip — there are various ways to do this — and then follow the procedure above.

For more information on how to program microcontrollers using the Arduino development environment, see the Arduino web site.