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

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

Re: [avr-gcc-list] Setting pin to high in function instead of main, inst


From: Johannes Bauer
Subject: Re: [avr-gcc-list] Setting pin to high in function instead of main, instructions in main never run?
Date: Thu, 01 Mar 2012 15:24:02 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Thunderbird/3.1.15

On 01.03.2012 14:38, Richard Zetterberg wrote:

> Cory: No, setting PB0 to 1 in DDRB two times in main doesn't change
> anything. Doing "DDRB = 0xFF;" doesn't change anything. However, if I
> put that line of code inside the "turn_on_pb" function it works as
> expected.

Why don't you include the whole program assembly (i.e. after linking),
but only compile units? This would also show the startup code, where a
fault in setting up the stack pointer would be visible (i.e. would cause
the "call" to fail and therefore resetting the MCU instead of the
behavior you desire).

Best regards,
Joe



reply via email to

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