avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] ATMega128, fuse bits, program optimisation, several q


From: Anton Erasmus
Subject: Re: [avr-gcc-list] ATMega128, fuse bits, program optimisation, several questions
Date: Sun, 05 Jun 2005 19:21:25 +0200

On 5 Jun 2005 at 11:04, Torsten Mohr wrote:

> Hi,
> 
> the fuse bits of the ATMega128 were (when i bought it):
> 
> low: 0xe1
> high: 0x99
> ext.: 0xfd
> 
> I only programed the ext. fuse bits to 0xff.  Is that ok?
> 
> Regarding the interpretation of the fuse bits i'm a bit unsure,
> is there a general rule about what is active / not-active?
> 
> One bit is called M103C, so i'd guess if it is TRUE (1) this
> means "yes, active" so to say in compatibility mode.  But
> looking through the documentation i think it has to be
> 0 to say "compatibility mode" enabled.

"True" is 0, when talking about the fuse bits. i.e. true when programmed, which
is 0.

> What about WDTON?  At the moment i have set it to 1.  I'd like
> to switch it off in the test program, is this possible that way?
> 
> To switch off the internal watchdog, is it sufficient to do this
> at startup:
> 
> WDTCR = 0x1f;
> WDTCR = 0x07;  // also tried 0x00 and 0x17
> 
> 
> To my understanding i also don't need to attach an external
> crystal or change any clock options at startup as the part will
> run from internal RC with 1 MHz.  Is that correct?
> 

Yes that is correct.

> The last time i compiled a program for an AVR was with gcc-2.95.2.
> 
> When compiling a test program for it, what optimisation level
> do i need to set?  I thought that at least -O2 is needed so that
> some asm statements won't get "optimised away".
> (I tried my test program with -Os, -O0 and -O2.)
> 

All optimisation levels should work with correctly written C. Although O3 is 
often not
the best (i.e smallest or fastest) on the AVR. Look at the .lst files to see 
what output is 
generated.

Regards
   Anton Erasmus
-- 
A J Erasmus





reply via email to

[Prev in Thread] Current Thread [Next in Thread]