[Top][All Lists]

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

Re: [avr-gcc-list] stumped by my ATmega48 (again)

From: David Breeze
Subject: Re: [avr-gcc-list] stumped by my ATmega48 (again)
Date: Fri, 05 Oct 2007 15:31:16 +0100

Your loop is almost certainly optimsed out of existence.


volatile int x;

>>> <address@hidden> 05 October 2007 15:23 >>>
On Oct 05, 2007, at 12:14 UTC, David Kelly wrote:

> When you return the CPU goes thru a crash reset, or something like  
> that, I haven't traced the code.
> Do something like this ...

OK, I tried this:

int main() {

        DDRB = 0xff;
        DDRC = 0x7f;
        DDRD = 0xff;

        PORTB = 0xFF;
        PORTC = 0x7F;
        PORTD = 0xFF;
        int x;
        while (1) {
        return 0;

..hoping that the busywork of incrementing x would keep the compiler
from stripping away the empty loop.  But the output still doesn't go

- Joe

Joe Strout -- address@hidden 
Strout Custom Solutions, LLC

AVR-GCC-list mailing list

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed.  If 
an addressing or transmission error has misdirected
this e-mail, please notify the author by replying to this e-mail.  If you are 
not the intended recipient you must not use, disclose, copy, print or rely on 
this e-mail.

Joy Mining Machinery Limited/P&H Minepro Services aims to prevent the 
propagation of viruses, but cannot guarantee that this email is virus free.  
You are advised to scan all attachments and open them at your own risk.

Joy Mining Machinery Limited/P&H Minepro Services may monitor outgoing and 
incoming e-mails and other telecommunications on its e-mail and 
telecommunication systems.
-Privacy - UK-

reply via email to

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