1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

What is a good AVR programmer with debug & HV programming?

Discussion in 'AVR' started by blueroomelectronics, Mar 8, 2008.

  1. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    About the only inexpensive AVR programmer with debug is the AVR Dragon, I've got an AVR ATmega168 project put in my lap and although I have access to a JTAG ICE MK2 I would like to have access to one on the cheap.
    My 2 cents, I've managed to avoid using the AVR microcontrollers till now, and now that's I've been using the ATmega168 it's not so bad but I find the the tools confusing, ie High Voltage programming, JTAG, ICP, Debugging. Aside from the $350 JTAG ICE (it's not a true ICD it's a debugger, but then so is the Microchip Real ICD)

    Sadly a PIC would have been a better match for the project. (battery voltage detect & dual comparator with a programmable DAC)
     
  2. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    Go for the Dragon. It's very good. Does everything the PICkit2/Junebug does and then some. Aside from a few differences in terminology, and much simpler, clearer AVR architecture and asm code (comparing with 16F's), AVRs and PICs are much alike. You'll pick it up easily.
     
  3. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    Is the Dragon a HV programmer?
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.

    Yes. And can program/debug in every available mode there is for AVRs. It's an amazing tool for the price. AVR Studio is pretty comparable to MPLAB, and is free.
     
  6. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    I'll order a Dragon then, thanks Futz.
     
  7. HarveyH42

    HarveyH42 Banned

    Joined:
    Feb 25, 2006
    Messages:
    3,442
    Likes:
    18
    Location:
    Not Here
    The Dragon is the only programmer I've ever owned/used, so nothing to compare with. For a complete beginner, it wasn't a huge hassle to figure out how to use. USB and $50, it's a good solid purchase. Yet to have a failure or glitch, been using it for over a year.

    Few things you should know...
    The Dragon comes stripped to a minimal, but usable out of the box. If you have cables and jumpers, which aren't included. No documentation included, you need to download AVR Studio from Atmel (free). I loaded the board, added some headers and a ZIF socket. Had to build my own cables and jumpers. There are a couple of threads about the Dragon here, one has a link to an online store with some nice jumpers, which from personal experience with tiny header pin sockets... is a good deal. There is something to do with a 32k limit, but I believe its only for the debug wire.

    I've only used HV and ISP, only 5 different devices, but hasn't failed or destroyed any chips.
     
  8. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    The debug mode on the PICs loads a small program in upper memory and reprograms the target chip with your code.

    I'm using the clients tools (Studio 4 & ED an editor) does the debug mode on AVR automatically load new code when the debug is run (ED does not appear to integrate with Studio so it runs the build on its own)? Is the Studio editor any good? Is BASCOM any good, is GCC any good?
     
  9. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    AVR Studio's editor is fine. I played with BASCOM a bit. Seems like a decent BASIC. GCC has always been very good, tho a bit cryptic (the PIC's ASM30 and the linker is GCC - probably C30 is too - I'm not sure about that).
    EDIT: Yup, C30 and its entire toolchain is GCC. Nice free software from the Linux world.

    I never played with the debugger when I was programming AVRs, but I'd bet they work in very similar ways to what you're used to.
     
    Last edited: Mar 10, 2008
  10. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
  11. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    Hey Bill! If you're doing AVRs, be very very careful of how you set the fusebits (and don't touch lockbits unless you really need to). Read the datasheet and be SURE you know what you're doing before changing them. Change one wrong and often you might as well chuck the chip. There are ways to rewrite them, but sometimes it's just not worth it.

    Today I was playing with my Staver and foolishly played with fusebits without carefully considering what I was doing. I hadn't touched an AVR in a long time and kinda forgot how bad it can be if you do it wrong. Bingo! Instant unprogrammable Staver! :D With it being on that DIP board it's almost impossible to save. I may yet fix it by wiring it up for HV programming, but for now it's junk.
     
    Last edited: Mar 9, 2008
  12. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    Won't an HV programmer be able to erase them? I assume the Dragon is HV.
     
  13. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    Yes, but I'd have to build a custom cable to do it. I'll tackle that another day (month... year... :D ) HV needs different (more) connections than ISP, and wants to power the target itself.

    I also remembered today why I never debugged an AVR before. It was because JTAG was expensive before the Dragon came along. AVRs debug with JTAG, not via the ISP cable. But you can program via the JTAG connection, so you still only need one cable connected.
     
    Last edited: Mar 9, 2008
  14. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    Ahh that help, so the HV programming needs the 10 pin cable.
    Does the debug bit have to be set in HV mode?
     
  15. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    Just in case you're thinking what I think you may be thinking (are you pondering what I'm pondering?)... JTAG is not HV. The Dragon has a 20-pin connector for HVSP (High Voltage Serial Programming) and also uses the same connector for HVPP (High Voltage Parallel Programming). It has that many pins so that connector can be used for HVPP as well. HVSP uses 7 pins of those 20.

    What I'll end up doing is pulling the DIP board and putting it in a breadboard, then wiring HV to there however I can. I considered desoldering the chip and putting a new one on, but that's just about impossible without the right tools.

    EDIT: Just ran across this over at avrfreaks
    It has to be set to debug in JTAG. And you obviously can't set or clear that bit from a JTAG connection cuz the software doesn't allow you to saw off the branch you're sitting on. :D You gotta use ISP or other method to set it.
     
    Last edited: Mar 9, 2008
  16. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    • Like Like x 1
  17. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    Thanks Atom, but though I did a stupid thing today, I'm beyond that basic of a tutorial. Been dere, done dat. :D
     
  18. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    LOL i assumed that but bored and cant seem to sleep so need to type (not to self) lol
     
  19. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    I thought it was handy.
     
  20. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    Oh, this just gets better and better. :p Atmega32 doesn't support HVSP. I have to connect all 20 pins and use HVPP. HVSP is only supported on the small chips.

    And even better yet :( the Staver only brings out Ports A and D, so this thing cannot be saved with HVPP. The only cure is to either desolder and replace the chip or buy a new Staver module (Yeah right! :p Like that's gonna happen! :p Crazy Swedes want around $60 for the module (insane! :D), plus shipping from Sweden.).
     
    Last edited: Mar 9, 2008
  21. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    I hadn't been to Ecros' site in a while. They have some new products. The Dragon Rider 500 looks pretty good. Only about $30. Nice add-on for a Dragon programmer.

    I'm gonna get me one of those Butterfly carrier boards. Makes it so much easier to expand/experiment with. Only $20.
     
    Last edited: Mar 12, 2008

Share This Page