Re: Accessing general I/O addresses



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
.



Relevant Pages

  • Re: [patch -mm 20/20 RFC] chardev: GPIO for SCx200 & PC-8736x: add sysfs-GPIO interf
    ... We need a standard rep for GPIO in sysfs, ... GPIO hardware design appears to have 2 top-level factors; ... change will also exhibit in the port attr too. ... if a pin is output only, it shouldnt have an _output_enabled attr. ...
    (Linux-Kernel)
  • Re: OT: DOS programming EPP
    ... There seems to be *no* specifications or equivalent circuits for the parallel port as implemented on the ASICs used in modern PCs. ... it is completely unknown as to the maximum safe sink current to a logic low pin or the maximum source current from a logic high pin. ... The EPP page assumes you did. ... CONTROL bit 5 defaults low. ...
    (sci.electronics.design)
  • Re: PIC16F88, PORTA strange behaviour
    ... >> Setting an output low on PORTA, ... >> on PORTA to go low too. ... Try using a pin on port A and a pin on another port, ...
    (comp.arch.embedded)
  • Re: Any Plug and Play device shuts down PC
    ... Where 'X' represents each pin on the USB header. ... The only other thing that can be done is to adopt the way the rear port on ... if you used a wire ...
    (microsoft.public.windowsxp.hardware)
  • Re: PIC16F88, PORTA strange behaviour
    ... > Setting an output low on PORTA, ... > on PORTA to go low too. ... Are you doing this without delays in the inter-port pin state changes? ... Try using a pin on port A and a pin on another port, ...
    (comp.arch.embedded)