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:
- An ATmega328P microcontroller that is pre-programmed with the Arduino bootloader (available here, here, or here)
- An FTDI USB to TTL serial cable, 5-volt version (available here or here)
- A computer running the Arduino software (download)
To program the module’s firmware:
- 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.
- 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.
- On the computer, run the Arduino IDE software and load the appropriate sketch (.ino file) for the module.
- 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
- Select the Sketch > Upload command to compile and upload the firmware.
- 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 replaceable ATmega328P chip (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.