Feed on
Posts
Comments

Firmware Compilation Instructions for 2.x hardware with ATmega644 MCU

Preparation:

  • Install the Arduino software (recommended version is 1.0.4 ro 1.0.5).
  • Download the OpenSprinkler software package from the GitHub download page. You can either click on the Zip icon, or do a Git checkout.
  • Copy the software/arduino-code/libraries/OpenSprinklerGen2/ directory to your Arduino’s libraries folder (e.g. arduino-1.0.4/libraries/).
  • Copy the software/arduino-code/hardware/aopensprinkler directory to your Arduino’s hardware folder (e.g. arduino-1.0.4/hardware/).

Compilation Errors: if you encounter errors when compiling the Arduino code, don’t give up, Google the error message you have seen and there should be a solution on the web already. Understanding that compilation errors are common, you shouldn’t feel discouraged simply by seeing an error message and not knowing what to do. If after searching you still cannot solve the issue, post a message on the forum and we will help.

Instructions:

Warning: never click on the ‘Burn Bootloader’ menu option in Arduino. If you do so, the microcontroller’s fuse bits will be modified. As a consequence, the microcontroller may fail to start. Note that OpenSprinkler does not use a bootloader, so please do not upload any bootloader to it.

Upload a Program
Start the Arduino program, then from the menu items, select

  • Tools->Board->OpenSprinklerGen2
  • Tools->Programmer->USBtinyISP
  • File->Examples->OpenSprinklerGen2->interval_program
  • Finally, click on the Upload button to upload.

See screenshots below:
os20_compile_screenshot1os20_compile_screenshot2

USB Device Permission in Linux
In Linux, you need to give USB device permission to use the USBtiny ISP in Arduino. There are two ways to do this:

  • Run Arduino in sudo mode or as root user;
  • Alternatively, add the USBtiny vendor ID and device ID to /etc/udev/rules.d. See instructions here.

(Optional) Modify ATmega644 Signature in avrdude.conf
ATmega644 has several different versions (P, A, PA, non-PA). Unfortunately avrdude is not set up to recognize all of them. If you encounter an error about signature mismatch, you need to change the signature in avrdude.conf to avoid signature check error. To do so, simply open avrdude.conf:

  • In Linux, it is located at arduino-1.0.4/hardware/tools/
  • In Mac, it is located at Programs/Arduino/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/
  • In Windows, it is located at arduino-1.0.4/hardware/tools/avr/etc/

Search in the file and locate the section of ATmega644, then change the signature from what it is to the signature reported in your error message. Usually the only difference is in the last byte. Then save the changes, and you should be all set.


Leave a Reply