Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

Re: Finally, really, actually, starting off with C

Re: Finally, really, actually, starting off with C

2009-01-07 by Don Kinzer

>Why would I want to spend four bytes of RAM on that?
If your main() is in the form of an infinite loop and you're using a 
suitably high level of optimization (typically -Os is recommended), 
the code actually generated by the compiler doesn't waste any RAM or 
code space.

For example, if your main() looks like this:

int main(void)
{
  while(1)
  {
  }
  return(0);
}

The generated code will look something like this excerpt:
26a:	0e 94 3b 01 	call	0x276
26e:	0c 94 4e 48 	jmp	0x909c
00000276 <main>:
276:	ff cf       	rjmp	.-2

Leaving out the return statement (as is commonly done) produces the 
same result and no compiler warnings.

> Does C (or Winavr) init a declared variable to some
> defined state ALWAYS, or do I have to?
Simply stated, the C standard requires a compiler to initialize 
statically allocated variables to zero.  Consequently, if you define 
a variable outside of a function (or inside a function with the 
static attribute) it is guaranteed to be initialized to zero in the 
absence of an explicit initialization.  No such guarantee is made 
for dynamically allocated variables, i.e., those defined within a 
function but not having the static attribute.

Note that you can arrange for statically allocated variables to be 
uninitialized if you wish.  To do so, need to use the attribute 
__attribute__((section(".noinit"))).  This most conveniently done by 
defining a macro:

#define NO_INIT __attribute__((section(".noinit")))
...
int myUninitializedVar NO_INIT;

It used to be that the avr-gcc documentation recommended against 
explicit zero initialization of statically allocated variables, e.g.

int myVar = 0;

The reason for this recommendation was that the compiler treated 
such explicit zero initializations the same as explicit non-zero 
initializations, creating space in the initialization data area of 
Flash for the zero data.  Newer versions of avr-gcc detect explicit 
zero initialization and treat it the same as having specified no 
explicit initialization.  There is no longer a Flash size penalty 
for explicit zero initialization of variables.

Don Kinzer
ZBasic Microcontrollers
http://www.zbasic.net

Finally, really, actually, starting off with C

2009-01-07 by David VanHorn

Yes.. The world probably will end in 2012, brought about in no small
part by my conversion to C.

I bought an AVR-LIP kit from Deccan, and am using WINAVR to get going.

I have a few questions.

All their examples have main as returning an int.
Returning a value from main, in a microcontroller is nonsensical, isn't it?
Where would it return that to?
Why would I want to spend four bytes of RAM on that?


Declaring a variable:
Does C (or Winavr) init a declared variable to some defined state
ALWAYS, or do I have to?
I don't mind doing it, and I'm sure that's absolutely safe, but I
don't want to do un-necessary operations.
Would the compiler be smart enough to take out a redundant init of a
variable? (assuming right after declaration)


-- 

"The very powerful and the very stupid have one thing in common. Instead of
altering their views to fit the facts, they alter the facts to fit their
views... which can be very uncomfortable if you happen to be one of the
facts that needs altering." Doctor Who, Face of Evil

Re: [AVR-Chat] Finally, really, actually, starting off with C

2009-01-07 by wagnerj@proaxis.com

Welcome to the world of the "kicking and screaming". No, the world will
end in 2011.5 because I "converted" slightly before you.

'Tis my understanding that SOME compilers require the return statement.
IAR perhaps? My understanding is that gcc does not require it but
tolerates it.

As for variable initialization, I can't provide any information with any
confidence. My reference is the avr-libc documentation and the gas (gnu
assembler) documentation. For gcc tutorial, Smiley has a nice book out
with some of the chapters on line on his website.

