Author Topic: How to upload an AVR program into STK500 test board  (Read 5036 times)

Offline soccerdude

  • Single posting newcomer
  • *
  • Posts: 5
How to upload an AVR program into STK500 test board
« on: July 30, 2008, 12:13:15 am »
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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7594
    • My Best Post
Re: How to upload an AVR program into STK500 test board
« Reply #1 on: July 30, 2008, 04:46:08 am »
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.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
« Last Edit: July 30, 2008, 04:50:18 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline soccerdude

  • Single posting newcomer
  • *
  • Posts: 5
Re: How to upload an AVR program into STK500 test board
« Reply #2 on: July 30, 2008, 11:43:40 pm »
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.