News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

How to upload an AVR program into STK500 test board

Started by soccerdude, July 30, 2008, 12:13:15 AM

Previous topic - Next topic

soccerdude

Hi,

I've written my C program and debugged it entirely.  Now, how do I upload it into an AVR STK500 board for testing?

Thanks

stahta01

#1
No idea, but I don't think this sub-forum is the right place to ask.

You might try this sub-forum, but no idea if anyone knows the answer; I suggest reading the AVR docs and looking at AVR sites.

http://forums.next.codeblocks.org/index.php/board,22.0.html

Generic Micro-controller programming directions
1. Connect programmer to computer
2. Connect/Plugin board/chip to/in programmer
3. Power on programmer
4. Run computer program that does programing
5. Power off programmer

Tim S
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

soccerdude

Thanks for the reply, Tim.  I think I figured out how to do it.

The problem is that you have to configure C::B for the right target.  By default, C::B has "debug" and "release" as targets but those targets do not necessarily match the ones your Makefile needs.

So, the first thing is to go through your Makefile and figure out what kind of target you need.  In my Makefile, the last two lines define the targets for PC and Mac, respectively:

program:
   avrdude -p $(AVRDUDE_TARGET) -c stk500v2 -P $(AVRDUDE_PORT_WIN) -e -U flash:w:$(PRG).hex
install: hex
   avrdude -p $(AVRDUDE_TARGET) -c stk500v2 -P $(AVRDUDE_PORT_MAC) -e -U flash:w:$(PRG).hex

Since I'm building for a PC i need to target "program":
1. Go to "Project" -> "Properties" -> "Project Settings"
2. Check the name of your Makefile (mine says "Makefile" ONLY, without specifying its home directory)
3. Select the box that says "This is a custom Makefile"
4. Go to the tab "Build targets" and on the list of targets ("Build" and "Release" should already be there) add a new target named "program"
5. Press OK
6. Back to the project window, make sure that the "Build target" drop-down menu is set to "program"
7. Build your project, and BINGO! watch the STK lights turn on as the AVR program is uploaded to your STK500, ready to be tested.