Jim Wagner
Oregon Research Electronics
Show quoted textHide quoted text
> Yes.. The world probably will end in 2012, brought about in no small
> part by my conversion to C.
>
> I bought an AVR-LIP kit from Deccan, and am using WINAVR to get going.
>
> I have a few questions.
>
> All their examples have main as returning an int.
> Returning a value from main, in a microcontroller is nonsensical, isn't
> it?
> Where would it return that to?
> Why would I want to spend four bytes of RAM on that?
>
>
> Declaring a variable:
> Does C (or Winavr) init a declared variable to some defined state
> ALWAYS, or do I have to?
> I don't mind doing it, and I'm sure that's absolutely safe, but I
> don't want to do un-necessary operations.
> Would the compiler be smart enough to take out a redundant init of a
> variable? (assuming right after declaration)
>
>
> --
>
> "The very powerful and the very stupid have one thing in common. Instead
> of
> altering their views to fit the facts, they alter the facts to fit their
> views... which can be very uncomfortable if you happen to be one of the
> facts that needs altering." Doctor Who, Face of Evil
>

Re: [AVR-Chat] Finally, really, actually, starting off with C

2009-01-07 by dlc

David,


David VanHorn wrote:
> Yes.. The world probably will end in 2012, brought about in no small
> part by my conversion to C.
> 
> I bought an AVR-LIP kit from Deccan, and am using WINAVR to get going.
> 
> I have a few questions.
> 
> All their examples have main as returning an int.
> Returning a value from main, in a microcontroller is nonsensical, isn't it?
> Where would it return that to?
> Why would I want to spend four bytes of RAM on that?

   Welcome to GCC!  GCC is a "big iron" compiler front end and all 
programs written for full OS's require a return code for main().  AVR is 
a custom backend of the compiler so main must be of type int for 
compatibility reasons.

> 
> Declaring a variable:
> Does C (or Winavr) init a declared variable to some defined state
> ALWAYS, or do I have to?
> I don't mind doing it, and I'm sure that's absolutely safe, but I
> don't want to do un-necessary operations.
> Would the compiler be smart enough to take out a redundant init of a
> variable? (assuming right after declaration)

   Global and static variables will always be auto-initialized to zero 
