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

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

Re: [avr-gcc-list] Strange issues with 16-bit values


From: Bernard Fouché
Subject: Re: [avr-gcc-list] Strange issues with 16-bit values
Date: Tue, 11 Nov 2008 10:01:06 +0100
User-agent: Thunderbird 2.0.0.17 (Windows/20080914)

I had a quick look... a guess: since the interrupt handler is polling the counter that triggers the interrupt, the mcu may spend its whole time in the interrupt handler. Could you time the interrupt handler? Are you sure that the delay loop is really 'stuck'? I'd rather bet that it crawls because 32 bits calculations in the AVR are much slower than 8 bits calculations. If at the same time the main loop gets mcu time only once in a while, that would give the result you get (guessing again!). Also can't you hit overflow situations in the polling code? You perform 32 bits calculations when polling the 16 bits counter, I'm surprised that the compiler does not complain about these. Do you compile with -Wall ?

Regards,

   Bernard

Brian Neltner wrote:
Sorry, typo. I was giving example code, not a literal copy of my source.

[snip]




reply via email to

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