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: Bob Paddock
Subject: Re: [avr-gcc-list] Strange issues with 16-bit values
Date: Tue, 11 Nov 2008 14:58:24 -0500

> while(TCNT3<(uint16_t)benc_period*224UL/255);

One can never have to many parenthesise when
writing something like the above.

I did not look at your code so the following may not be relevant.

If you are having issues with 16-bit register values,
make sure that you are not accessing the same timer
from both inside *and* outside of the interrupt
concurrently.  Nor should you nest interrupts of the
same 16-bit timer (not likely you are doing this).
You will get corrupted values at very random intervals.
The problem is explained here:

http://www.atmel.com/dyn/resources/prod_documents/doc1493.pdf




reply via email to

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