[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Bit-wise structure and unions
From: |
Royce Pereira |
Subject: |
Re: [avr-gcc-list] Bit-wise structure and unions |
Date: |
Thu, 23 Nov 2006 14:40:01 +0530 |
User-agent: |
Opera Mail/9.02 (Win32) |
Hi,
On Wed, 22 Nov 2006 23:14:21 +0530, kitts <address@hidden> wrote:
> On Wednesday 22 November 2006 05:57 IST, David Kelly wrote:
>> Some MCU families (believe HC12 is one) have a separate register for
>> reading the port's actual input/external value, and another for
>> reading output latches containing the value last written. A bitfield
>> works fine on the output latch register.
>
> Is this not how it is with the AVR as well? We write into the PORTx register
> but read pin states from the PINx registers.
Sometimes it is required to read the PORT(latch) contents too, in output
mode,to check the status of the output, or to modify only some port bits,
without changing the others. The PINx register is read when the bit is an input.
--Royce.
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/