AVR programming trick: Sharing target boards

2313-25 (plain socket)

This week, Brad wrote in with an interesting question: Can you program the ATtiny25 on one of our 'tiny2313 target boards? And the answer is yes: you can, with just a trivial modification.


Okay, back up-- a little context here. The ATtiny25 and the ATtiny2313 are examples of AVR microcontrollers, the little brains that power many of our projects.

To program these chips, we use a usbtinyisp programmer, hooked up to a minimalist target board.

USBtinyISP & simple target

The target board basically provides a programming header that's hooked up to the right pins of the chip, plus some way to power the chip-- often through the programmer itself.

After hand-wiring up one too many minimalist '2313 boards like that, we also made a printed circuit board version of the '2313 target board. Normally, it looks something like this, with an ATtiny2313 in a ZIF socket:

2313Card - 4


But, back to the question. The ATtiny25, ATtiny45, and ATtiny85 are a family of 8-pin AVR microcontrollers that are not pin compatible with the '2313. However, at only 8 pins instead of 20 pins, they'll definitely fit in the socket... somewhere.

Looking at the datasheets and pinouts for the the '45, '2313 (and the '168 that we also have a target board for), we can identify the lines used for programming: MISO, MOSI, SCK, and RESET:

The chips also need power and ground connections to be programmed, of course. Now if you notice, the connections for the '2313 and '45 are very similar-- in fact, almost identical if you line the chip up so that pin 1 goes where pin 1 of the '2313 normally would. The one remaining difference is that there's no ground connection to pin 4 of the '2313.


2313-25 (fixed up)

So, adding a wire from ground-- pin 10 of the '2313 --to pin 4 of the smaller chip (an ATtiny25 in our photo), and lining up pin 1 to pin 1, we're ready to go. And yes, it works like a charm.

If you do use this method, there are a few (possibly obvious) things worth noting:

  • You need to be careful to line up pin 1 of the chip to pin 1 of the socket.
  • Be careful if or when you put a '2313 chip back in the socket. It will draw a lot of current if you set pin 4's to a high output level-- it's shorted to ground. (Better: If you want to go back and forth, use a switch, not a wire.)
  • Keep in mind that the pin labels on the target board are for the '2313, not the '85.


Going one step further, you could also potentially program the '25/'45/'85 from the '168 target board: it only takes a couple more wires. To do so, line up pin 1 of the '25 to pin 9 of the '168. Add two wires this time, from board-reset to chip-reset, and from board-ground to chip-ground. You'll also need to connect AVCC (analog power supply) to VCC. A little more work, yes, but still a good hack.

4 comments

The following comments are owned by whomever posted them. This site is not responsible for what they say.
Authored by: Anonymous on Wednesday, September 01 2010 @ 09:42 AM PDT AVR programming trick: Sharing target boards
I've been doing this for a while for programming ATTiny13s - see http://www.evilmadscientist.com/comment.php?mode=view&cid=5948 . The only difference is that I added a 2-pin jumper in the prototyping area to turn the 8-pin ground on and off depending on what chip I'm programming.
Authored by: Windell on Wednesday, September 01 2010 @ 09:47 AM PDT AVR programming trick: Sharing target boards
Great! I wonder what other chips this works for...

---
Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/
Authored by: Anonymous on Sunday, September 05 2010 @ 02:06 PM PDT AVR programming trick: Sharing target boards
Could this be done using the MegaXX8 target board as well for all three chip sizes?
What I mean is by wiring the needed signals for tiny2313 and 8pin devices all lined up with pin 1, and use a 28pin zif? Of course Reset would be common since it's pin 1 for all three chips.

That would make a great programming target board.

Authored by: Anonymous on Monday, September 06 2010 @ 11:27 AM PDT AVR programming trick: Sharing target boards
Also, adding a clock source might be a good idea. If the clock fuses are set, ISP wont work without the external clock.
Welcome to Evil Mad Scientist Laboratories. New projects are posted on most Wednesdays.


Bookmark EMSL

EMSL RSS

Evil Mad Linkblog

Twitter: @EMSL

Facebook page
del.icio.us
feedburner
Feed on Google Reader
YouTube Channel

Subscribe to get new articles by E-mail:

E-mail address:


Preview | Powered by FeedBlitz

My Account





Sign up as a New User
Lost your password?

Who's Online

Guest Users: 13

DIY Hardware for Electronic Art


The Original Egg-Bot Kit


Octolively
Interactive LED kits


Meggy Jr RGB
LED matrix game
development kit.


Business-card sized
AVR target boards


Peggy 2
LED Pegboard kits

Forumposts

Order: New Views Posts
Latest 10 Forum Posts
 
Re: Wire for Remote LEDs and I..
 By:  dayjerd
 Friday, February 03 2012 @ 06:36 PM PST
Re: Wire for Remote LEDs and I..
 By:  Windell
 Friday, February 03 2012 @ 02:36 PM PST
Re: Wire for Remote LEDs and I..
 By:  dayjerd
 Thursday, February 02 2012 @ 12:47 PM PST
Re: Wire for Remote LEDs and I..
 By:  Windell
 Thursday, February 02 2012 @ 10:55 AM PST
Re: Wire for Remote LEDs and I..
 By:  dayjerd
 Thursday, February 02 2012 @ 05:30 AM PST
Re: Wire for Remote LEDs and I..
 By:  Windell
 Wednesday, February 01 2012 @ 10:21 PM PST
Wire for Remote LEDs and IR LE..
 By:  dayjerd
 Wednesday, February 01 2012 @ 09:07 PM PST
Re: Newbie: adding switches to..
 By:  Windell
 Monday, January 30 2012 @ 10:32 AM PST
Re: Newbie: adding switches to..
 By:  John Fongheiser
 Monday, January 30 2012 @ 10:20 AM PST
Re: Newbie: adding switches to..
 By:  Ugi
 Monday, January 30 2012 @ 08:43 AM PST