Re: Accessing general I/O addresses
- From: Thad Smith <ThadSmith@xxxxxxx>
- Date: Thu, 27 Dec 2007 13:27:46 -0700
ssylee wrote:
On Dec 26, 11:40 pm, Tim Wescott <t...@xxxxxxxxxxxxxxxx> wrote:
You cannot address individual pins directly -- you have to read or write
the whole port. If you want a means of 'virtually' writing to single
pins you have to cook it up yourself, or find someone's method.
Generally the methods I've seen store a port address and offset to get to
the pin, then have some means of guaranteeing reentrancy, at least on a
system that supports multiple threads.
--
Tim Wescott
Please do not quote tag lines.
I also agree that Google is not a good newsgroup reader. So you're
suggesting that I have to go something like:
PORTA = PORTA or action;, where action is whatever action that I do
only to the pin desired?
You can do that. You can also use a pointer to the appropriate type (see the header file declaration for PORTA) if you want to use that instead of a fixed port. Also, for outputs, the latch ports are better, when available (should be on PIC18F2620).
--
Thad
.
- References:
- Accessing general I/O addresses
- From: ssylee
- Re: Accessing general I/O addresses
- From: Tim Wescott
- Re: Accessing general I/O addresses
- From: ssylee
- Accessing general I/O addresses
- Prev by Date: Re: Velocity measurement
- Next by Date: Re: Accessing general I/O addresses
- Previous by thread: Re: Accessing general I/O addresses
- Next by thread: Re: Accessing general I/O addresses
- Index(es):
Relevant Pages
|