Author Topic: Hobbyist AVR Programmer  (Read 11362 times)

0 Members and 1 Guest are viewing this topic.

Offline kolbepTopic starter

  • Frequent Contributor
  • **
  • Posts: 598
  • Country: za
    • ShoutingElectronics.com
Hobbyist AVR Programmer
« on: May 24, 2016, 08:59:23 pm »
Hi All,
Just wondering what you would recommend for an AVR Programmer (Searching the Forums gives a thread from a few years back (things might have changed since then).

I have mainly played around with PIC Micros, using the Paralell Port to Program them (in the 16f87 days) then Pickit 2 and Pickit 3.

Lately I have been playing around with Arduinos and AVR's.

What I like to do is get something working on an Uno, then take a Micro (eg Atmega), stick it on a breadboard or custom board / veroboard, and program it with the same code.
To Program it, I would load the Arduino as an ISP code onto the Uno, then put the capacitor on Reset, jumper the Uno across to the board.
Then once I get past the programming settings (Baud Rate...) using AVRdude, it seems to work.

But it is a very clumsy way to do it.
What I want is something similar to the Pickit2/3, that can program the chip, and possibly debug.
I see the very cheap (2usd) programmers on Ebay, that have 1 micro and a few other passives. Are those any good.

One thing that has lead me to this is that I have programmed an ATMEGA8515 with a program.
Later I decided to stick another program on it. But I get verify errors.
Then I try the AVRdude -e, and the Avrdude terminal erase.
It then says ok, I then quit, and it gives me a question, the fuse bits have changed. Ignore or Restore
If I restore the fuse bits, Avrdude just hangs
If I Ignore, then I see that the 8515 just continues running the old program (despite it supposedly loading the new program, or erasing)
Any Idea on this one

Appreciate it
P
====================================
www.ShoutingElectronics.com Don't just talk about Electronics, SHOUT ABOUT IT! Electronics Blog Site and Youtube Channel
 

Offline Gyro

  • Super Contributor
  • ***
  • Posts: 9480
  • Country: gb
Re: Hobbyist AVR Programmer
« Reply #1 on: May 24, 2016, 09:17:44 pm »
The ebay USBasp programmers seem to work fine (well mine does anyway).

I've found that Sinaprog is a nice windows front-end for AVRdude. I think the latest version on the web is 2.1
Best Regards, Chris
 
The following users thanked this post: elecdonia

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: de
Re: Hobbyist AVR Programmer
« Reply #2 on: May 24, 2016, 09:29:17 pm »
USBasp works, but has issues with programming AVRs with more than 32kB of memory, if I recall right. I am not sure whether that was fixed in a later firmware version, but the cheap eBay clones usually have an ancient version. It may not matter for programming an Uno, but if you want to work with Mega256 you won't be able to program it. Also many USBasp clones will not work with anything else but 5V targets.

A better solution is AVR Dragon or AVR-ISP. Dragon does also the high voltage programming which is often the only way to "unbrick" a chip where you have screwed up the fuse settings and ISP doesn't work anymore. If you don't want to bother with babysitting Dragon (it is famously fragile due to some design issues), get Atmel-ICE and you have a full programming and also debug solution for all Atmel MCUs.

 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Hobbyist AVR Programmer
« Reply #3 on: May 24, 2016, 09:41:21 pm »
my vote to usbasp as well. I use avrdudess as the front end. works like a charm.

Have a dragon but haven't used it a long time. and a stk II somewhere too.
================================
https://dannyelectronics.wordpress.com/
 

Offline alank2

  • Super Contributor
  • ***
  • Posts: 2185
Re: Hobbyist AVR Programmer
« Reply #4 on: May 24, 2016, 10:00:45 pm »
If you are looking for a standalone programmer for ISP/PDI, I developed one that, once programmed, doesn't need a PC.  It can handle multiple firmware in one configuration as well.

http://www.ebay.com/itm/AVR-Automatic-Programmer-ISP-PDI-Independent-Standalone-for-Atmel-64KB-EEPROM-/291759576356?ssPageName=STRK:MESE:IT

http://home.earthlink.net/~alank2/autoprog_manual.pdf

http://home.earthlink.net/~alank2/autoprog_pcapplication.zip

Thanks,

Alan
 

Offline Mastrofski

  • Contributor
  • Posts: 16
  • Country: us
Re: Hobbyist AVR Programmer
« Reply #5 on: May 24, 2016, 10:21:57 pm »
The Atmel ICE is typically what I use for that. Granted I use Atmel Studio to program the thing, but it will do all of the AVR architecture stuff as well as their SAM line. I don't believe it will debug the AVR stuff(at least I haven't found a way), but it will debug the SAM chips. I've found that it works great for the stuff that I'm working with, you just need to have access to the SPI lines in order to program the thing.
 

