Difference between revisions of "Alpha Clock Firmware v2"

From Evil Mad Scientist Wiki
Jump to: navigation, search
(Create)
 
(AVR ISP Programming)
(21 intermediate revisions by 4 users not shown)
Line 1: Line 1:
The [[Alpha Clock Five]] is an alarm clock and alphanumeric LED display development platform based on the ATmega644A AVR microcontroller. It can be programmed through an AVR ISP programmer, using standard AVR-GCC techniques, or through an FTDI USB-TTL interface, using a modified version of the Arduino development environment.
+
The [[Alpha Clock Five]] is an alarm clock and alphanumeric LED data display device based on the ATmega644A AVR microcontroller.   While most users will not need to reprogram Alpha Clock Five, we are making this page of documentation available for those who would like to modify the programming or simply would like to update an existing unit to firmware version 2.x.
  
 +
Alpha Clock Five can be programmed  through an FTDI USB-TTL interface, using a modified version of the Arduino development environment, or through an AVR ISP programmer using standard AVR programming techniques.  The default firmware is designed to under the modified Arduino environment, which is described below in the section titled "Bootloader (Arduino style) programming."
 +
 +
 +
 +
== Standard Firmware for Alpha Clock Five ==
 +
 +
 +
=== Alpha Clock Five firmware version 2.0 ===
 +
 +
