DFAM Thing - Firmware


The Primary DFAM Thing documentation can be found here.

The DFAM Thing Quick Start guide can be found here.


Firmware Update Process

Step 1

Updating the firmware of the DFAM Thing requires the free command line program avrdude. Here are links to download the command line version for Mac, or Windows with the necessary configuration file (plus a single dll for the Windows version).

Step 2

There are now five different versions of the DFAM Thing, and each needs its own firmware file. Model A is the original standalone version, with no surface mount parts – you can see many resistors and diodes on the PCB. Model B is the later standalone version that has surface mount parts on the board, and DFAM Thing 1.1 or DFAM Thing 1.1b printed on the PCB. The third version, Model C, is the same as the second version, except with an OLED display. The fourth version is the Eurorack module. Annoyingly, for the latest builds I have had to change the Control encoder, leading to a 5th version (Model D) that needs a tiny change in the firmware.

Download the latest firmware hex file for your particular model by right clicking the links below and selecting the Download Linked File As…/Save link as… option. Save the file in the same folder you have the avrdude program and configuration file (avrdude.conf).

DFAM Thing Model A

DFAM_1.5.hex

DFAM Thing Model B

DFAM2_1.5_E2

DFAM Thing Model C (OLED)

DFAM2_1.5_OLED.hex

DFAM Thing Eurorack

DFAMEuro_1.5.hex

DFAM Thing Model D

DFAM2_1.5_E4.hex

Step 3

For the standalone version, connect the DFAM Thing to a USB port on your computer, and toggle the small switch on the board so it is closest to the Nano. This disables the MIDI circuit, and allows avrdude to communicate with the Nano via its serial port. (Note: in some devices, the switch has a red actuator and needs to be switched away from the Nano to disable MIDI.)

For the Eurorack version, use a mini-USB cable to connect the Arduino Nano to your computer. Rack power is not needed.

Step 4

Since avrdude is a command line program, you will need to open a terminal on mac, or a command prompt on Windows. Additionally, you will need to find the name of the serial port. On Windows you can use the Device Manager, and on a Mac you can run:

ls /dev/cu.usb*

Step 5

An Arduino Nano contains a special program, called a Bootloader, for uploading code to the device. Most of the DFAM Things made use the “old” bootloader, but some use the newer one. As a result, there are two possible versions of the update command, but there is no danger in using the wrong one – you will just see sync errors.

My advice is to try the old bootloader command first, but if it fails, then try the new bootloader version. The only difference is the baud rate.

Using the old bootloader

The general format of the command to run on a Mac is:

./avrdude -c arduino -p m328p -C avrdude.conf -b57600 -P /dev/<serial port> -U flash:w:<hex file>:i

and on Windows is:

avrdude -c arduino -p m328p -C avrdude.conf -b57600 -P <com port> -U flash:w:<hex file>:i

The -b57600 option sets the correct baud rate for the old bootloader.

Don’t forget to change the serial/com port to the value found in Step 4, and change <hex file> to the file name for the hex file you wish to upload (including the extra path details if it is not in the same directory).

New bootloader command

For the new bootloader, the -b option is not required. So, the general format of the command to run on a Mac is:

./avrdude -c arduino -p m328p -C avrdude.conf -P /dev/<serial port> -U flash:w:<hex file>:i

and on Windows is:

avrdude -c arduino -p m328p -C avrdude.conf -P <com port> -U flash:w:<hex file>:i

Examples

./avrdude -c arduino -p m328p -C avrdude.conf -P /dev/cu.usbserial-1430 -U flash:w:DFAMEuro_1.4.hex:i

avrdude -c arduino -p m328p -C avrdude.conf -P COM4 -U flash:w:Latest/DFAM2_1.4_E4.hex:i

./avrdude -c arduino -p m328p -C avrdude.conf -b57600 -P /dev/cu.usbserial-1430 -U flash:w:DFAM2_1.4_E4.hex:i

A successful update will see the program report reading, writing, and then re-reading the code on the Nano.

$ ./avrdude -c arduino -p m328p -C avrdude.conf -P /dev/cu.usbserial-1430 -U flash:w:DFAM.ino.hex:i

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
        To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "DFAM.ino.hex"
avrdude: writing flash (18482 bytes):

Writing | ################################################## | 100% 3.29s

avrdude: 18482 bytes of flash written
avrdude: verifying flash memory against DFAM.ino.hex:
avrdude: load data flash data from input file DFAM.ino.hex:
avrdude: input file DFAM.ino.hex contains 18482 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 2.46s

avrdude: verifying ...
avrdude: 18482 bytes of flash verified

avrdude: safemode: Fuses OK (E:00, H:00, L:00)

avrdude done.  Thank you.

$ 

An unsuccessful run will generally fail with error messages like the below:

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xfe
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xfe
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xfe
...

If you have trouble getting the update to proceed, try removing the Nano from the DFAM Thing to reprogram it, but be careful to put it back in the right orientation, and firmly in the sockets.

Step 6

If you are updating a standalone device, flick the switch back on the DFAM Thing to re-enable MIDI.

Step 7

Enjoy your updated DFAM Thing. :-)

Appendix

If something goes wrong and you’d like to revert to the previous firmware, you can use the files here:

DFAM Thing Model A

firmware 1.2, firmware 1.1

DFAM Thing Model B

firmware 1.4, firmware 1.3, firmware 1.2, firmware 1.1

DFAM Thing Model C (OLED)

firmware 1.4, firmware 1.3, firmware 1.2, firmware 1.1

DFAM Thing Eurorack

firmware 1.3, firmware 1.2, firmware 1.1

DFAM Thing Model D

firmware 1.4, firmware 1.3, firmware 1.2