MacOSX , Atmel AVRISP mk II, and SRS Workshop Robot
Author: Andrew Nicholson
Date: 2007-06-21
Host Version: Mac OS X 10.4.9, MacMini 1.66GHz Intel Core Duo
AVR ISP Programmer: Atmel AVRISP Mk II, USB version 6 pin ISP only.
Target board version: ARC 1.1 board by Larry Barello
Problem 1:
The AVRISP mk II only has a 6-pin ISP cable unlike earlier versions that had a 10 pin ISP cable.
The ARC board has a 10 pin ISP.
Built a small hack board with both the 6 pin and 10 pin headers and made the correct
connections. Many of the 10 pin connectors are wired to GND. If you get the orientation
correct between the two headers then MISO, SCK, RESET are aligned and are straight
bridges. Wire Vcc (pin-2) on both headers together. Wire MOSI (10pin-1 to 6pin-4) together.
Now all that is left is to connect all the GND pins on 10pin, all on one side, even numbers
except 2, and then to 6pin-4. Make a short 10pin cable using the parts for the parallel cable.
Make sure that the red wire is pin-1, the one with the small triangle on the connector.
When you connect the cables to this hack board make sure that the red sides of the cables
are plugged with the right orientation.
10pin 6pin Signal
----- ---- ------
1 4 MOSI
2 2 Vcc
3 NC (I connected this to GND)
4 6 GND
5 5 RESET
6 GND
7 3 SCK
8 GND
9 1 MISO
10 GND

Make sure that after you've soldered everything to run around the pins with a multimeter
and check that all pins connect only where they should and that there are no unintended
shorts between adjacent pins.
Problem 2:
The name of the new programmer according to avrdude is "avrispmkII".
$ avrdude -c foo
shows you all the valid programmers it knows about.
Once we figured out that "-P usb" should be used as the device.
We were up and running on the WinXP laptop that was using WinAVR.
Problem 3:
None of the setup worked on the MacMini we had at home ... here are the steps
I used to get it working. It maybe possible to use pre-packaged versions of the
software but I didn't have the time to track them down and figure out the packaging so I
did what I've done on every Unix system since 1980 - rebuilt it all from source.
(Open source is a good thing!)
Installed:
X Core - latest from Apple Developer (free registration)
This contains the gcc used to develop code on the Mac and will be needed to
build the programs that run on the Mac
Installed Source and Rebuilt:
Make sure you've done this (bash):
$ export PREFIX=/usr/local/avr
$ export PATH="$PATH:$PREFIX/bin"
then whenever you use need to build basically follow the following steps:
Unpack *tar.bz2 into <dir>
$ cd <dir>
$ mkdir obj-avr
$ cd obj-avr
$ CONF="../configure --prefix=$PREFIX --target=avr"
$ $CONF # maybe additional flags
$ make
$ sudo make install # you'll occasionally need to enter password
The packages:
libusb-0.1.12
http://libusb.sourceforge.net/download.html#stable
installed into /usr/local/{bin,include,lib}
The following are installed into /usr/local/avr/
binutils-2.17
http://ftp.gnu.org/gnu/binutils/
$ $CONF --disable-nls
gcc-4.2.0 (used to build the cross-compiler avr-gcc)
$ $CONF --enable-languages=c --disable-nls \
--disable-libssp --with-dwarf2
avr-libc-1.4.6
http://download.savannah.gnu.org/releases/avr-libc/
$ $CONF --build=`./config.guess` --host=avr
The "avr-lib-user-manual-1.4.6.pdf" is very useful around
section 9.10 "Installing the GNU Tool Chain."
avrdude-5.4
http://download.savannah.gnu.org/releases/avrdude/
bus errored because it couldn't find libusb in the right place. Wasn't
built with the correct PATH set.
Do not use the --target=avr flag.
I have not downloaded or tested this yet ...
http://download.savannah.gnu.org/releases/uisp/
Problem 4:
Needed to fix the makefile and setup the PATH before using the software.
Make sure that your shell path has :-
$ PATH="$PATH:/usr/local/avr/bin"
$ MANPATH="$MANPATH:/usr/local/avr/man/"
Edit makefiles in the "C Samples" and add:
AVRDUDE_PART = m16 # ATMega16
AVRDUDE_PROGRAMMER = avrispmkII
AVRDUDE_PORT = usb
$ make program
avrdude -p m16 -c avrispmkII -b 115200 -P usb -e -U flash:w:FlashLED.bin:r
Problem 5: Slow ISP Programmer.
AVRISPmkII was factory configured with a very slow SCK delays.
Run avrdude in terminal mode and talk to the programmer to change the delay .
$ avrdude -p m16 -c avrispmkII -b 115200 -P usb -tuF
wait for it to prompt you then:
> sck 10
> quit
Run "make program" again - now very fast.
Send any comments to: andrewn@lesto.com