Sunday, August 21, 2011

Programming an ATtiny85 on a breadboard using AVR-ISP500 (STK500 compatible) AVR programmer

So I finally got my AVR programmer and I wanted to program my ATtiny85 MCU, to act as an RFID tag.

I got the code for the ATtiny85 RFID emulator from here and you can read more about that project there.

Since I have never programmed an AVR before, I had to read a lot to figure out how simple it is to hook up an AVR to the programmer on a breadboard.

This blog post might be helpful to those who want to just get their AVR programmed right away.

Parts needed:
- AVR-ISP programmer

- ATtiny85 MCU

- Breadboard

- 3 x 1.5v Battery box with 3 x 1.5v batteries - I was able to find only a 4 x 1.5v battery box, so I soldered a wire instead of one battery.

- 40pin Breakaway header - picture shows the 12 pins I have left, after using a bunch already...
- 6 Breadboard wires

Steps:
-------
- Mark the breadboard wires like so: VCC, GND, RST, MISO, MOSI, SCK - I used a white duct tape, cut a little piece, stick it to a cable and write the letters on it with a pen.

- Break two pieces of 3 pins from the 40pin breakaway header

- On one 3 pins header, using pliers, bend the long legs on a 90 degrees angle, then again - to give you a shape like so:
- Place the two 3 pin headers next to each other but on different sides of the breadboard - this allows for connecting a separate wire on each of the ISP connector's pins.
- Plug the ATtiny85 MCU in parallel to the "ISP header"
- Wire the pins according to the datasheet


Taken from Olimex's AVR-ISP500 user's manual

- Connect the ISP connector to the 2x3 connector - make sure the ISP connector's pin 1 is connected to the MISO marked wire and connect battery pack to the ATtiny85's VCC and GND pins
- Done. You can now program the ATtiny85 with avrdude which is included in winavr

3 comments:

  1. Thank you~! I wanted you to know that the time you spent creating this tutorial has helped at least one other person =)

    ReplyDelete
  2. Glad you found it useful and good luck with your learning/project... :-)

    ReplyDelete
  3. Coincidentally i was wondering how to do this! thank you very much. the thing i dont understand is why the battery pack. the isp500 does not give the energy? that sounds very strange and uncomfortable...
    Also, if you could give me a link on how the software is used, would be great.... i dont even understand why there are so many different files: hex, cpp... etc}
    Thank you a lot

    ReplyDelete