ATmega162 Startup Code

Jul 28, 2003 3 Replies

I have to write some code for an ATmega162, a processor that I have never used before.



As the code is of medium complexity, I intend to write it in C. The GCC compiler thus seems a good choice, as I have used it extensively with H8s.



Does anybody know of the existence of/ would be kind enough to supply a "shell project" that could be used with GCC? What I mean by that is an empty "main()", but with necessary interrupt vectors, stack initialisation etc. prior to the execution of main().



I am not going to get the luxury of an ICE, I believe, so it is just to try to avoid the heartache of getting off first base with an unfamiliar architecture, instruction set etc.



Thanks in advance if anyone can help.



Andy G.


Andy,

Get yourself a copy of CodeVisionAVR from www.hpinfotech.ro . The full version isn't all that expensive (150 Euro = ~ $170), and it has support for your processor and almost all other AVR based products. It comes with a code generator wizard, where you select the options you want to use from your processor, and it will generate all startup code including skeleton interrupt service routines.

Rob

int main(void) { for(;;); return 0; }

avr-gcc performs all such initialisation for you, by default. Assuming you are on windows, download the WinAVR distribution. It has some example "projects". Look on .

John Devereux

Thanks, folks.

There seems to be plenty to keep me going at the AVR Freaks site.

Andy G.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required