The latest version of the Alpha Clock Five Firmware, (currently v. 2.1) is hosted [https://github.com/oskay/AlphaClock at our github repository].  Download the .zip archive of the repository there, or follow [https://github.com/oskay/AlphaClock/archive/master.zip this direct link] to download and save it to your computer.  This .zip archive contains the Alpha Clock Five library for Arduino, for which the standard firmware is included as one of the example files.    The necessary setup to install that library and upload the firmware is discussed in the sections that follow on this page.
 +
 +
 +
(The previous major firmware version, v. 1.0 of the Alpha Clock Five firmware is discussed [http://wiki.evilmadscience.com/Alpha_Clock_Firmware_v1 here].)
  
'''Alpha Clock Five firmware version 2.0 is coming soon.'''  Please [http://wiki.evilmadscience.com/Alpha_Clock_Firmware go here] for information about firmware version 1.0.
 
  
  
 
== Bootloader (Arduino style) programming ==
 
== Bootloader (Arduino style) programming ==
  
The microcontroller in Alpha Clock Five kit comes preprogrammed with the [http://sanguino.cc/ Sanguino] Bootloader.  Because of this, Alpha Clock Five can be reprogrammed right in the Arduino environment, through a USB-TTL interface such as the [http://evilmadscience.com/productsmenu/partsmenu/130-usbttl FTDI USB-TTL cable] or the http://evilmadscience.com/productsmenu/accessories/210 Adafruit FTDI Friend].  
+
The microcontroller in Alpha Clock Five kit comes preprogrammed with the [http://sanguino.cc/ Sanguino] Bootloader.  Because of this, Alpha Clock Five can be reprogrammed right in the Arduino environment, through a USB-TTL interface such as the [http://shop.evilmadscientist.com/productsmenu/partsmenu/130-usbttl FTDI USB-TTL cable] or the [http://shop.evilmadscientist.com/productsmenu/accessories/210 Adafruit FTDI Friend], and doing so is our recommended procedure.  
  
The bootloader itself can only be written (or rewritten) with an AVR ISP programmer, such as the [http://evilmadscience.com/productsmenu/tinykitlist/106-usbtiny USBtinyISP].  While most users will not ever need to do this, see below (under [http://wiki.evilmadscience.com/index.php?title=Alpha_Clock_Firmware#AVR_ISP_Programming AVR ISP Programming]) if you should need to do so.
+
The bootloader itself can only be written (or rewritten) with an AVR ISP programmer, such as the [http://shop.evilmadscientist.com/productsmenu/tinykitlist/106-usbtiny USBtinyISP].  While most users will not ever need to do this, see below (under [http://wiki.evilmadscientist.com/index.php?title=Alpha_Clock_Firmware#AVR_ISP_Programming AVR ISP Programming]) if you should need to do so.
  
  
 
=== Setting up the environment ===
 
=== Setting up the environment ===
  
Alpha Clock Five requires a rather specialized programming environment, that uses some older software versions and will be updated in the near future. 
+
Alpha Clock Five requires a rather specialized programming environment:
  
  
 
Required software:
 
Required software:
*  Arduino 1.0.1 (available [http://arduino.cc/en/Main/Software here]).
+
*  Arduino 1.0.3 (available [http://arduino.cc/en/Main/Software here]).
*  Sanguino version 1.0.1 [http://code.google.com/p/sanguino/downloads/list from here].   
+
*  Arduino Time library, available [http://www.arduino.cc/playground/Code/Time here].
 +
*  Alpha Clock Five library, as discussed above.  
 +
*  Sanguino version 1.0.1 [http://code.google.com/p/sanguino/downloads/list from here].
 +
 
 +
First, install the Arduino program on your computer.  Open Arduino to ensure that it runs correctly, and then quit.  (Please do not skip this step!)
 +
 
 +
Secondly, install the Time library in your Arduino libraries folder.  The exact location of this libraries folder depends a bit on your operating system.  For example, on Mac OSX, the directory would be ~/Documents/Arduino/libraries/. On Windows, it would be My Documents\Arduino\libraries\ .  Copy the Time folder (the one with the time.h file, not the top-level Time folder) to your libraries folder.  If your library is installed correctly, it will show up in (and be importable from) the '''Sketch > Import Library''' menu in the Arduino program when you restart it.   
  
 +
Third, install the Alpha Clock Five library.  When you download [https://github.com/oskay/AlphaClock/archive/master.zip the .zip file] from github, it will show up on your computer as "AlphaClock-master.zip".  Unzip that file, and open that folder to find the file within called just "alphafive".  Place this "alphafive" folder in your Arduino libraries folder, just as you did with the Time library.    If your library is installed correctly, it will show up in the '''Sketch > Import Library''' menu in the Arduino program when you restart it.
 +
  
Install the Arduino program on your computer.  The Sanguino extensions need to be installed separately, and the method for that depend, very slightly, on your operating system:
+
Finally, the Sanguino extensions need to be installed separately, and the method for that depends, very slightly, on your operating system:
  
  
Line 30: Line 50:
  
  
* Locate your Arduino.app file, version 1.0.1 (which you may have just installed).   
+
* Locate your Arduino.app file, version 1.0.3 (which you may have just installed).   
 
* Ctrl-click the file to show the contextual pop-up menu.   
 
* Ctrl-click the file to show the contextual pop-up menu.   
 
* From that menu, select  "Show Package Contents."  
 
* From that menu, select  "Show Package Contents."  
* Within the resulting directory (Arduino.app), navigate to the folder Contents > Resources > Java > hardware  
+
* Within the resulting directory (Arduino.app), navigate to the folder Contents/Resources/Java/hardware  
 
* Inside "hardware" there several folders, including one called "arduino."  Copy the whole "Sanguino" folder, which you unzipped earlier into the hardware folder, next to "arduino."  
 
* Inside "hardware" there several folders, including one called "arduino."  Copy the whole "Sanguino" folder, which you unzipped earlier into the hardware folder, next to "arduino."  
 
* Restart Arduino.
 
* Restart Arduino.
Line 44: Line 64:
 
First unzip the Sanguino .zip file, which reveals a folder called "Sanguino."  Then, copy that to within your Arduino application.
 
First unzip the Sanguino .zip file, which reveals a folder called "Sanguino."  Then, copy that to within your Arduino application.
  
* Locate your Arduino application, version 1.0.1 (which you may have just installed).   
+
* Locate your Arduino application, version 1.0.3 (which you may have just installed).   
* Copy /Sanguino to arduino/hardware/  
+
* Copy the Sanguino directory to arduino\hardware/  
* You should end up with arduino/hardware/Sanguino/
+
* You should end up with arduino\hardware\Sanguino\
 
* Restart Arduino.
 
* Restart Arduino.
  
Line 56: Line 76:
 
First unzip the Sanguino .zip file, which reveals a folder called "Sanguino."  Then, copy that to within your Arduino application.
 
First unzip the Sanguino .zip file, which reveals a folder called "Sanguino."  Then, copy that to within your Arduino application.
  
* Locate your Arduino application, version 1.0.1 (which you may have just installed).   
+
* Locate your Arduino application, version 1.0.3 (which you may have just installed).   
 
* Copy ~/Sanguino to arduino/hardware/  
 
* Copy ~/Sanguino to arduino/hardware/  
 
* You should end up with arduino/hardware/Sanguino/
 
* You should end up with arduino/hardware/Sanguino/
Line 62: Line 82:
 
* Restart Arduino.
 
* Restart Arduino.
  
If the Sanguino software is installed correctly, you will see Sanguino options in your Tools>Board menu.  
+
If the Sanguino software is installed correctly, you will see Sanguino options in your Tools>Board menu.
 +
 
 +
=== Uploading firmware ===
 +
 
 +
1. Connect your FTDI interface (e.g., USB-TTL cable) to location J2 on the circuit board (the 6-pin SIL right-angle header also labeled "LOGIC-LEVEL (TTL) SERIAL"), watching the polarity.  For the cables with rainbow-wires on the end, black goes down, green goes up.
 +
 
 +
2. Make sure that the correct serial port is selected in the Tools>Serial Port menu. (Hint: you might need to install the FTDI USB drivers from here: http://www.ftdichip.com/Drivers/VCP.htm)
 +
 
 +
3. Select "Sanguino W/ ATmega644P" from your Tools>Board menu
 +
 
 +
4. Make sure that Alpha Clock Five is powered on.
 +
 
 +
5. Open up the "sketch" file for firmware version 2.1.  You can find it in your menu under File > Examples > alphafive > AlphaClock.
 +
 
 +
6. Then, click the "Upload" button in your Arduino window to upload the sketch. (Error? Check the next section for possible Baud Rate correction)
 +
 
 +
 
 +
There are additional example files included with the library to demonstrate simpler applications of the Alpha Clock Five library, as well as processing sketches that can send serial data to the Alpha Clock Five.  See [[Alpha_Clock_Serial_v2| Alpha Clock Serial]] for more information.
 +
 
 +
=== Change in baud rate from firmware version 1.0 ===
 +
 
 +
The bootloader baud rate is the interface speed at which your computer talks to the Alpha Clock Five hardware when writing new firmware.  The baud rate supported by the Arduino/Sanguino development environment has changed since firmware version 1.0, as follows:
  
 +
* Alpha Clock Five firmware version 1 is based on Sanguino version 0023r2, which has a default a bootloader speed of 38400 baud.
 +
* Alpha Clock Five firmware version 2 is based on Sanguino version 1.0.1, which has a default bootloader speed of 57600 baud.
  
=== Uploading firmware ===
 
  
Connect your FTDI interface (e.g., USB-TTL cable) to location J2 on the circuit board (the 6-pin SIL right-angle header also labeled "LOGIC-LEVEL (TTL) SERIAL"), watching the polarity.  For one of the cables with rainbow-wires on the end, black goes down, green goes up.
+
''Therefore,''
  
Make sure that the correct serial port is selected in the Tools>Serial Port menu.
+
* Alpha Clock Five kits that originally shipped with firmware version 1 need to be programmed at 38400 baud.
 +
* Alpha Clock Five kits that originally shipped with firmware version 2 need to be programmed at 57600 baud. 
  
Select "Sanguino W/ ATmega644P" from your Tools>Board menu
 
  
Make sure that Alpha Clock Five is powered on.
+
As this baud rate is programmed into the bootloader section of the microcontroller's firmware, it can only be changed by rewriting the microcontroller's bootloader, with an AVR ISP programmer.    So, to upgrade an Alpha Clock Five kit from firmware version 1.0 to version 2.x, you have two choices: Either (A) Reprogram the bootloader with an AVR-ISP programmer or (B) Modify the development environment so that it uses a bootloader speed of 38400 baud.  If you choose to do neither, programming will not work, and you will get an error. (Likely error: "avrdude: stk500_getsync(): not in sync: resp=0x00")
 +
  
Click the "Upload" button in your Arduino window to upload the sketch.
+
To modify the Arduino/Sanguino development environment to work at 38400 baud, you will need to locate and edit the "boards.txt" file within your Sanguino installation. This file is located ''inside the Sanguino folder'' that you installed earlier.  (If you cannot locate it, refer to the instructions above about where your Sanguino folder was installed.)  In that file, locate the line that reads "atmega644.upload.speed=57600", change it to read "atmega644.upload.speed=38400", and save the file.  
  
  
Line 85: Line 128:
 
Programming the bootloader onto a new ATmega644A requires an AVR ISP programmer (see more about that below).  This can be done directly from within the Arduino environment (using the Tools>Burn bootloader option), but is complicated by the fact that we are using an ATmega644A rather than the ATmega644P normally expected by Sanguino.
 
Programming the bootloader onto a new ATmega644A requires an AVR ISP programmer (see more about that below).  This can be done directly from within the Arduino environment (using the Tools>Burn bootloader option), but is complicated by the fact that we are using an ATmega644A rather than the ATmega644P normally expected by Sanguino.
  
First, download and install [http://evilmadscientist.s3.amazonaws.com/source/alphafive/Sanguino_alphafive.zip this alternate version] (130 kB .zip file) of the Sanguino software, which includes a definition of the 644A for purposes of using the bootloader.
+
First, download [http://evilmadscientist.s3.amazonaws.com/source/alphafive/boards.txt-644A.zip this alternate boards.txt file] (1 kB .zip file), which includes a definition of the 644A for purposes of using the bootloader.
  
 
Then, to install the bootloader:
 
Then, to install the bootloader:
Line 100: Line 143:
  
 
The "hardware" device signatures-- those that you will read if you try to reprogram the AVR through an ISP interface --do remain those of the ATmega644A.
 
The "hardware" device signatures-- those that you will read if you try to reprogram the AVR through an ISP interface --do remain those of the ATmega644A.
 +
  
 
== AVR ISP Programming ==
 
== AVR ISP Programming ==
  
The Alpha Clock Five PCB features a 6-pin AVR ISP connector (J4), which can be used to program the microcontroller through any suitable AVR ISP programmer.  We recommend the Adafruit [http://evilmadscience.com/productsmenu/tinykitlist/106-usbtiny USBtinyISP] programmer for most purposes.  The Alpha Clock Five should be powered separately from 5 V while programming; Alpha Clock Five requires more power than can usually be safely provided by USB.
+
The Alpha Clock Five PCB features a 6-pin AVR ISP connector (J4), which can be used to program the microcontroller through any suitable AVR ISP programmer.  We recommend the Adafruit [http://shop.evilmadscientist.com/productsmenu/tinykitlist/106-usbtiny USBtinyISP] programmer for most purposes.  The Alpha Clock Five should be powered separately through its regular power supply while programming, not through the ISP programmer.
  
 
The circuit can be programmed through AVR-GCC or any other AVR software environment, including AVR Studio.  If using AVR-GCC, you may find it helpful to target (set the MCU type as) the ATmega644P rather than the ATmega644A, as it is better supported.
 
The circuit can be programmed through AVR-GCC or any other AVR software environment, including AVR Studio.  If using AVR-GCC, you may find it helpful to target (set the MCU type as) the ATmega644P rather than the ATmega644A, as it is better supported.
  
Please refer to the [http://evilmadscientist.s3.amazonaws.com/source/alphafive/fiveletter.pdf schematics] (PDF) for pinouts and electrical features of the Alpha Clock Five.  
+
Please refer to the electrical schematics for pinouts and other hardware features of the Alpha Clock Five.
  
 
+
== Planned future versions ==
== Standard Firmware ==
 
 
 
 
 
=== Version 1.0 ===
 
 
 
Version 1.0 of the Alpha Clock Five firmware is discussed [http://wiki.evilmadscience.com/Alpha_Clock_Firmware here].
 
 
 
=== Version 2.0 ===
 
 
 
'''Currently under development.
 
'''
 
 
 
 
 
Besides the Arduino 1.01/Sanguino environment described earlier, this code requires that you install the "new" Time library, available [http://www.arduino.cc/playground/Code/DateTime here].  These should be installed like regular Arduino libraries, within the "libraries" directory of your sketch folder.
 
 
 
 
 
=== Planned future versions ===
 
  
 
Planned future features include:
 
Planned future features include:
 
* Additional display modes
 
* Additional display modes
* Expanded serial communication, with additional commands
+
* Expanded serial communication, with additional commands  
* Expanded serial communication, using the second serial port for daisy-chained displays
+
* Additional example code, such as for countdown timers
 
 
If you would like to suggest additional features, please use the [http://wiki.evilmadscience.com/Talk:Alpha_Clock_Firmware talk page] or the [http://www.evilmadscientist.com/forum/index.php?forum=15 Evil Mad Scientist Forums].
 
  
Code contributions and are welcome, of course, and we will be setting up a formal repository in the near future. In the mean time, please [http://www.evilmadscientist.com/staticpages/index.php/contact contact Evil Mad Scientist Laboratories] if you are interested in contributing.
+
If you would like to suggest additional features, please use [http://wiki.evilmadscience.com/Talk:Alpha_Clock_Firmware this talk page] or the [http://forum.evilmadscientist.com/categories/clocks Evil Mad Scientist Forums].  
  
== Alternate "Demo" firmware ==
 
  
A simple demo program, which shows displaying text on the LED display, playing sounds, lighting up the rear-panel nightlight, and recognizing button events is available for download [http://evilmadscientist.s3.amazonaws.com/source/alphafive/alpha_5_hello.pde here] (15 kB .pde file).
+
Direct code contributions are also welcome, of course.  Our github repository [https://github.com/oskay/AlphaClock is located here].

Revision as of 18:30, 9 July 2014

The Alpha Clock Five is an alarm clock and alphanumeric LED data display device based on the ATmega644A AVR microcontroller. While most users will not need to reprogram Alpha Clock Five, we are making this page of documentation available for those who would like to modify the programming or simply would like to update an existing unit to firmware version 2.x.

Alpha Clock Five can be programmed through an FTDI USB-TTL interface, using a modified version of the Arduino development environment, or through an AVR ISP programmer using standard AVR programming techniques. The default firmware is designed to under the modified Arduino environment, which is described below in the section titled "Bootloader (Arduino style) programming."


Standard Firmware for Alpha Clock Five

Alpha Clock Five firmware version 2.0

The latest version of the Alpha Clock Five Firmware, (currently v. 2.1) is hosted at our github repository. Download the .zip archive of the repository there, or follow this direct link to download and save it to your computer. This .zip archive contains the Alpha Clock Five library for Arduino, for which the standard firmware is included as one of the example files. The necessary setup to install that library and upload the firmware is discussed in the sections that follow on this page.


(The previous major firmware version, v. 1.0 of the Alpha Clock Five firmware is discussed here.)


Bootloader (Arduino style) programming

The microcontroller in Alpha Clock Five kit comes preprogrammed with the Sanguino Bootloader. Because of this, Alpha Clock Five can be reprogrammed right in the Arduino environment, through a USB-TTL interface such as the FTDI USB-TTL cable or the Adafruit FTDI Friend, and doing so is our recommended procedure.

The bootloader itself can only be written (or rewritten) with an AVR ISP programmer, such as the USBtinyISP. While most users will not ever need to do this, see below (under AVR ISP Programming) if you should need to do so.


Setting up the environment

Alpha Clock Five requires a rather specialized programming environment:


Required software:

  • Arduino 1.0.3 (available here).
  • Arduino Time library, available here.
  • Alpha Clock Five library, as discussed above.
  • Sanguino version 1.0.1 from here.

First, install the Arduino program on your computer. Open Arduino to ensure that it runs correctly, and then quit. (Please do not skip this step!)

Secondly, install the Time library in your Arduino libraries folder. The exact location of this libraries folder depends a bit on your operating system. For example, on Mac OSX, the directory would be ~/Documents/Arduino/libraries/. On Windows, it would be My Documents\Arduino\libraries\ . Copy the Time folder (the one with the time.h file, not the top-level Time folder) to your libraries folder. If your library is installed correctly, it will show up in (and be importable from) the Sketch > Import Library menu in the Arduino program when you restart it.

Third, install the Alpha Clock Five library. When you download the .zip file from github, it will show up on your computer as "AlphaClock-master.zip". Unzip that file, and open that folder to find the file within called just "alphafive". Place this "alphafive" folder in your Arduino libraries folder, just as you did with the Time library. If your library is installed correctly, it will show up in the Sketch > Import Library menu in the Arduino program when you restart it.


Finally, the Sanguino extensions need to be installed separately, and the method for that depends, very slightly, on your operating system:


Installing Sanguino: Mac

First unzip the Sanguino .zip file, which reveals a folder called "Sanguino." Then, find the location where you need to install it.


  • Locate your Arduino.app file, version 1.0.3 (which you may have just installed).
  • Ctrl-click the file to show the contextual pop-up menu.
  • From that menu, select "Show Package Contents."
  • Within the resulting directory (Arduino.app), navigate to the folder Contents/Resources/Java/hardware
  • Inside "hardware" there several folders, including one called "arduino." Copy the whole "Sanguino" folder, which you unzipped earlier into the hardware folder, next to "arduino."
  • Restart Arduino.

If the Sanguino software is installed correctly, you will see Sanguino options in your Tools>Board menu.


Installing Sanguino: Windows

First unzip the Sanguino .zip file, which reveals a folder called "Sanguino." Then, copy that to within your Arduino application.

  • Locate your Arduino application, version 1.0.3 (which you may have just installed).
  • Copy the Sanguino directory to arduino\hardware/
  • You should end up with arduino\hardware\Sanguino\
  • Restart Arduino.

If the Sanguino software is installed correctly, you will see Sanguino options in your Tools>Board menu.


Installing Sanguino: Linux

First unzip the Sanguino .zip file, which reveals a folder called "Sanguino." Then, copy that to within your Arduino application.

  • Locate your Arduino application, version 1.0.3 (which you may have just installed).
  • Copy ~/Sanguino to arduino/hardware/
  • You should end up with arduino/hardware/Sanguino/
  • Restart Arduino.

If the Sanguino software is installed correctly, you will see Sanguino options in your Tools>Board menu.

Uploading firmware

1. Connect your FTDI interface (e.g., USB-TTL cable) to location J2 on the circuit board (the 6-pin SIL right-angle header also labeled "LOGIC-LEVEL (TTL) SERIAL"), watching the polarity. For the cables with rainbow-wires on the end, black goes down, green goes up.

2. Make sure that the correct serial port is selected in the Tools>Serial Port menu. (Hint: you might need to install the FTDI USB drivers from here: http://www.ftdichip.com/Drivers/VCP.htm)

3. Select "Sanguino W/ ATmega644P" from your Tools>Board menu

4. Make sure that Alpha Clock Five is powered on.

5. Open up the "sketch" file for firmware version 2.1. You can find it in your menu under File > Examples > alphafive > AlphaClock.

6. Then, click the "Upload" button in your Arduino window to upload the sketch. (Error? Check the next section for possible Baud Rate correction)


There are additional example files included with the library to demonstrate simpler applications of the Alpha Clock Five library, as well as processing sketches that can send serial data to the Alpha Clock Five. See Alpha Clock Serial for more information.

Change in baud rate from firmware version 1.0

The bootloader baud rate is the interface speed at which your computer talks to the Alpha Clock Five hardware when writing new firmware. The baud rate supported by the Arduino/Sanguino development environment has changed since firmware version 1.0, as follows:

  • Alpha Clock Five firmware version 1 is based on Sanguino version 0023r2, which has a default a bootloader speed of 38400 baud.
  • Alpha Clock Five firmware version 2 is based on Sanguino version 1.0.1, which has a default bootloader speed of 57600 baud.


Therefore,

  • Alpha Clock Five kits that originally shipped with firmware version 1 need to be programmed at 38400 baud.
  • Alpha Clock Five kits that originally shipped with firmware version 2 need to be programmed at 57600 baud.


As this baud rate is programmed into the bootloader section of the microcontroller's firmware, it can only be changed by rewriting the microcontroller's bootloader, with an AVR ISP programmer. So, to upgrade an Alpha Clock Five kit from firmware version 1.0 to version 2.x, you have two choices: Either (A) Reprogram the bootloader with an AVR-ISP programmer or (B) Modify the development environment so that it uses a bootloader speed of 38400 baud. If you choose to do neither, programming will not work, and you will get an error. (Likely error: "avrdude: stk500_getsync(): not in sync: resp=0x00")


To modify the Arduino/Sanguino development environment to work at 38400 baud, you will need to locate and edit the "boards.txt" file within your Sanguino installation. This file is located inside the Sanguino folder that you installed earlier. (If you cannot locate it, refer to the instructions above about where your Sanguino folder was installed.) In that file, locate the line that reads "atmega644.upload.speed=57600", change it to read "atmega644.upload.speed=38400", and save the file.


Programming the bootloader

Most users will not need to reprogram the bootloader at any point.

Programming the bootloader onto a new ATmega644A requires an AVR ISP programmer (see more about that below). This can be done directly from within the Arduino environment (using the Tools>Burn bootloader option), but is complicated by the fact that we are using an ATmega644A rather than the ATmega644P normally expected by Sanguino.

First, download this alternate boards.txt file (1 kB .zip file), which includes a definition of the 644A for purposes of using the bootloader.

Then, to install the bootloader:

  • Select as your board type (from Tools>Board), "Sanguino W/ ATmega644/644A"
  • From Tools>Burn Bootloader, select your AVR ISP programmer type, to actually burn the bootloader

After installing the bootloader, select board type "Sanguino W/ ATmega644P" when you wish to reprogram the board through the bootloader, as the "software" device signatures returned by the bootloader are those for the '644P. If you reprogram the board through an ISP programmer (including reburning of the bootloader), you will still need to select ATmega644A as the device type.


Technical note on device signature

The device signature that the Alpha Clock's bootloader returns is that of the ATmega644P (not the ATmega644A). This is intentional. It is (1) code compatible and (2) better supported under both AVR-GCC and the Arduino/Sanguino environments. There are longstanding bugs in support for the 644A, and this is a stable and sane workaround.

The "hardware" device signatures-- those that you will read if you try to reprogram the AVR through an ISP interface --do remain those of the ATmega644A.


AVR ISP Programming

The Alpha Clock Five PCB features a 6-pin AVR ISP connector (J4), which can be used to program the microcontroller through any suitable AVR ISP programmer. We recommend the Adafruit USBtinyISP programmer for most purposes. The Alpha Clock Five should be powered separately through its regular power supply while programming, not through the ISP programmer.

The circuit can be programmed through AVR-GCC or any other AVR software environment, including AVR Studio. If using AVR-GCC, you may find it helpful to target (set the MCU type as) the ATmega644P rather than the ATmega644A, as it is better supported.

Please refer to the electrical schematics for pinouts and other hardware features of the Alpha Clock Five.

Planned future versions

Planned future features include:

  • Additional display modes
  • Expanded serial communication, with additional commands
  • Additional example code, such as for countdown timers

If you would like to suggest additional features, please use this talk page or the Evil Mad Scientist Forums.


Direct code contributions are also welcome, of course. Our github repository is located here.