ATmega162 Startup Code

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
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.

Re: ATmega162 Startup Code
Quoted text here. Click to load it

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



Re: ATmega162 Startup Code
snipped-for-privacy@operamail.com (Andy G) writes:

Quoted text here. Click to load it


int main(void)
{
   <your code here>
   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 <www.avrfreaks.com>.


--

John Devereux

Re: ATmega162 Startup Code
Thanks, folks.

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

Andy G.

Site Timeline