Programming the AVR-Microcontroller

How to install a new Firmware into the CRM. To do this you need to purchase an IPS programmer device. We recommend the AVR Dragon device, which will set you back ~ €60 in Germany.

To program a microcontroller chip that is mounted in the CRM module you need a 6-way ribbon cable. To program microcontroller chips when they are not yet mounted, you must solder a socket to the AVR-Dragon and use jumper cables. Refer to the AVR-Dragon instruction manual.


Install avrdude:

apt-get install avrdude

If you are not using an AVR-Dragon: Edit the MY_AVRDUDE = line in the file firmware/Makefile to suit your ISP programmer.

Program the Microcontroller

To program or reprogram a microcontroller chip, when it is already mounted in the CRM Module:

  1. Open the case.

  2. Connect the AVR-Dragon programmer with the CRM Module using a 6-way ribbon cable. Make sure to connect pin 1 on the Dragon to pin 1 on the CRM!

  3. Connect the AVR-Dragon with the PC using an USB cable.

  4. Connect the power source to the CRM.

  5. Change into the firmware directory.

    cd firmware
  6. If this is the first time you prgram this microcontroller initialize it:

    make my_initfuses
  7. Program the microcontroller:

    make my_ispload
  8. Disconnect the 6-way cable from the CRM, remove the power cord and close the case.

Initialize a New Microcontroller

To initialize a factory-new microcontroller run the following command:

make my_init_fuses

This command only needs to be run once on every microcontroller chip (but it doesn’t hurt doing it more often). It tells the microcontroller to use the external crystal oscillator instead of the internal one.