How to dump C code in Atmel Mega32

Asked by rupa

i have C code for transmission nd reception of data i have to use atmel megha32 how to dump that C code in this chip .....is there nt software which converts this C CODE TO ASSEMBLY language code understod by microcontroller ..if soo please kindly do mail mee

Question information

Language:
English Edit question
Status:
Answered
For:
SIAM32 Edit question
Assignee:
Christopher D. Leary Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Christopher D. Leary (cdleary) said :
#2

The siam32 project uses several open source applications to compile C code for the AVR and program an STK500 board. On a Debian-based system the following packages are required:

 * gcc-avr - Compiles C code into Atmel assembly.
 * avrdude - Programs the microcontroller's flash memory with a binary file.

After compiling and linking your source code with avr-gcc (used just like gcc), you end up with an (ELF format) object file. Use avr-objcopy to copy the text and data sections of the object file into Intel hex object with the following command:

avr-objcopy -j .text -j .data -O ihex a.out a.hex

This object format can be used to program the microcontroller using avrdude. The settings for avrdude are custom to your particular AVR microcontroller; i.e.

avrdude -v -p m32 -c stk500v2 -P /dev/ttyUSB0 -U flash:w:a.hex:i

And that's the basic idea. All of this is reflected in the project's Makefile -- if you download the Bazaar VCS and run:

bzr branch lp:siam32

from the command line, you will have a full copy of the current source code.

Hope that helped!

- Chris

Can you help with this problem?

Provide an answer of your own, or ask rupa for more information if necessary.

To post a message you must log in.