[Top][All Lists]

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

AW: [avr-gcc-list] Volatile "Word" registers

From: Peter Hierholzer
Subject: AW: [avr-gcc-list] Volatile "Word" registers
Date: Tue, 28 Oct 2003 08:49:07 +0100

> I saw this thread maybe a while back, but can't find references.. Is it
> "safe" in GCC to access 16-bit timer1 registers (OCR1A, etc.) as word-wide
> variables, or explicitly divide the operation into bytes.  I'm not worried
> about splitting accesses across an interrupt, etc. (this has to be managed
> either way), but I am worried about the compiler accessing the halves in
> proper order.  Looking at code, it *seems* to in the cases I see, but is
> this just happenstance or a feature of AVR-GCC?

Look in the avr-libc manual. There is a chapter in the FAQ: "Why do some
16-bit timer registers sometimes get trashed?"


reply via email to

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