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

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

Re: [avr-gcc-list] Re: optimizer removes volatile pin access code. why?


From: Paulo Marques
Subject: Re: [avr-gcc-list] Re: optimizer removes volatile pin access code. why?
Date: Tue, 03 Nov 2009 18:29:20 +0000
User-agent: Thunderbird 2.0.0.21 (X11/20090310)

Joerg Desch wrote:
> On Tue, 27 Oct 2009 20:17:46 +0100 (MET)
> address@hidden (Joerg Wunsch) wrote:
> [...]
>> However, the
>> optimized code will just toggle the pin for a single CPU cycles only,
>> while the pin will stay a little longer at high in the non-optimized
>> example.  So if your oscilloscope is too slow, you might not notice
>> the pin actually becoming high for one clock period.
> 
> Tektroniks TDS784 with 4GS/s ;-)

If the pin is set to input, toggling the port might be just turning on
the internal pull-up. This will change the output from 0 to 1, but at
the rate of charging the pin capacitance through the internal pull-up.

If the pulse lasts longer, you might be able to see it, but if it is too
short, it might not have enough time to charge the pin up to your
trigger level.

Just a thought,

-- 
Paulo Marques
Software Development Department - Grupo PIE, S.A.
Phone: +351 252 290600, Fax: +351 252 290601
Web: www.grupopie.com

"Reality continues to ruin my life." - Calvin.




reply via email to

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