An adapter to program 28 pin AVR DIPs.
Jan, 2010.
This may have been a waste of time. It is hard to predict exactly how useful this will be to me (feb - it has been quite useful). I bought five AVR mega328s to build into projects and needed to program them. There are plenty of options to do this including having a ISP connector on the target project or simply plugging the chip into something like a Duemilanove. I usually do the former. Using a Duemilanove is fine if you only do it once in a while but you'd wear out the socket and pins on the original micro if you used it a lot. It is also not practical to test the various AVR fuses this way.
The adapter I built is based on a ZIF (zero insertion force) socket I bought from sparkfun. Almost all my personal AVR projects have been for a TWI network I have at home. Apart from the USB/TWI gateway (a Duemilanove) all the devices on the two wire bus use a 8 pin DIN connected for power (12V nom) and coms. All the remote devices are programmed with my own bootstrap which allows software uploads into the main application flash memory. I don't used the arduino boot software or the arduino IDE. I would generally use the DIN for power and TWI. I also added a 6-pin connector for an arduino style serial adaptor. In theory I could burn in the arduino boot and connect to the arduino IDE - I haven't bothered though.
The ISP connector is 10 pin Kanda style. The 3 pin socket is for an optional crystal, resonator or external clock. The LED is arduino compatible.
The construction was a mix of wire-wrap and solder.
After everything was tested and working I blobified it in polymorph to make it bulletproof.
The basic hardware was fairly straight forward but I've had plenty of headaches with the mega328.
It seemed sensible to base my projects of the m328 because it was only a dollar or so dearer than the m168 but had twice the flash.
What wasn't obvious was that the fuses are not m168 compatible and kanda still to my knowledge don't support it. AVR studio was also lacking the m328 header files and my version of winAVR seems to have a bug and doesn't generate the m328 interrupt vectors.
So in the process of trying to program the fuses correctly I accidentally set them to low-power clock mode - I managed to extract a crystal out of a dead watch and adapt it for my socket. It worked and I saved the chip.
I later screwed up again while trying to "fudge" the fuse settings I wanted and never managed to talk to that chip again. (PS.. it was eventually repaired in a high voltage programmer).
In the end I used avr-dude and a USB pocket programmer to set the correct fuses. I much prefer kanda so I use it to upload the boot program.
The lock bits prevent the boot being overwritten.
The fuse/lock settings I used were...
high fuse byte = D0 (should have been D2)
IFuse = F2
eFuse = 7 (should have been 5)
lock bits = 2F
WRT IFuse - the "2" selects internal RC, F7 should be 8-16meg full swing xtal and F6 for 3-6 meg, FF and FE for low power mode.
This (I hope) sets the chip to internal 8meg RC clock, boot from boot block and maximum boot block size (2K bytes).
It is very easy to screw up a fuse bit so it is really good to be able to test the clock setting and go through a couple of software upload cycles while the chip is in the programming socket.
A simple mistake like not settings the reset vector to boot block results in a system which can be programmed once but never again - so it is important to do more than one code upload for testing.
To see what I used the programmed chip for look here - DIP AVR project 1.
May 2010.
Alternatively you can just make an adapter an grab the ISP pins with easyhooks.
SF now have hooks which may be able to grab the pins on SMDs as well.
I got the fuses slightly wrong and needed to do this to sort out the problem.
Notes.
The mini-pro fuses are - D2 FF 05 3F (the new ones are different but I didn't note them).