Sunday, October 28, 2012

Getting Started with AVR

About a year ago, I placed an order for a few extra PICs and at the same time ordered a couple ATMEGA328-PU micros at the same time.  I had only started to read about the AVR and this one looked like the perfect starting point. At that time, in the past, all of the Arduino boards were way too pricey for my cheap skate PIC background, but the simplicity of creating an AVR programmer drew me in.  

Now, it is worth saying that the two ATMEGAs that I purchased would have gone unused for a long time, possibly forever, if not for a bit of luck.  I had placed an order for some PCBs at ITEAD Studio and selected the "*Open Source And Get 2 More Additional Boards" option.  One of the extra boards they sent me was my own and the other was a Uno clone from JMN Electronics
In true good form, Joan placed her email address on the silkscreen.  Using that, I was able to contact her and get a BOM (had I a bit more experience with the Uno, I could have figured it out).  Since, the Uno uses such common parts, I had everything laying around to populate the board (including my aging inventory of 328's).

Now starts my frustration.  Of course I had the AVRs and a board, but I did not have a way to program the boot loader on them.  If you are like me, you are not too aware of your options and it is time to get Ghetto.  Thanks to Google and AVRProgrammer.com, I was able to whip together a FrankenProg (combine with AVRdude and you have something workable).  Yes, that giant hunk of glue is my concept of a strain relief and I have no intention of showing the nightmare that is the underside of the proto board.  I have to say that it worked perfectly and I was able to complete my clone Uno, but I am really dissatisfied with something like the above.  Maybe 10 years ago it was fine, but there is no support for OS's after XP and certainly not X64.  When I was reasearching programmers, I also came across the USBASP and it turns out they can be purchased on Ebay for less than $5.

As excessive reading would have it, I found that the USBasp by Lcsoft was upgradeable and works with Windows 8 x64. Ding!
The reasons I like this particular one are:
  • Inexpensive not cheap
  • Firmware is upgradeable via placing a second USBasp back to back and shorting JP2 on the unit to be upgraded
  • Two of them are $7 shipped to your door
  • JP3 is still available for slow programming (when you brick your chip)
  • 3.3V and 5V supply voltages
  • It is USB and is supported by AVRdude
  • The Arduino software can use it to burn a bootloader


In short, don't waste your time trying to build a programmer.  If you are coming from the PIC world, we could always build something cheaper than we could buy it (thank you high voltage programming).

No comments:

Post a Comment