Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
The HexaBus devices do not offer a simple ISP-style interface for programming - we use the much more powerful JTAG interface. You need a JTAG-capable programmer for this. We have successfully used these two devices:
- The Atmel JTAG ICE MK2. This is definitely a very professional programmer that can also program a lot of different chips. The drawback is its price point: at approx. 250 Euro, its not cheap. Stay away from the newer JTAG ICE MK3 - Atmel has not released its communication protocol, so it cannot be used with avrdude or any other free software.
- The Atmel AVR DRAGON. This is a cheap Atmel JTAG interface - it can be bought for around 50 Euro. It consists of a single PCB, so you need to add a USB cable and a 10-pin ribbon cable, but still its much cheaper than the JTAG ICE MK2. However, the devices are said to be sensitive to static electricity - see the mikrocontroller.net page (German) for an in-depth discussion.
Use JTAG to program the HexaBus Plug
The plug offers a combined JTAG- and Serial interface connector. It is the micromatch connector on the left side of the low voltage PCB. My deluxe development setup looks like this:
It features a JTAG adapter and the serial interface, as described on the Hexabusplugserialinterface page. Both connectors are exposed on a small hand-soldered PCB. The schematic for this is simple:
The ATMega1284 can be programmed using the JTAG interface and avrdude. You can use
$ /usr/local/bin/avrdude -c jtag2 -P usb -p atmega1284p -U flash:w:Hexabus-Socket.hex -F
to program the device. You need to consider two points here:
The atmega1284 has currently no definition in the avrdude.conf. Fortunately, it is almost identical to the definition of the atmega1284p, but has a different device signature. Either you patch your avrdude.conf or use the
-Fparamater (as above). This will disable the signature check (but please be careful!)
Make sure you use a recent version of avrdude. The hex file needs more than 16 bit for adressing, which is only implemented in newer versions of avrdude. I am using 5.10, which is working fine. See also [https://github.com/mysmartgrid/hexabus/issues/9] for an in-depth discussion.