Offline rx8pilot

  • Super Contributor
  • ***
  • Posts: 3634
  • Country: us
  • If you want more money, be more valuable.
Re: Hobbyist AVR Programmer
« Reply #6 on: May 24, 2016, 10:29:52 pm »
If you are looking for a standalone programmer for ISP/PDI, I developed one that, once programmed, doesn't need a PC.  It can handle multiple firmware in one configuration as well.

http://www.ebay.com/itm/AVR-Automatic-Programmer-ISP-PDI-Independent-Standalone-for-Atmel-64KB-EEPROM-/291759576356?ssPageName=STRK:MESE:IT

http://home.earthlink.net/~alank2/autoprog_manual.pdf

http://home.earthlink.net/~alank2/autoprog_pcapplication.zip

Thanks,

Alan

That thing looks fantastic. Is it your design/software?
Factory400 - the worlds smallest factory. https://www.youtube.com/c/Factory400
 

Offline alank2

  • Super Contributor
  • ***
  • Posts: 2185
Re: Hobbyist AVR Programmer
« Reply #7 on: May 24, 2016, 10:33:42 pm »
That thing looks fantastic. Is it your design/software?

Thank you, yes.  I've been an AVRfreak for a long time!  This was designed for someone else and it turned out so much better than I even expected.  If you have any questions, shoot!
 
The following users thanked this post: rx8pilot

Offline Macbeth

  • Super Contributor
  • ***
  • Posts: 2571
  • Country: gb
Re: Hobbyist AVR Programmer
« Reply #8 on: May 24, 2016, 11:12:55 pm »
Atmel STK200 with parallel port dongle, USBasp, and TL866CS converted to TL866A here. Oh and of course the Arduino STK500 emulator.

USBasp and avrdude is what I use if at hand, but my desk is a tip and so I use whatever is closest. Also the parallel programming of the TL866 is useful to unbrick a bad fuse job.

I've never tried in circuit debugging stuff though.
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11622
  • Country: my
  • reassessing directives...
Re: Hobbyist AVR Programmer
« Reply #9 on: May 24, 2016, 11:34:21 pm »
If you have any questions, shoot!
dont use the word as someone around here will find it weird and dangerous advice... ::)
« Last Edit: May 24, 2016, 11:36:31 pm by Mechatrommer »
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: Hobbyist AVR Programmer
« Reply #10 on: May 24, 2016, 11:35:00 pm »
How much are you willing to spend?
Arduino Nano clones are cheap enough that you can put the ArduinoISP sketch in one, disable RESET permanently, and use it as your programmer.  About $3, including the extra wires.  No debugging, though.

At about the same price are the Chinese USBASP clones, but they're less capable overall...

At about $10 (alas, not including shipping) you can get a genuine Atmel ATmega328p (or ATmega328pb) Xplained Mini eval board.  This is more-or-less arduino compatible, but has an on-board mEDBG chip, so it can be use the the Atmel Studio debugger.  I *think* you can use it for programming other AVRs as well.  But it's a real bargain for something that does debugging.

At about $50 you can get things like the "Atmel ICE", an official Atmel debug tool that supports most of the possible AVR programming methods (SPI, TPI, PDI, and JTAG; still no HV protocols, though.)  It will also program/debug Atmel ARM chips.  (Atmel ICE is the most recent version.  Atmel JTAGICE3 is also pretty good and has been showing up cheap.)
 

Offline rx8pilot

  • Super Contributor
  • ***
  • Posts: 3634
  • Country: us
  • If you want more money, be more valuable.
