| Author |
Message |
|
|
Posted: Jan 02, 2007 - 09:18 PM |
|

Joined: Dec 25, 2006
Posts: 3
|
|
Thanks Dean, but I seem to be getting more and more confused with all the new softwares I have to learn how to use. Allow me to describe my current situation. I have installed AVR Studio 4 and WinAVR, and have made a dongle. You explained that AVRdude comes with WinAVR. Does this mean that I don't have to download and install AVRdude? With all my current hardwares and softwares, is it possible for me to program a chip? If so, is there any tutorial on how to go from AVR Studio to a working chip? I have been looking at sample codes in both AVR GCC and ASM, however I have only ran those codes with the simulator in the studio thusfar.
Please excuse me if these questions sound basic or can easily be answered on google or have already been covered somewhere else. I am simply running out of time. Any help is greatly appreciated.
A Real Amatuer,
Ken |
|
|
| |
|
|
|
|
|
Posted: Jan 03, 2007 - 12:16 AM |
|


Joined: Jan 23, 2004
Posts: 9888
Location: Trondheim, Norway
|
|
AVRDude is a command-line programming software. Unlike AVRStudio, it supports simple "dumb" (i.e. passive components only) dongles just fine.
AVRDude is included with WinAVR - you don't need to download anything else. To use it from the command line, just open up a new command console from the start menu (START->Run, type "cmd" with no quotes and press enter). Type "avrdude" and press enter to give a list of all the possible command line options.
For the AVRDude manual, check your C:\WinAVR\doc\avrdude\ directory. That will teach you how to configure the command line options for your dongle. Once all done, you can always create a batch file to automate the process.
EDIT: Someone's just made a new GUI for AVRDude to make your life a lot easier. I haven't tried it myself, but check it out yourself.
- Dean  |
_________________ Atmel Studio 6.1 is now released, grab it here.
Report AS6/ASF bugs here.
|
| |
|
|
|
|
|
Posted: Jan 03, 2007 - 10:58 PM |
|

Joined: Dec 25, 2006
Posts: 3
|
|
Thank you very much, Dean. This has definitely been a productive Christmas break. I feel I am one step closer to have a working AVR everyday. Now that I am somewhat familiar with AVR Studio and AVRdude, all what's left is to read about WinAVR, and then to actually get some hands-on experiences when I get back to Skule. Thank you again for all your help.
Dream of one day when I can help others,
Ken |
|
|
| |
|
|
|
|
|
Posted: Jan 07, 2007 - 10:07 PM |
|

Joined: Dec 08, 2006
Posts: 47
Location: Slovakia
|
|
Thanks for the description of really necesary basics.
Please, could You tell a simple word how to start programming with AVRStudio?
I have AVRDragon and can use it to programm device only by running comandline tool AVRDragon.exe.
To explain how one could start, I can write an C or ASM program, set make output to Intel HEX, and then use external programer to transfer generated data to device.
I have had simple parallel port isp programmer, it works well as ISP with Ponyprog. I consider it easy to use, comfortable and intuitive tool to program any ordinary avr device, its fuses and lock bits or eeprom. In case I need some troubleshooting, I see the data and in case i wish I can enable editing and change some values directly in it.
I can use commandline AVRDude, telling it that my LPT programmer is pony-STK200, I have tested it and it works.
Recently I purchased AVRDragon.
Now I have an oportunity to work with JTAG and Dw, as well as old good ISP and eevn HVPP. However, I am scared by the lack of any gui tool to help me see what I do.
My AvrStudio (latest build, 498) will show "no supported board found" if I will try to select AVRProg from menus.
I can run commandline AVRDragon.exe with few params and read/write device using the same ISP as I did.
Anyway - Could someone help me, and perhaps the others, and let me see the user manual for AVRDragon? The only I found is help that comes with AVRStudio, but I found not even led colours description.
My primary point is to find some easy to use gui based programmer like PonyProg is, to use it with my new Dragon - just to keep the work comfortable.
For a newbies, as an tutorial, I guess it is very helpfull, even if experienced proffesional can write the flash directly from makefile. |
|
|
| |
|
|
|
|
|
Posted: Jan 09, 2007 - 11:45 AM |
|


Joined: Jan 23, 2004
Posts: 9888
Location: Trondheim, Norway
|
|
coro:
I could add in a small section as a FAQ question, however I think anything really in-depth would be outside the scope of this tutorial and in the realms of another, seperate tutorial.
However, using the Dragon is easy.
FOR DEBUGGING A PROJECT:
1) Connect Dragon to PC and target via JTAG/dW.
2) Open project ELF file with AVRStudio (or open existing project). Select as the platform the Dragon.
3) Follow prompts.
FOR PROGRAMMING:
1) Connect Dragon to PC and target via JTAG/dW.
2) From the Tools menu, chose the "Program AVR" submenu and click Connect...
3) Choose the Dragon from the platform list, click OK
4) Use GUI to program target
Note that AVRProg in AVRStudio is designed for AVR910 style programmers and bootloaders, while the Program AVR->Connect... is used to connect with the official ATMEL tools such as the STK500, Dragon et al.
- Dean  |
_________________ Atmel Studio 6.1 is now released, grab it here.
Report AS6/ASF bugs here.
|
| |
|
|
|
|
|
Posted: Jan 10, 2007 - 07:33 AM |
|

