Increasingly marvellous wares - by Joakim Arfvidsson |
||||
USB AVR programmerThis is a programmer that will transfer code and data to the AVR series of microcontrollers, using only a USB port on the computer. It's compatible with Mac OS (X), Windows, Linux and possibly other flavors of Unix (FTDI driver being what is required). I was getting tired of these USB-serial adapters, and the USB programmers I found to be purchasable was strangely expensive ($149) or not ISP, so I produced this. You are free to put together your own copy out of my schematics, and improve on the design, but not to sell solutions based on it. If you have any questions at all, do give me a shout. This solution is based on the work of others, and due credit should be given to Atmel for publishing the original AVR 910 specificiation, and John Samperi for polishing up the code to support nearly all controllers. It is based on the AVR 910 design, which means that it works with both AVR Studio and uisp. The AVR 910 protocol is however a tad slow, and does not handle the latency of USB really great, so I plan to improve on the software to have an additional mode for faster transfers.With current firmware an AT90S2313 is filled and verified in about 30 s. I believe that this will be significantly reduced when I get around to making sure that the RX buffer timeout of the USB chip is lowered from the default 16 ms to the minimum 1 ms. This is possible to achieve in software, but I haven't looked into it yet. NEWS FLASHThe new firmware (STK500 compatible) I'm developing for the programmer is partly functional. Uploading/downloading works with my ATMega162 anyway. I wouldn't expect it to work with AVR Studio yet (I use uisp). If you're interested in trying something that is bound to not work exactly like it should, send me an email. Also, this new firmware will run just as good on the AVR910 hardware. I have no idea why nobody did this before - it is not at all impossible to cram the STK500 protocol into an AT90S2313. Though it kind of is tight:) The design![]() The board is basically the AVR 910 programmer with an FT232BM to handle USB instead of the discrete components or MAX232 that would be used to drive the RS-232 levels of the old serial port. The programmer doesn't draw it's power from the USB bus, but instead, as most small ISP programmers, from the target system. Components worth mentioningThe boardI'm using surface mounted components only, because of the smaller board size. It's not significantly harder and all you need is a moderately fine-tipped solder iron and thin solder. ![]() ![]() I was able to produce this pcb without errors in our simple pcb lab, but some care was needed. With small vias, it gets really important to align the layers... Download postscript files for bottom layer and top layer. I never fitted that USB B connector, but attached a cut-off extension cable directly (helped by the power of hot glue). If you, like me, solder your vias manually, you might have a problem with that via directly beneath the shell of the USB connector. If you whine about it I'll fix it. ![]() ![]() So this is what looked like done. It's really neat and small, with a stylish blob of hot glue. I wish I could get that camera to focus better. SoftwareFor the computer, you can use both AVR Studio and uisp. My own development tool chain consists of avr-gcc and uisp. You also need to download the drivers for the FTDI chip that will make it appear like a serial port. For the programmer, you can use the software available at the site below (bottom of page). You can also monitor this site to see if I happen to improve on it. But... you obviously need to program that first chip somehow:) You can obviously not, since it's a surface mounted chip, put it into a socket of another AVR programmer easily. If you have some kind of clamping adapter, that might be a help. But still, it wouldn't hurt to be able to reprogram the chip with new software with support for new devices or better speed, should I (or anyone else) make revisions to the source code. So this is what I did: I brought out the RESET pin of the onboard AT90S2313 to pin 3 of the ISP connector, which in the AVR 910 specification isn't connected. This means that all the pins needed to program the programmer are drawn out to the ISP connector. To program the programmer now you would only need another ISP programmer and a special cable which has the wires MOSI(pin 9)/MISO(pin 1), and RESET(pin 5)/NC(pin 3) swapped. There might very well be a problem if the target system didn't leave pin 3 not connected, but instead grounded it or something silly like that. If you're dealing with such systems you could either wack the wire on the pcb with a knife, or break that wire in your usual programming cable... Supported chipsThese are the chips I think work with this programmer:
ReferencesInfo on the original serial programmer, and software for this one. Software at the bottom of the page! ContactReach me at arfvGARBAGEidsson@mensa.se (remove "GARBAGE" from the address, don't want to get spammed:-) Feel free to mail me any questions, thoughts or improvements. I will remove this paragraph the day I think I get to many silly questions... |
||||