Re: Hobbyist AVR Programmer
« Reply #11 on: May 25, 2016, 01:40:18 am »
I also use the Atmel ICE (genuine) for prototyping and production. For development, it's used with Atmel Studio where it is obviously well supported and never have any issues. It replaced my Atmel AVRISP which died one day.

For production programming, I use AVRdudess which is a GUI for AVRdude. It took a bit to understand that AVRdude communicates differently and I have to configure some USB filters. Minor challenge - it now works just fine (most of the time). Sometimes it freaks out and stops responding for reasons I do not understand.

I really look forward to @alank2 stand-alone solution. I need 2 of them, which I will machine a case for to send to my customers to update their systems. I have high hopes for those gems.

For hobby use, It may not be helpful, but I use the Tag-Connect cables and love them for production and proto work.
Factory400 - the worlds smallest factory. https://www.youtube.com/c/Factory400
 

Offline alank2

  • Super Contributor
  • ***
  • Posts: 2185
Re: Hobbyist AVR Programmer
« Reply #12 on: May 25, 2016, 01:43:07 am »
I received an order for two of them tonight, but it was from a customer who ordered from me before - this isn't you rx8pilot, right?  If you need some you can contact me via PM and we can avoid eBay.  I can put the right angle female connector if you want to direct plug them, or a male shrouded connector for use with a ribbon cable if you prefer that.
 

Offline rx8pilot

  • Super Contributor
  • ***
  • Posts: 3634
  • Country: us
  • If you want more money, be more valuable.
Re: Hobbyist AVR Programmer
« Reply #13 on: May 25, 2016, 01:54:35 am »
I will PM you as soon as my wife (Chief Financial Officer), authorizes my purchase order for 2 of the 256K versions. The regular 6-pin should be fine I think.
Factory400 - the worlds smallest factory. https://www.youtube.com/c/Factory400
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11622
  • Country: my
  • reassessing directives...
Re: Hobbyist AVR Programmer
« Reply #14 on: May 25, 2016, 02:22:19 am »
If you are looking for a standalone programmer for ISP/PDI, I developed one that, once programmed, doesn't need a PC.  It can handle multiple firmware in one configuration as well.
nice idea.. can you work on high voltage avr programming? so we can use reset pin as general purpose IO... if you can, i will look forward to it if the price is right...
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline alank2

  • Super Contributor
  • ***
  • Posts: 2185
Re: Hobbyist AVR Programmer
« Reply #15 on: May 25, 2016, 02:32:45 am »
nice idea.. can you work on high voltage avr programming? so we can use reset pin as general purpose IO... if you can, i will look forward to it if the price is right...

Thank you - I have to drag out my old dragon or stk500 for HV!!  Sadly, it doesn't do HV.

The initial version did ISP and an update added PDI, so it can do ISP and PDI now.

It was originally designed for customers to update firmware without any user intelligence.  You can load multiple firmwares on it and it can detect which AVR is it connected to and load the correct one all automatically.  I use it all the time for programming my projects - I have a single one programmed with 4 firmware images.  it also has the ability to embed a serial number in the flash area as well that will auto-increment each time you program it.  I often find it is easier to program it and take it to what I want to program than to haul my notebook.  Take a look at the manual if you get a minute.
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11622
  • Country: my
  • reassessing directives...
Re: Hobbyist AVR Programmer
« Reply #16 on: May 25, 2016, 02:44:06 am »
that are good for production purpose, its a great bonus to be standaloness... incremental SN is also great idea, i exactly thought about the need few days ago, but as i am mainly hobby, the my non automated PC based AVRISP MK2 clone still can do the work, my production is very little in order of 1 or 2 pieces only :P, so manual flash write is still feasible... what i really crave is the need to use reset pin as general IO, which my programmer is crippled at doing... the existing HV programmer is expensive, so i'll live with what i already have and only.
« Last Edit: May 25, 2016, 02:46:12 am by Mechatrommer »
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline kolbepTopic starter

  • Frequent Contributor
  • **
  • Posts: 598
  • Country: za
    • ShoutingElectronics.com