Joined: Dec 08, 2006
Posts: 47
Location: Slovakia
|
|
Thanks for the help,
I think that I should write the reason of my troubles here, to help others in case of the same issue.
There is no submenu "Program AVR" in AVRstudio at all,
until You will enable STK500 plugin from "Plugin manager".
If STK500 was enabled (even if I have nothing like
that kit), then, after exit and next AVRstudio
start, necesary submenu is there and runs with
AVRDragon without any problem in any mode You choose.
Edit to explain :
I have installed AVRstudio long time before my purchase of AVRDragon. Because I did use only simple parallel programer (74ls244) and PonyProg, I did disabled everything unused just to not waste memory and startup and project open time a looong time ago. After upgrade of AVRstudio, plugin setting probably remain unchanged.
Anyway, that could happen to anyone, and as I have never seen what I need, it was hard to search for.
As well, using google with "program AVR" is difficult because of milions of matches. |
Last edited by coro on Jan 10, 2007 - 12:05 PM; edited 1 time in total
|
| |
|
|
|
|
|
Posted: Jan 10, 2007 - 11:39 AM |
|

Joined: Dec 08, 2004
Posts: 4719
Location: Nova Scotia, Canada
|
|
| Interesting. The STK500 plugin comes automatically pre-enabled in every installation of AVR Studio I've ever performed. |
|
|
| |
|
|
|
|
|
Posted: Apr 07, 2008 - 12:02 PM |
|

Joined: Oct 20, 2007
Posts: 169
Location: Delhi (India)
|
|
| I was confused with all these terms and today I got my answers. Thanks Dean. I still have confusion not related to these but other terms ie. i2c, spi, parallel if you please explain it in just two three lines. I was googling but unable to catch the fundamental differences in these terms. |
|
|
| |
|
|
|
|
|
Posted: Apr 07, 2008 - 12:16 PM |
|


Joined: Jan 23, 2004
Posts: 9888
Location: Trondheim, Norway
|
|
Updated to include the DebugWire and PDI interfaces, and the SKT600/AVRONE programmers.
Quote:
I still have confusion not related to these but other terms ie. i2c, spi, parallel if you please explain it in just two three lines.
They're communication busses. I2C is a multi-master two wire bus, allowing several devices to connect to one another and send messages via the I2C protocol. SPI is a basic serial interface which has each device on the bus implement a special enable pin, so that a single master can talk to any one slave on the bus at the one time. "Parallel" can refer to many things but means several bits being transferred simultaneously over several wires for faster transfers.
- Dean  |
_________________ Atmel Studio 6.1 is now released, grab it here.
Report AS6/ASF bugs here.
|
| |
|
|
|
|
|
Posted: Sep 01, 2008 - 03:33 PM |
|

Joined: Apr 21, 2008
Posts: 12
|
|
hi, abcminiuser
how old are you? 19 years old?? is it true??
woooow ... interesting.. smart kid!!! |
|
|
| |
|
|
|
|
|
Posted: Sep 01, 2008 - 03:48 PM |
|


Joined: Jan 23, 2004
Posts: 9888
Location: Trondheim, Norway
|
|
Hi suriva,
Yep, 19 indeed! I don't think age matters much - it's all about passion and talent. At least, that's what I tell myself after yet another 5 hour debugging marathon for that one elusive bug that's been bothering me for weeks /
- Dean  |
_________________ Atmel Studio 6.1 is now released, grab it here.
Report AS6/ASF bugs here.
|
| |
|
|
|
|
|
Posted: Nov 09, 2008 - 04:58 PM |
|

Joined: Oct 03, 2008
Posts: 26
Location: Council Bluffs, Iowa
|
|
| If your fuses are set to an external clock, can you use a programmer, such as the AVRdragon, to supply the clock source through jtag? I have very limited knowledge and am trying to find the simplest way to reset a chip back to internal clock. |
|
|
| |
|
|
|
|
|
Posted: Nov 09, 2008 - 06:29 PM |
|


