This is an old revision of the document!
Table of Contents
Get the firmware
You can either take a pre-built firmware package from http://www.smarthomatic.org/builds/builds.html or build your own firmware. If you take the prebuilt package, extract it and continue with “Flashing the controller”.
Programming fuses
If you have built your binaries by yourself with “make”, your fuse settings should be available as files lfuse.bin, hfuse.bin and efuse.bin in the bin subdirectory. You can write these fuses with
make program_fuses
Be sure about the fuse settings you want to write in your microcontroller. With wrong fuse settings, your microcontroller might not be accessible anymore!
Programming your own fuses
Depending on the use of an external crystal or the internal RC oscillator, you have to use different fuse settings.
Please see the text files in the downloadable builds for the required fuse settings.
You can write fuses by calling e.g.
avrdude -p ATMEGA328P -U lfuse:w:0x??:m
(replace ?? by the needed fuse settings and use “lfuse”, “hfuse” or “efuse” accordingly.
Flashing the controller
pi@ninjablock ~/test/smarthomatic/firmware/shc_basestation $ avrdude -P /dev/ttyACM0 -c STK500 -p m328p -U flash:w:bin/ohc_basestation.hex -U lfuse:w:0xf7:m -U hfuse:w:0xd1:m -U efuse:w:0x07:m