[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] RFC: avr/bits.h
From: |
Mike Murphree |
Subject: |
Re: [avr-libc-dev] RFC: avr/bits.h |
Date: |
Tue, 1 Mar 2005 16:10:09 -0600 (CST) |
Joerg Wunsch said:
> As Nicolas Schodet wrote:
>
>> The interrupt flag bit is read as 1, and writen at 1, this clear the
>> interrupt bit! A warning could be added to the manual.
>
> There's a paragraph in the FAQ that explains why interrupt flags are
> written as 1 (in short: so that you *don't* need to use read-modify-
> write operations but can write your 1-bit directly). If you want to
> improve on this description, please tell us so. Obviously, that will
> only work for IO registers that are dedicated for interrupt flag bits,
> so in the TWCR case, you have to keep a copy of the remaining bits (that
> are not related to the interrupt) elsewhere.
I've always referred to these as bit clears when creating an interrupt
register or equivalent for a FPGA design. It's simple and it guarantees
that the programmer doesn't clear anything that he didn't mean to...
Mike
Re: [avr-libc-dev] RFC: avr/bits.h, Dave Hylands, 2005/03/01
Re: [avr-libc-dev] RFC: avr/bits.h, Joerg Wunsch, 2005/03/01
Re: [avr-libc-dev] RFC: avr/bits.h, Nicolas Schodet, 2005/03/01
[avr-libc-dev] Addition of a vprintf macro in stdio.h ..? or rather a function ..?, Björn Haase, 2005/03/06
Re: [avr-libc-dev] Addition of a vprintf macro in stdio.h ..? or rather a function ..?, Joerg Wunsch, 2005/03/09
Re: [avr-libc-dev] RFC: avr/bits.h, E. Weddington, 2005/03/01