Kuva Vasemmalla - Zoom

In this guide I am working in Rasbian, and have done the initial installation needed for raspi zero to be used for programming instead of a separate programming stick. For this purpose I designed my own hat for the Raspberry Pi Zero that I call AVR Origin

In the AVRdude installation we already installed a good few things but we need to add a few more.

$ sudo apt-get install byacc gcc-avr avr-libc libc6-dev

These add the extra files needed for successful programming of sticks. Now we need to download the firmware to be used on the programming stick.

wget http://academy.cba.mit.edu/classes/embedded_programming/firmware.zip

Then you unzip it and navigate into its folder.

unzip firmware.zip

Now we need to edit the makefile, you can use your favourite text editor for it, since we are using nonstandard programmer. we need to add this line to the file, and comment the other programmers.

AVRDUDE = avrdude -c gpio -p $(DEVICE) # edit this like for your programmer

Now when we compile and run the makefile to program the stick, it uses the GPIO lines on the raspberry PI, that we enabled during the initial installation.

Now we can begin programming the stick, we begin this by compiling the code.

make clean

make hex

Now we have the compiled code for the stick, and can set its fuses for using the external clock

make fuse

Now we do the proper programming of the stick to make it into a ISP programming stick.

make program

Executing the make program command

Once you have programmed the stick you can check if it worked out, with this command the raspi lists all the USB devices it sees

lsusb


Bus 002 Device 004: ID 1781:0c9f Multiple Vendors USBtiny

Now depending on what board you used for your stick, you need to remove solder bridges and/or 0ohm resistors