gnupic@linuxhacker.org

gnupic@linuxhacker.org


Subject: Re: Using pins / ports
From: Scott Dattalo
Date: Fri, 25 Jan 2002 07:36:15 -0800 (PST)

On Fri, 25 Jan 2002, Christian Marschalek wrote:

> Hi all!
>
> How can I set just one pin with GPASM?
> And how can I use a port?
>
> I'm totaly stuck on this one ... :(


Christian,

   bsf PORTA, 2  ; set bit 2 on port A

   movwf  PORTA  ; write W to port A

gpasm handles I/O's just the same as MPASM.


If you're new to PIC's, I'd suggest reading data sheets, PICLIST FAQ's, or
Myke Predko's book to get familiar with the in's and out's of PIC's. gpsim
can also help by providing a convenient way to see how a program runs.

Scott


gnupic@linuxhacker.org