Re: Hobbyist AVR Programmer
« Reply #17 on: May 25, 2016, 04:31:00 am »
Thanks All.
Lots of ones to consider now.
Appreciate it.
====================================
www.ShoutingElectronics.com Don't just talk about Electronics, SHOUT ABOUT IT! Electronics Blog Site and Youtube Channel
 

Offline Brutte

  • Frequent Contributor
  • **
  • Posts: 614
Re: Hobbyist AVR Programmer
« Reply #18 on: May 25, 2016, 06:17:14 am »
Quote
What I want is something similar to the Pickit2/3, that can program the chip, and possibly debug.
Why don't you program AVR8 with PICKit2?
AVRDude supports USBasp and PICKit2 equally well, cannot see why one is preferred over other.

As for debugging AVR8 - all Atmel AVR8 debugging protocols are proprietary == expensive debuggers with closed source drivers.
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: de
Re: Hobbyist AVR Programmer
« Reply #19 on: May 25, 2016, 06:53:57 pm »
As for debugging AVR8 - all Atmel AVR8 debugging protocols are proprietary == expensive debuggers with closed source drivers.

Debuggers are not *that* expensive. E.g. AVR Dragon can be used to debug almost anything and works fine with Avarice (http://avarice.sourceforge.net/)/

The new Atmel ICE is around 80EUR, that is not expensive, considering what it does. The older JTAGICE 2/3 works with Avarice too, but it is not made anymore.

However, if the OP is working in Windows, then whether or not something has proprietary drivers likely doesn't matter for them.

 

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1611
  • Country: gb
Re: Hobbyist AVR Programmer
« Reply #20 on: May 25, 2016, 10:02:23 pm »
I don't think I've programmed an AVR in a few years, mostly because I put bootloaders in all the devices I used for testing, and flashing was done for production.  But I have a USBasp with firmware to emulate an AVR ISP MKII that works directly with AVRstudio.  I don't see how that is any better - just as easy to use USBasp, but my point is, there are many *many* resources for making your own, especially since arduino pushed the ATmega88/168/328 higher in popularity.
 

Offline richardman

  • Frequent Contributor
  • **
  • Posts: 427
  • Country: us
Re: Hobbyist AVR Programmer
« Reply #21 on: May 25, 2016, 10:52:13 pm »
I would recommend an AVR Dragon. While it's many years old, it does support debugging and pretty cheap. Not $3 or $10 cheap, but still cheap. That debugging capability will come in handy eventually.
// richard http://imagecraft.com/
JumpStart C++ for Cortex (compiler/IDE/debugger): the fastest easiest way to get productive on Cortex-M.
Smart.IO: phone App for embedded systems with no app or wireless coding
 

Offline rx8pilot

  • Super Contributor
  • ***
  • Posts: 3634
  • Country: us
  • If you want more money, be more valuable.
Re: Hobbyist AVR Programmer
« Reply #22 on: May 25, 2016, 10:56:45 pm »
I thought the AtmelICE supports debug, could be wrong. Is that only for the family's above AVR?
Factory400 - the worlds smallest factory. https://www.youtube.com/c/Factory400
 

Offline richardman

  • Frequent Contributor
  • **
  • Posts: 427
  • Country: us
Re: Hobbyist AVR Programmer
« Reply #23 on: May 25, 2016, 11:31:38 pm »
Atmel-ICE does support debugging, but I think the Dragon may still be cheaper? Anyway. the recommendation would be "the lowest cost pod that also supports debugging" is worth the extra $
// richard http://imagecraft.com/
JumpStart C++ for Cortex (compiler/IDE/debugger): the fastest easiest way to get productive on Cortex-M.
Smart.IO: phone App for embedded systems with no app or wireless coding
 

Offline alank2

  • Super Contributor
  • ***
  • Posts: 2185
Re: Hobbyist AVR Programmer
« Reply #24 on: May 26, 2016, 12:30:45 am »
The debugging has worked pretty well for me with the atmelice.  There are *3* versions you can buy from $35 to $108 depending on how complete you want it.  I made an adapter to convert its silly 50mil headers to standard 100mil ones:

http://www.digikey.com/product-search/en/programmers-development-systems/in-circuit-programmers-emulators-and-debuggers/2621880?k=atmelice

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf