Re: [avr-gcc-list] Blink period shorter than expected

2013-12-01 Thread John Gallagher
Are you compiling with -O1 or similar? I believe that some level of optimization must be specified at compile time in order for _delay_ms() to operate correctly. See http://www.nongnu.org/avr-libc/user-manual/group__util__delay.html -John On Sun, Dec 1, 2013 at 11:41 AM, dfx wrote: > I made a

Re: [avr-gcc-list] Simple but wrong code

2014-01-14 Thread John Gallagher
I am not sure what your problem is, but looking briefly over your code I wouldn't be surprised if it is due to using delays inside your ISRs. This is generally considered a very bad idea, since it can create all sorts of concurrency / blocking problems. The way people generally handle a case like

Re: [avr-gcc-list] Simple but wrong code

2014-01-14 Thread John Gallagher
es of interrupt (serial ports, > counters, display) that could obscure the problem. > > I only wanted to reduce to a minimum both the hardware and the software. > > But I have not yet found the solution! > > Thanks anyway for the suggestions. > Domenico > > John Gallagher ha s