Joined: Jul 18, 2005
Posts: 62944
Location: (using avr-gcc in) Finchingfield, Essex, England
|
|
|
Quote:
If your fuses are set to an external clock, can you use a programmer, such as the AVRdragon, to supply the clock source through jtag? I have very limited knowledge and am trying to find the simplest way to reset a chip back to internal clock.
Not with the Dragon but certainly with an STK500 (which has an external clock generating circuit) you can produce the necessary "recovery square wave" for pumping into XTAL1. Apart from STK500 other methods are frequency generator, simply NE555 circuit, another AVR with a small program to toggle a port pin, another (of the modern!) AVRs with the CKOUT fuse set.
Cliff |
_________________
|
| |
|
|
|
|
|
Posted: Nov 26, 2008 - 07:39 AM |
|

Joined: Aug 08, 2008
Posts: 194
Location: Minnesota
|
|
| Thanks for this clear and concise summary! I have been searching for this type of info for a while ( looked in this section before and somehow missed it). |
|
|
| |
|
|
|
|
|
Posted: Jan 28, 2009 - 03:43 AM |
|

Joined: Jan 12, 2009
Posts: 19
|
|
|
Quote:
I guess it's appropriate to mention debugWire as a programming interface. But it should always be included with a huge caveat: Its limitations make it inappropriate to use as a general-purpose programmer for production purposes!
In order to get the chip back into a fully functional state, you must disable the debugWire fuse; In order to disable the debugWire fuse, you must have a full-up ISP connection (reset/sck/mosi/miso); All ICE units which support debugWire (Dragon, JTAGICE mkII) can also be used as general-purpose ISP programmers;
I have a Dragon board and can program my ATTiny85 using ISP without a problem.
But, when I attempt to debug code running on the HW I have to enable the debugWIRE interface (makes sense).
Once enabled all seems well until I attempt to reconnect to the Dragon board with my programmed and debugged chip in place.
At that time I can no longer connect to the chip to disable the debugWIRE interface, erase or reprogram the device.
This seems to be a "one way street", destructive debug method at least with this device?
What am I missing?
Turns out I was missing the later thread that explains the problem.
 |
|
|
| |
|
|
|
|
|
Posted: Feb 05, 2009 - 07:16 PM |
|

Joined: Jan 16, 2007
Posts: 124
|
|
Hey Everyone,
Dean mentioned having the AVR's pre-programmed. I am looking to order about 1000 ATTiny2313's in an MLF package, pre programmed with my software.
Does anyone know where I can get this done?
Thanks,
Dan |
|
|
| |
|
|
|
|
|
Posted: Jul 28, 2009 - 12:41 AM |
|

Joined: May 08, 2009
Posts: 6
Location: vancouver island, BC
|
|
Hey,
I have never programmed an avr before (used pics before) and am trying to use the stk500 to program an atmega644 which unfortunately is in-circuit on a PCB I have designed. I get the message "Entering Programming Mode..Failed". I have tried some of the things mentioned in other posts such as changing my ISP frequency to 4k, making sure my fuses and lock bits are correct (although the spi enable box is greyed out, i am not sure if its supposed to be like that). Another thing I think might be a cause of a problem is that on my PCB I have SPI IC's with active LO chip selects and these are set HI in code (when the avr is working) and so before the avr is programmed, the chip selects may become enabled (which is bad h/w design on my part) and might be causing SPI interference. I am also wondering if I have bad versions of firmware on the stk500 and should update that.
Any suggestions or things I should look for would be greatly appreciated because I am a little lost and want to start debugging my firmware!
Thanks, |
|
|
| |
|
|
|
|
|
Posted: Jul 28, 2009 - 10:04 AM |
|


Joined: Jul 18, 2005
Posts: 62944
Location: (using avr-gcc in) Finchingfield, Essex, England
|
|
|
Quote:
these are set HI in code (when the avr is working)
You need some 10K pull-ups on those _CS lines - should be possible to piggy-back these onto the current PCB?
The other common error is to get the layout of the 6/10 pin ISP header wrong. The pictures in the manual show it looking down from above.
Cliff |
_________________
|
| |
|
|
|
|
|
Posted: Jul 29, 2009 - 07:02 PM |
|

Joined: May 08, 2009
Posts: 6
Location: vancouver island, BC
|
|
Hey thanks for the help. But now I have more problems..
When I try to verify the signature, it only works at 4kHz, when I go above, nothing works and I get a "Failure" when I try and do anything. Why does this work at 4kHz and nothing higher? I am using an external clk (above 8Mhz) in my fuse bits. This doesnt work so well because you can only use isp above 5kHz. Can anyone help me out a little or help me narrow the area to troubleshoot. Could it be my xtal?
Thanks,
Kylee |
|
|
| |
|
|
|
|
|
Posted: Jul 29, 2009 - 07:04 PM |
|


Joined: Jul 18, 2005
Posts: 62944
Location: (using avr-gcc in) Finchingfield, Essex, England
|
|
|
Quote:
Why does this work at 4kHz and nothing higher?
Sounds like a ground/noise/cable length or similar problem |
_________________
|
| |
|
|
|
|
|