(according to the docs I've read), you'll need to initialize locals 
yourself if you care about their initial state (which you should).  The 
compiler will not remove an unnecessary init.  You are correct, doing it 
yourself will use up code space.

DLC

> 

-- 
-------------------------------------------------
Dennis Clark          TTT Enterprises
www.techtoystoday.com
-------------------------------------------------

Re: [AVR-Chat] Finally, really, actually, starting off with C

2009-01-07 by Dave Hylands

Hi David,

>   Welcome to GCC!  GCC is a "big iron" compiler front end and all
> programs written for full OS's require a return code for main().  AVR is
> a custom backend of the compiler so main must be of type int for
> compatibility reasons.

Also, I highly recommend that you compile your code using -Wall. This
will cause the compiler to point out lots of little things that often
hangup the beginner.

Personally, I like my code to compile error and warning free with the
following set of compiler flags:

-Wall -Wimplicit -Wpointer-arith -Wredundant-decls -Wshadow -Wunused
-Wcast-qual -Wnested-externs -Wmissing-prototypes -Wstrict-prototypes
-Wmissing-declarations

I also often add -Werror which causes warnings to be treated as errors.

I see that there is a -Wextra as well. I'll have to play with that.

Documentation on all of the warning flags can be found over here:
<http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Warning-Options.html#Warning-Options>

Sometimes, figuring out the correct way to get rid of a warning can be
frustrating, but after you've been doing it foe a while it becomes
second nature.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.DaveHylands.com/

Re: [AVR-Chat] Finally, really, actually, starting off with C

2009-01-07 by Dave Hylands

Hi David,

> All their examples have main as returning an int.
> Returning a value from main, in a microcontroller is nonsensical, isn't it?
> Where would it return that to?
> Why would I want to spend four bytes of RAM on that?

You can declare main like this instead:

void main( void )
{
   ....
}

If you compile your code using the -ffreestanding option, then the
compiler won't complain that main doesn't return an int.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.DaveHylands.com/

Re: [AVR-Chat] Finally, really, actually, starting off with C

2009-01-07 by Roy E. Burrage

No, the world will not end in 2012, Dave ... or 2011.5, Jim.

Samperi and I'll hold a seat for you at the table when you're done with 
your excursions into crypticism.  Isn't that what "C" stands for, cryptic?


REB



wagnerj@proaxis.com wrote:
> Welcome to the world of the "kicking and screaming". No, the world will
> end in 2011.5 because I "converted" slightly before you.
>
> 'Tis my understanding that SOME compilers require the return statement.
> IAR perhaps? My understanding is that gcc does not require it but
> tolerates it.
>
> As for variable initialization, I can't provide any information with any
> confidence. My reference is the avr-libc documentation and the gas (gnu
> assembler) documentation. For gcc tutorial, Smiley has a nice book out
> with some of the chapters on line on his website.
>
> Jim Wagner
> Oregon Research Electronics
>
>   
>> Yes.. The world probably will end in 2012, brought about in no small
>> part by my conversion to C.
>>
>> I bought an AVR-LIP kit from Deccan, and am using WINAVR to get going.
>>
>> I have a few questions.
>>
>> All their examples have main as returning an int.
>> Returning a value from main, in a microcontroller is nonsensical, isn't
>> it?
>> Where would it return that to?
>> Why would I want to spend four bytes of RAM on that?
>>
>>
>> Declaring a variable:
>> Does C (or Winavr) init a declared variable to some defined state
>> ALWAYS, or do I have to?
>> I don't mind doing it, and I'm sure that's absolutely safe, but I
>> don't want to do un-necessary operations.
>> Would the compiler be smart enough to take out a redundant init of a
>> variable? (assuming right after declaration)
>>
>>
>> --
>>
>> "The very powerful and the very stupid have one thing in common. Instead
>> of
>> altering their views to fit the facts, they alter the facts to fit their
>> views... which can be very uncomfortable if you happen to be one of the
>> facts that needs altering." Doctor Who, Face of Evil
>>
>>     
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com 
> Version: 8.0.176 / Virus Database: 270.10.4/1880 - Release Date: 1/7/2009 8:49 AM
>
>   


[Non-text portions of this message have been removed]

Re: [AVR-Chat] Finally, really, actually, starting off with C

2009-01-07 by dlc

Thanks Dave, I'd never have found that compiler option!

DLC

Dave Hylands wrote:
> Hi David,
> 
>> All their examples have main as returning an int.
>> Returning a value from main, in a microcontroller is nonsensical, isn't it?
>> Where would it return that to?
>> Why would I want to spend four bytes of RAM on that?
> 
> You can declare main like this instead:
> 
> void main( void )
> {
>    ....
> }
> 
> If you compile your code using the -ffreestanding option, then the
> compiler won't complain that main doesn't return an int.
> 

-- 
-------------------------------------------------
Dennis Clark          TTT Enterprises
www.techtoystoday.com
-------------------------------------------------

Re: [AVR-Chat] Finally, really, actually, starting off with C

2009-01-07 by Dave Hylands

Hi David,

>> All their examples have main as returning an int.
>> Returning a value from main, in a microcontroller is nonsensical, isn't it?
>> Where would it return that to?
>> Why would I want to spend four bytes of RAM on that?
>
> You can declare main like this instead:
>
> void main( void )
> {
>   ....
> }
>
> If you compile your code using the -ffreestanding option, then the
> compiler won't complain that main doesn't return an int.

I see that -ffreestanding turns off the builtin functions (i.e.
-ffreestanding implies -fnobuiltin). I tried this combination:

-ffreestanding -fbuiltin

and this does in fact turn the builtin functions back on (at least
printf of a simple string becomes puts).

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.DaveHylands.com/

Re: [AVR-Chat] Finally, really, actually, starting off with C

2009-01-07 by David VanHorn

> You can declare main like this instead:
>
> void main( void )
> {
>   ....
> }
>
> If you compile your code using the -ffreestanding option, then the
> compiler won't complain that main doesn't return an int.

Ok, I'd already found that I can declare the return as void, but the
compiler does whine about it.
I'm ok with that, although I really do prefer to have no warnings or errors.

I'm definitely not ready to mess with makefiles yet, but I'll keep that in mind.

Re: [AVR-Chat] Finally, really, actually, starting off with C

2009-01-07 by David VanHorn

> As for variable initialization, I can't provide any information with any
> confidence. My reference is the avr-libc documentation and the gas (gnu
> assembler) documentation. For gcc tutorial, Smiley has a nice book out
> with some of the chapters on line on his website.

You see where I'm coming from.  :)  I don't want to waste the
space/cycles with needless inits, but I want to absolutely KNOW which
it is.
Small chips are not a place to waste cycles or bytes.

Re: [AVR-Chat] Finally, really, actually, starting off with C

2009-01-07 by dlc

I'm a Mac user <weathering the hisses and boos> so I don't have 
AVRStudio for my avr-gcc stuff.  I use Eclipse with the AVREclipse 
plugin for my dev environment.  I say all of this because the AVREclipse 
plugin builds the make file automagically like any other "hand-holding" 
IDE.  You do have control over your gcc compiler options however so the 
big deal is the auto makefile creation and a nice editor.  The plugin 
also supplies a nice device description tool that gives the port and 
register names and addresses and lists all of the IRQ sources and the 
GCC handles to use them.

The IDE has a "tools" section where I have avrdude configured so a 
program of a part is just a push of a "button".  Others have gotten GDB 
and Avarice working in the IDE as well, but I've not tried that - I 
don't use a programmer with debug capability, yet.

You can get Eclipse IDE for Windows too if that is your platform of 
choice, or Linux as well.  It works the same in all environments (JAVA 
based).

DLC

David VanHorn wrote:
>> You can declare main like this instead:
>>
>> void main( void )
>> {
>>   ....
>> }
>>
>> If you compile your code using the -ffreestanding option, then the
>> compiler won't complain that main doesn't return an int.
> 
> Ok, I'd already found that I can declare the return as void, but the
> compiler does whine about it.
> I'm ok with that, although I really do prefer to have no warnings or errors.
> 
> I'm definitely not ready to mess with makefiles yet, but I'll keep that in mind.
> 
> ------------------------------------
> 
> Yahoo! Groups Links
> 
> 
> 

-- 
-------------------------------------------------
Dennis Clark          TTT Enterprises
www.techtoystoday.com
-------------------------------------------------

Re: [AVR-Chat] Finally, really, actually, starting off with C

2009-01-07 by dlc

David VanHorn wrote:
>> As for variable initialization, I can't provide any information with any
>> confidence. My reference is the avr-libc documentation and the gas (gnu
>> assembler) documentation. For gcc tutorial, Smiley has a nice book out
>> with some of the chapters on line on his website.
> 
> You see where I'm coming from.  :)  I don't want to waste the
> space/cycles with needless inits, but I want to absolutely KNOW which
> it is.
> Small chips are not a place to waste cycles or bytes.

   GCC might be a rude surprise then!  There is an init section of code 
linked in that handles startup housekeeping that will take up several 
hundred bytes.  That is what handles the "int foo = 1;" stuff, so I 
don't think that is avoidable.  Of course it also handles setting up the 
call stack, DATA heap and all the rest of the stuff that goes into a 
high level language.  If you are coming from assembly programming it all 
looks pretty "dirty", but essential.

DLC

-- 
-------------------------------------------------
Dennis Clark          TTT Enterprises
www.techtoystoday.com
-------------------------------------------------

Re: [AVR-Chat] Finally, really, actually, starting off with C

2009-01-07 by David VanHorn

>   GCC might be a rude surprise then!  There is an init section of code
> linked in that handles startup housekeeping that will take up several
> hundred bytes.  That is what handles the "int foo = 1;" stuff, so I
> don't think that is avoidable.  Of course it also handles setting up the
> call stack, DATA heap and all the rest of the stuff that goes into a
> high level language.  If you are coming from assembly programming it all
> looks pretty "dirty", but essential.

Yea, some things are going to be unavoidable.  My main intention with
this is to learn C, specifically in GCC, but my ulterior motive if you
will, is to learn C for microcontrollers, so I picked up an AVR
package that had plenty of examples and tutorials specifically for
that hardware platform.

The company wants me more skilled with C so I can assist in low-level
debug as we bring up prototypes, (me being officially "the hardware
guy") but I also need to learn C for me, with an eye to using it on
small systems..

So, I'm trying not to loose sight of the small systems, but letting go
of what I must in order to get going in C.

RES: [AVR-Chat] Finally, really, actually, starting off with C

2009-01-07 by Alexandre GuimarĂ£es

Hi, Dave.
 
	Do you really need to use GCC ? Codevision is SO much more "user
friendly" for assembler programmers !! It was specifically conceived for
small targets and generates ( most of the time ) great code and when it does
not using assembly inside of it is very easy also.

	And for learning you could use the free-version that has a code size
limit. With Codevision you have access to all code generated and can change
the startup code at will... 

Best Regards,
Alexandre Guimaraes

Re: Finally, really, actually, starting off with C

2009-01-07 by Don Kinzer

--- In AVR-Chat@yahoogroups.com, "David VanHorn" <microbrix@...> 
wrote:
> He assures me that GCC does not init variables automatically.
If your question was specifically about statically allocated 
variables, then he knows not of what he speaks (at least in this 
regard).  If you weren't clear as to the storage class, he might 
have assumed that you were talking about dynamically allocated 
variables in which case he is right.

You can prove this easily with this small program:

int myVar1;
int myVar2;
int
main(void)
{
  myVar2 = myVar1 + 1;
  for(;;)
    ;
}

Compile and link this (for any AVR) and then go look at the .lss 
file.  If you follow the execution flow from address 0, you'll see 
it eventually get to some code that looks like that shown below 
before it gets to main().  If you follow the execution, you'll see 
it explicitly zeroing out the two statically defined variables.

0000009e <__do_clear_bss>:
  9e:	11 e0       	ldi	r17, 0x01
  a0:	a0 e0       	ldi	r26, 0x00
  a2:	b1 e0       	ldi	r27, 0x01
  a4:	01 c0       	rjmp	.+2

000000a6 <.do_clear_bss_loop>:
  a6:	1d 92       	st	X+, r1

000000a8 <.do_clear_bss_start>:
  a8:	a4 30       	cpi	r26, 0x04
  aa:	b1 07       	cpc	r27, r17
  ac:	e1 f7       	brne	.-8
  ae:	0e 94 5d 00 	call	0xba
  b2:	0c 94 67 00 	jmp	0xce

000000ba <main>:
  ba:	80 91 02 01 	lds	r24, 0x0102

Don Kinzer
ZBasic Microcontrollers
http://www.zbasic.net

Re: Finally, really, actually, starting off with C

2009-01-07 by Don Kinzer

The gcc compiler generates three distinct sections for RAM-based data 
whose names are .noinit, .bss and .data.  The .noinit section is for 
uninitialized data items.  The .bss section is for zero-initialized 
data items (BSS stands for Block Started by Symbol, a throwback to 
FORTRAN or even earlier days).  The .data section is for data items 
with non-zero initialization values.

After setting up the stack pointer (usually to the end of internal 
RAM), zeroes out the .bss section.  For the .data section, it copies a 
block of data from Flash (containing the initialization data) to the 
RAM section.  It does nothing at all to the .init section.

If needed, there is a means to inject code into various places of the 
startup sequence.  See the discussion of the .initN sections for more 
details.  In particular, see
http://www.nongnu.org/avr-libc/user-manual/mem_sections.html

Don Kinzer
ZBasic Microcontrollers
http://www.zbasic.net

Re: [AVR-Chat] Finally, really, actually, starting off with C

2009-01-07 by David VanHorn

>   Global and static variables will always be auto-initialized to zero
> (according to the docs I've read), you'll need to initialize locals
> yourself if you care about their initial state (which you should).  The
> compiler will not remove an unnecessary init.  You are correct, doing it
> yourself will use up code space.

While I was waiting, I asked one of the software guys here during lunch.
He assures me that GCC does not init variables automatically.
It allocates space for them, but does not init unless the init is
written by me into the declaration as:

char i=0;

I left my K+R at home..
Embedded C and the Atmel AVR says that "Global variables are TYPICALLY
(caps mine) cleared when main is started.

"typically" does not leave me with a warm fuzzy feeling....

Re: [AVR-Chat] Finally, really, actually, starting off with C

2009-01-07 by wagnerj@proaxis.com

Got a Mac, also, and I'd like to use AVREclipse instead of
WinAVR-AVRStudio/Windoze/VMWare but have been a bit afraid of it. Could I
contact you off-list for some guidance?

Jim Wagner
Show quoted textHide quoted text
> I'm a Mac user <weathering the hisses and boos> so I don't have
> AVRStudio for my avr-gcc stuff.  I use Eclipse with the AVREclipse
> plugin for my dev environment.  I say all of this because the AVREclipse
> plugin builds the make file automagically like any other "hand-holding"
> IDE.  You do have control over your gcc compiler options however so the
> big deal is the auto makefile creation and a nice editor.  The plugin
> also supplies a nice device description tool that gives the port and
> register names and addresses and lists all of the IRQ sources and the
> GCC handles to use them.
>
> The IDE has a "tools" section where I have avrdude configured so a
> program of a part is just a push of a "button".  Others have gotten GDB
> and Avarice working in the IDE as well, but I've not tried that - I
> don't use a programmer with debug capability, yet.
>
> You can get Eclipse IDE for Windows too if that is your platform of
> choice, or Linux as well.  It works the same in all environments (JAVA
> based).
>
> DLC
>
> David VanHorn wrote:
>>> You can declare main like this instead:
>>>
>>> void main( void )
>>> {
>>>   ....
>>> }
>>>
>>> If you compile your code using the -ffreestanding option, then the
>>> compiler won't complain that main doesn't return an int.
>>
>> Ok, I'd already found that I can declare the return as void, but the
>> compiler does whine about it.
>> I'm ok with that, although I really do prefer to have no warnings or
>> errors.
>>
>> I'm definitely not ready to mess with makefiles yet, but I'll keep that
>> in mind.
>>
>> ------------------------------------
>>
>> Yahoo! Groups Links
>>
>>
>>
>
> --
> -------------------------------------------------
> Dennis Clark          TTT Enterprises
> www.techtoystoday.com
> -------------------------------------------------
>

Re: [AVR-Chat] Re: Finally, really, actually, starting off with C

2009-01-07 by David VanHorn

> The generated code will look something like this excerpt:
> 26a:    0e 94 3b 01     call    0x276
> 26e:    0c 94 4e 48     jmp     0x909c
> 00000276 <main>:
> 276:    ff cf           rjmp    .-2
>
> Leaving out the return statement (as is commonly done) produces the
> same result and no compiler warnings.

One thing I want to get to ASAP is seeing the generated asm code!

>> Does C (or Winavr) init a declared variable to some
>> defined state ALWAYS, or do I have to?
> Simply stated, the C standard requires a compiler to initialize
> statically allocated variables to zero.  Consequently, if you define
> a variable outside of a function (or inside a function with the
> static attribute) it is guaranteed to be initialized to zero in the
> absence of an explicit initialization.  No such guarantee is made
> for dynamically allocated variables, i.e., those defined within a
> function but not having the static attribute.

Ok, that makes sense, but it conflicts with other input I've been given.

I do understand that it is always safe if I manually init the
variables, and that might be "best practice" on an unconstrained or
lightly constrained system, but I want to definitely know one way or
the other what's happening under the hood.

In ASM, I typically pave all SRAM to 0 just before launching main. I
figure that this will at least start me in a known state, and either
allow things to work (99-> 100% of the time), or break 100% of the
time, as opposed to having ram contain random data.


>There is no longer a Flash size penalty for explicit zero initialization of variables.

Ok, and I like that, but that's compiler-specific.

Given that I'm just starting out, I'm trying to be very careful on
what I accept as "True"

Re: RES: [AVR-Chat] Finally, really, actually, starting off with C

2009-01-07 by David Kelly

On Wed, Jan 07, 2009 at 04:15:40PM -0200, Alexandre Guimar?es wrote:
> Hi, Dave.
>  
> 	Do you really need to use GCC ? Codevision is SO much more "user
> friendly" for assembler programmers !! It was specifically conceived
> for small targets and generates ( most of the time ) great code and
> when it does not using assembly inside of it is very easy also.

But avr-gcc doesn't try to hold your hand as much as CV. CV tries too
hard to be "friendly".

IMO the only thing avr-gcc is weak at is controlling whether data lands
in "program" space or RAM. 

-- 
David Kelly N4HHE, dkelly@HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.

Re: [AVR-Chat] Finally, really, actually, starting off with C

2009-01-07 by dlc

You bet.  It really isn't very difficult.  If you get "Servo Magazine" 
you'll find a couple of articles that I wrote in the "Mr. Roboto" column 
about how to do this in the August and September 2008 issues.

DLC

wagnerj@proaxis.com wrote:
> Got a Mac, also, and I'd like to use AVREclipse instead of
> WinAVR-AVRStudio/Windoze/VMWare but have been a bit afraid of it. Could I
> contact you off-list for some guidance?
> 
> Jim Wagner
> 
>> I'm a Mac user <weathering the hisses and boos> so I don't have
>> AVRStudio for my avr-gcc stuff.  I use Eclipse with the AVREclipse
>> plugin for my dev environment.  I say all of this because the AVREclipse
>> plugin builds the make file automagically like any other "hand-holding"
>> IDE.  You do have control over your gcc compiler options however so the
>> big deal is the auto makefile creation and a nice editor.  The plugin
>> also supplies a nice device description tool that gives the port and
>> register names and addresses and lists all of the IRQ sources and the
>> GCC handles to use them.
>>
>> The IDE has a "tools" section where I have avrdude configured so a
>> program of a part is just a push of a "button".  Others have gotten GDB
>> and Avarice working in the IDE as well, but I've not tried that - I
>> don't use a programmer with debug capability, yet.
>>
>> You can get Eclipse IDE for Windows too if that is your platform of
>> choice, or Linux as well.  It works the same in all environments (JAVA
>> based).
>>
>> DLC
>>
>> David VanHorn wrote:
>>>> You can declare main like this instead:
>>>>
>>>> void main( void )
>>>> {
>>>>   ....
>>>> }
>>>>
>>>> If you compile your code using the -ffreestanding option, then the
>>>> compiler won't complain that main doesn't return an int.
>>> Ok, I'd already found that I can declare the return as void, but the
>>> compiler does whine about it.
>>> I'm ok with that, although I really do prefer to have no warnings or
>>> errors.
>>>
>>> I'm definitely not ready to mess with makefiles yet, but I'll keep that
>>> in mind.
>>>
>>> ------------------------------------
>>>
>>> Yahoo! Groups Links
>>>
>>>
>>>
>> --
>> -------------------------------------------------
>> Dennis Clark          TTT Enterprises
>> www.techtoystoday.com
>> -------------------------------------------------
>>
> 
> 
> 
> ------------------------------------
> 
> Yahoo! Groups Links
> 
> 
> 

-- 
-------------------------------------------------
Dennis Clark          TTT Enterprises
www.techtoystoday.com
-------------------------------------------------

Re: [AVR-Chat] Finally, really, actually, starting off with C

2009-01-09 by Kathy Quinlan

David VanHorn wrote:
>
> Yes.. The world probably will end in 2012, brought about in no small
> part by my conversion to C.
>
Hi Dave,

Sorry but I have already bookmarked the world to end in 2009 ;)

Hope you have fun in C :)

Regards,

Kat.

Re: [AVR-Chat] Finally, really, actually, starting off with C

2009-01-09 by Zack Widup

It's gotta go at least to 2112 ... after all, Rush already did an album
about that year!

Zack

On Fri, Jan 9, 2009 at 2:34 AM, Kathy Quinlan <kaqdialup@iinet.net.au>wrote:

>    David VanHorn wrote:
> >
> > Yes.. The world probably will end in 2012, brought about in no small
> > part by my conversion to C.
> >
> Hi Dave,
>
> Sorry but I have already bookmarked the world to end in 2009 ;)
>
> Hope you have fun in C :)
>
> Regards,
>
> Kat.
>
> 
>


[Non-text portions of this message have been removed]

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.