KitsAndParts.Com Forum

A place to exchange information about parts and kits supplied by http://kitsandparts.com

You are not logged in.

#1 2010-07-12 21:15:52

WA5BDU
Member
From: Russellville, AR
Registered: 2010-07-12
Posts: 14
Website

Appropriate programmer?

What's an appropriate programmer for the AVR chip and interface on the board?  (Appropriate ... and not too expensive, of course.) I'm running Windows.  Prefer to use my laptop (Vista) with USB ports and a USB to RS232 dongle available.  Also have an XP PC with real serial ports. 

I'm building the DDS board now.  Built another for a friend recently and it worked fine.  This one I'll try some programming on. I'm relatively new to AVR programming although I did add some code to the Butterfly DDS controller software by Steve Weber some time ago.  I gotta be retrained ...

Nick

Offline

 

#2 2010-07-12 21:35:31

w8bh
Member
From: Dayton, OH
Registered: 2010-05-24
Posts: 38

Re: Appropriate programmer?

Try the AVRISP-II programming cable, available at DigiKey [ATAVRISP2-ND] for about $35.  It has a USB connection to the PC and a 6-pin socket that mates with the ISP header on the kit.

Offline

 

#3 2010-07-14 17:46:19

W8UUU
Member
Registered: 2010-03-08
Posts: 22

Re: Appropriate programmer?

Try this one....nice price plus two programming dongles...
http://www.adafruit.com/index.php?main_ … ucts_id=46

Offline

 

#4 2010-07-14 18:18:40

WA5BDU
Member
From: Russellville, AR
Registered: 2010-07-12
Posts: 14
Website

Re: Appropriate programmer?

Not bad at $22.  I've been looking around and think I'm going to try this one (Pocket AVR programmer) from SparkFun ...

http://www.sparkfun.com/commerce/produc … ts_id=9231

unless someone tells me that's a bad idea.

Finished the board today.  I haven't installed the encoder and have no display as yet but it came up on 10 MHz OK but with output way low.  I'd managed to hook up T2 incorrectly but I was able to correct that with not too much difficulty. Now the output looks fine.

Offline

 

#5 2010-07-14 21:23:16

w8bh
Member
From: Dayton, OH
Registered: 2010-05-24
Posts: 38

Re: Appropriate programmer?

WA5BDU wrote:

Not bad at $22.  I've been looking around and think I'm going to try this one (Pocket AVR programmer) from SparkFun
http://www.sparkfun.com/commerce/produc … ts_id=9231

I love all the fun toys at SparkFun, but before I bought this one I would check two things.  First, is it out-of-the-box compatible with AVR Studio?  It looks like you'll also need AVRdude to do the programming.  Also, how easy is it to attach to the 6-pin ISP header on your DDS?  I see from their description that it comes with the 10-pin cable.  It look like to might need to buy or make another cable.

Offline

 

#6 2010-07-15 08:33:20

WA5BDU
Member
From: Russellville, AR
Registered: 2010-07-12
Posts: 14
Website

Re: Appropriate programmer?

Yeah, they also offer a two-headed cable for 6 and 10 pin programming interfaces for $1.95 that I hope will do the trick.  Pocket AVR programmer is definitely made for use with AVRdude.  I'm not sure if the IDE can talk to that directly or if I'll have to assemble the code in AVR Studio and then burn the chip in a separate application.  That would be a slight loss of convenience but not too bad.

Changing the subject a bit ... I was looking at DIZ's code in Notepad and see a number of places where I'd expect a carriage return or newline but there is none.  It looks OK in AVR Studio though.  Does the AVR editor accept TAB characters as equivalent to carriage returns?

-Nick

Offline

 

#7 2010-07-15 21:47:20

W4GNS
Member
From: Virginia
Registered: 2008-08-15
Posts: 132

Re: Appropriate programmer?

I was window shopping at Sparkfun tonight and saw these 
http://www.sparkfun.com/commerce/produc … ts_id=9962     ain't that just soooo cool !  smile     off topic I know, but cool product


w8bh wrote:

WA5BDU wrote:

Not bad at $22.  I've been looking around and think I'm going to try this one (Pocket AVR programmer) from SparkFun
http://www.sparkfun.com/commerce/produc … ts_id=9231

I love all the fun toys at SparkFun, but before I bought this one I would check two things.  First, is it out-of-the-box compatible with AVR Studio?  It looks like you'll also need AVRdude to do the programming.  Also, how easy is it to attach to the 6-pin ISP header on your DDS?  I see from their description that it comes with the 10-pin cable.  It look like to might need to buy or make another cable.

Last edited by W4GNS (2010-07-15 21:48:23)


"The secret to creativity is knowing how to hide your sources." Albert Einstein
http://releases.ubuntu.com/10.10/
Más mujeres y el tequila

Offline

 

#8 2010-07-16 21:34:41

wa2mze
Member
From: South Florida
Registered: 2009-08-22
Posts: 172

Re: Appropriate programmer?

W8UUU wrote:

Try this one....nice price plus two programming dongles...
http://www.adafruit.com/index.php?main_ … ucts_id=46

I have this one and it works OK.  Adafruit also has the instructions to make it work with AVRstudio (but I'm using it with avrdude on Linux).

Offline

 

#9 2010-07-17 23:11:23

Drone
New member
Registered: 2010-01-21
Posts: 3

Re: Appropriate programmer?

Hi Nick,

IMO Don't waste your time and money with "hobby" AVR programmers. Buy an ATMEL AVR Dragon in-system/stand-alone programmer/debugger instead. It is only $49 and will do anything you need now or in the future. Here's more on this...

Unlike many of the cheap third party programmers mentioned, the dragon has all programming modes, ISP, HVSP, and JTAG. In addition, you can use the dragon as both an in-circuit and stand-alone programmer. The dragon supports in-circuit debugging (even JTAG) and is 100% compatible with AVR Studio in all respects (it is after-all an ATMEL product) as well as WinAVR (which normally works in the background through AVR Studio, but can stand-alone too). The interfaces on the AVR dragon are auto-voltage adapting as well.

For the likes of the ATtiny an ATMega series of target micro-controllers, it is very important (IMO) to have HVSP in addition to ISP programming capability. HVSP is required to program (and un-program) some key fuse bits in the micro-controller. Very few if any of the cheap programmers support HVSP and if they do, the price of the programmer will likely wind up being close to the price of the Dragon anyway.

The AVR dragon used to be limited to parts through 32kB of memory for debug support. As everyone suspected that was a "marketing" limit. Awhile back ATMEL got smart and removed this limit in the Dragon. When you plug your Dragon in and point an up-to-date version AVR Studio at it, the dragon's firmware will be automatically updated (if you let it). Fairly recent versions of AVR Studio (4.1.x or later if memory serves) have the latest unlocked Dragon firmware as part of the distribution.

The AVR Dragon when first released got a bad reputation for being fragile. It seems the auto-voltage-adapting interfaces were prone to failure if mishandled. This reputation has hung on. But in reality, only the very first dragons released from manufacturing were like this. For years now all dragons shipped are quite robust - so the reputation is undeserved.

One thing you need to understand about the dragon is that you will need some 0.1 inch headers and some jumpers to configure it. These don't come with the dragon, so study the dragon documentation carefully on the ATMEL Web site and understand what to order with your dragon. The female jumper wires can be obtained from many sites like Sparkfun and SeeedStudio.com. Look at Sparkfun part number PRT-08430 for an example of the jumpers (SeedStudio.com P/N CAB102C4O is a better deal by far). One alternative to the female jumpers is wire-wrap wire. Another alternative to the female jumpers is to install 0.1 inch sockets (use machine pin sockets with round sockets only) instead of headers and then just use standard solid hook-up wire for the jumpers. If you want to program micros plugged into the dragon you will need to buy two DIP sockets to solder on the board. Some just use one 40-pin ZIF socket, but I've found using two machine pin sockets to be just fine. Plus, if I ever want to use a ZIF socket I can just plug it into the 40-pin machine pin socket anyway. Finally, you will need a six pin and/or  ten pin programming cable with headers, all programmers need this for in system programming. Some come with them, some don't; the dragon doesn't. Look at Sparkfun part numbers DEV-09215 and DEV-09046 for example.

Buy your Dragon from Mouser (P/N 556-ATAVRDRAGON) or Digi-Key (P/N ATAVRDRAGON-ND). They sell lots of dragons, so you are sure to get a late hardware revision number. You might find the Dragon for a couple of dollars less than $49 elsewhere, don't bother.

Best 73's, David WB4ONA

* AVR Dragon homepage at ATMEL:

http://www.atmel.com/dyn/products/tools … ol_id=3891

Same link here:

http://bit.ly/aTFrpC

* AVR Dragon documentation and configuration site:

http://support.atmel.no/knowledgebase/a … Dragon.htm

Same link here:

http://bit.ly/aQFXLQ

Offline

 

#10 2010-07-18 08:28:24

ak2b
Administrator
From: New York City
Registered: 2008-08-12
Posts: 355

Re: Appropriate programmer?

Hi David,
Thanks for the Dragon info. I've never done JTAG debugging. Do you know if the Dragon is up to this. I've thought about the JTAG ICE MKII  but that's very expensive for someone like me (who knows very little) to try out. The Dragon looks perfect for that type of experimenting.
Tom, ak2b

Offline

 

#11 2010-07-18 11:11:55

wa2mze
Member
From: South Florida
Registered: 2009-08-22
Posts: 172

Re: Appropriate programmer?

A bit of warning on the Dragon.  It is a bare, naked PC board only.  You must buy or make up the required 10 or 6 wire cables with connectors on the ends.  You also need to buy a USB cable.  Buy yourself a plastic project box to house the Dragon.  Do NOT operate the Dragon while it is sitting naked on the work bench.  If you touch the wrong spot on the Dragon PC board while it is powered up you can destroy it!  The conductance of your sweaty fingers is enough to blow up one of the voltage regulators on the board.  There have been many on the AVR Freaks forums that have had this happen!  Putting the Dragon in a box is cheap insurance!  Also the circuit with micro being programmed must be powered separate from the Dragon.  Do NOT try and power the micro circuit by the 5v from the Dragon.  You can, however, mount a 40 pin ziff socket on the Dragon and use jumper wires (you supply the connectors to solder to the Dragon) and use the Dragon as a programmer for bare, naked chips.

The Dragon isn't a bad programmer, it's just that it is cheap (inexpensive) and has no frills.  It DOES JTAG, debug-wire, ISP/SPI, and PDI for a few of the smaller xmega parts.  It also does HV serial and parallel so it can bring back parts from the dead that have had their fuses scrambled, something the jtagMKII won't do.

BTW check with Arrow and see if they have any of their jtagmkII specials left.  They were selling these at $150 or half the normal price.

Last edited by wa2mze (2010-07-18 11:15:46)

Offline

 

#12 2010-07-18 12:37:13

ak2b
Administrator
From: New York City
Registered: 2008-08-12
Posts: 355

Re: Appropriate programmer?

wa2mze wrote:

BTW check with Arrow and see if they have any of their jtagmkII specials left.  They were selling these at $150 or half the normal price.

If the Dragon is only $49 and will do the job of the JTAGMKII I figure I can blow up three of them before I reach the bargain price of $150. smile. The other logistics stuff about the Dragon doesn't bother me. I have plenty of hardware and may even have all the cables. I'm mainly concerned with in circuit debugging and like I said, since I've never done it before, the Dragon seems to be a cheap way to try it.

Tom, ak2b

Offline

 

#13 2010-07-18 14:45:20

wa2mze
Member
From: South Florida
Registered: 2009-08-22
Posts: 172

Re: Appropriate programmer?

ak2b wrote:

wa2mze wrote:

BTW check with Arrow and see if they have any of their jtagmkII specials left.  They were selling these at $150 or half the normal price.

If the Dragon is only $49 and will do the job of the JTAGMKII I figure I can blow up three of them before I reach the bargain price of $150. smile. The other logistics stuff about the Dragon doesn't bother me. I have plenty of hardware and may even have all the cables. I'm mainly concerned with in circuit debugging and like I said, since I've never done it before, the Dragon seems to be a cheap way to try it.

Tom, ak2b

The atmega 88, 168, and 328 can ONLY be debugged using the debug wire interface.  Since it handles breakpoints by rewriting flash everytime you stop the processor at a breakpoint, the flash will wear out eventually.  The atmega16, and other micros in 40pin or larger packages support the JTAG interface which gives you true breakpoint ability.  The debug wire is sorta like the ISD debugger on small PIC's.  Debugwire connects to the processors reset pin (you must remove the capacitor to ground), the JTAG uses dedicated pins for the JTAG interface.  The JTAG interface lets you examine and modify cpu registers, IO registers, EEPROM and SRAM locations.  I'm not sure if debug wire supports all of that.  If you want to experiment with in circuit debugging, I'd recommend getting a development board based on the ATmega32 or similar 40/44 pin device.

Offline

 

#14 2010-07-19 19:04:05

WA5BDU
Member
From: Russellville, AR
Registered: 2010-07-12
Posts: 14
Website

Re: Appropriate programmer?

OK, I got the SparkFun programmer and since it wasn't instant success, I naturally have some questions ...

Installed AVRDude and the driver and things looked good.  Also, it turns out that the version shipped has a cable with both 6 and 10 pin connectors, so I didn't need that extra cable.

I ran into an issue in that the connector wouldn't fit.  Unfortunately, I didn't realize that at first and plugged in the thing offset by one pin (my vision isn't the greatest).  I wound up adding another header connected to the installed one with wire-wrap wiring so now I can plug it in.

At this point I'm getting errors saying "initialization failed" which means it can't talk to the AVR chip.  It's possible that I damaged the programmer with my initial incorrect connection, but I doubt it.

My question at this point is on powering the DDS board.  I'm pretty sure the USB power can't or shouldn't supply that much power.  So do I just power up the board normally and select "no power to target" on the programmer?  Or do I need to open the Vcc jumper between the AVR side and DDS sides of the board and let the programmer power the AVR side?

Can / does the programmer interrupt the AVR while it's running and put it into the program mode?

Thanks for the info on the Dragon, but I'm already down this road and hope I can make it work.

Nick

Offline

 

#15 2010-07-19 21:16:25

WA5BDU
Member
From: Russellville, AR
Registered: 2010-07-12
Posts: 14
Website

Re: Appropriate programmer?

OK, before anyone spends to much time figuring out my problem, here's an update ...

I did some continuity checks from board to board and the RST line wasn't making it.  Looks like the connector on the cable wasn't piercing the ribbon cable conductor's insulation dead center or something.  Anyway, I mashed on it a little and got continuity.

Then I ran another test with AVRDude and this time it connected and read the chip.  I didn't want to risk messing up my functional AVR chip's program right off the bat so I told it to read the flash data into a hex file.  It seems to have done so, although anyone's guess is as good as mine as to where it put the file.

So I think I'm off and running ...

Nick

Offline

 

#16 2010-07-24 14:32:58

W4GNS
Member
From: Virginia
Registered: 2008-08-15
Posts: 132

Re: Appropriate programmer?

I have not fought with Linux in a few months, but I'm somewhat certain you should be able to do a file search, as I know can be done in Windows to find the file, but I'm also 99% certain you knew that anyway smile


WA5BDU wrote:

It seems to have done so, although anyone's guess is as good as mine as to where it put the file.

So I think I'm off and running ...

Nick


"The secret to creativity is knowing how to hide your sources." Albert Einstein
http://releases.ubuntu.com/10.10/
Más mujeres y el tequila

Offline

 

#17 2010-07-25 08:09:37

WA5BDU
Member
From: Russellville, AR
Registered: 2010-07-12
Posts: 14
Website

Re: Appropriate programmer?

Actually, I'm still using Windows.  I was just premature when I said I thought AVRDude had written the hex file.  It was still upset over the chip ID being that for the ATmega88P instead of ATmega88.  After I did the over-ride, the file did turn up in the AVRDude directory.

Nick

Offline

 

Board footer

Powered by FluxBB