Searching \ for '[PIC]: Can I set a port bit equ to a variable???' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=port
Search entire site for: 'Can I set a port bit equ to a variable???'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Can I set a port bit equ to a variable???'
2002\01\29@124352 by Tim Webb

flavicon
face
why am I getting these errors?

Error[108]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 27 : Illegal character (,)
Error[108]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 28 : Illegal character (,)
Error[108]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 29 : Illegal character (,)
Error[128]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 66 : Missing argument(s)
Error[128]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 67 : Missing argument(s)
Error[128]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 98 : Missing argument(s)
Error[128]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 110 : Missing argument(s)
Error[128]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 117 : Missing argument(s)
Error[128]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 119 : Missing argument(s)


       Title  "test.asm"
;
;       Revision:  01/29/02
;
       list p=16f877,c=140    ; processor type
       errorlevel          1, -(305)
       #include "p16f877.inc"
;
;       Configuration Bits:
;
;               Oscillator           = HS
;               Watchdog Timer       = Off
;               Power Up Timer       = On
;               Code Protect         = Off
;               Brown Out Detect     = On
;               Low Voltage Program  = Disabled
;               Data EE Protect      = Off
;               Flash Program Write  = Enabled
;               Background Debug     = Disabled
;
;
DelayL  equ     0x20            ; delay register LOW byte
DelayM  equ     0x21            ; delay register MID byte
DelayH  equ     0x22            ; delay register HIGH byte

rw      equ     PORTA,0
rs      equ     PORTA,1
cs      equ     PORTA,2



Start
       bcf     STATUS, RP0     ; select bank 0

       clrf    PORTA           ; clear PORTA
       clrf    PORTB           ; clear PORTB
       clrf    PORTC           ; clear PORTC
       clrf    PORTD           ; clear PORTD
       clrf    PORTE           ; clear PORTE

       bsf     STATUS, RP0     ; select bank 1

       clrf    TRISA           ; set as outputs
       clrf    TRISB
       clrf    TRISC
       clrf    TRISD
       clrf    TRISE

       movlw   b'00000111'
       movwf   ADCON1          ; PORTA inputs = digital

     call      delay_250ms     ; startup stabilize delay

       call    init

       call    text

stop
       goto    stop



init

       bsf     rs
       bsf     cs

       movlw   0x38
       movwf   PORTD

       call    clk

       movlw   0x0c
       movwf   PORTD

       call    clk

       movlw   0x06
       movwf   PORTD

       call    clk

       movlw   0x01
       movwf   PORTD

       call    clk

       return

text

       movlw   0x80
       movwf   PORTD

       call    clk

       bsf     rs

       movlw   'H'
       movwf   PORTD

       call    clk

       movlw   'I'
       movwf   PORTD

       call    clk

       bcf     rs

       return

clk

       call    delay
       bcf     cs
       call    delay
       bsf     cs

       return


delay                   ; 250ms delay

       clrf    DelayL          ; Clear DelayL Register
       clrf    DelayM          ; Clear DelayM Register
       movlw   06h             ; Move literal 06h to W register
       movwf   DelayH          ; Move w register to DelayH register

Wait1
       decfsz  DelayL          ; Decrement 1 from DelayL Register, skip if
zero
       goto    Wait1           ; Not 0, continue loop
       decfsz  DelayM          ; Decrement 1 from DelayM Register, skip if
zero
       goto    Wait1           ; Not 0, continue loop
       decfsz  DelayH          ; Decrement 1 from DelayH Register, skip if
zero
       goto    Wait1           ; Not 0, continue loop

       return

       END

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\01\29@130831 by Dal Wheeler

flavicon
face
use instead:
#define rw PORTA,0
#define rs PORTA,1
#define cs PORTA,2

-Dal
----- Original Message -----
From: Tim Webb <spam_OUTtim_webbTakeThisOuTspamAGILENT.COM>
To: <.....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU>
Sent: Tuesday, January 29, 2002 10:41 AM
Subject: [PIC]: Can I set a port bit equ to a variable???


{Quote hidden}

[snip]

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\01\29@140253 by Bob Barr

flavicon
face
On Tue, 29 Jan 2002 10:41:55 -0700, Tim Webb <tim_webbspamKILLspamAGILENT.COM>
wrote:

>why am I getting these errors?
>
>Error[108]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 27 : Illegal character (,)
>Error[108]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 28 : Illegal character (,)
>Error[108]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 29 : Illegal character (,)
>Error[128]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 66 : Missing argument(s)
>Error[128]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 67 : Missing argument(s)
>Error[128]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 98 : Missing argument(s)
>Error[128]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 110 : Missing argument(s)
>Error[128]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 117 : Missing argument(s)
>Error[128]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 119 : Missing argument(s)
>
>

<snip>

>
>rw      equ     PORTA,0
>rs      equ     PORTA,1
>cs      equ     PORTA,2
>

You need to use '#define' to do a text substitution for the port name
and bit number. 'equ' is used to assign a single numeric value to a
mnemonic and can't handle two values as you're trying to do here. I
believe that the rest of the errors are caused by these errors.

Regards, Bob

<snip>

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\01\29@145738 by Bob Ammerman

picon face
unstead of :

rw    equ       PORTA,0

use:

#define rw PORTA,0

Bob Ammerman
RAm Systems


----- Original Message -----
From: "Dinho AeS" <.....agrjKILLspamspam.....AES.COM.BR>
To: <EraseMEPICLISTspam_OUTspamTakeThisOuTMITVMA.MIT.EDU>
Sent: Tuesday, January 29, 2002 9:56 AM
Subject: RES: [PIC]: Can I set a port bit equ to a variable???


Could you send only the lines between 100 and 130?

Otherwise I will have to count it.

thanks

-----Mensagem original-----
De: pic microcontroller discussion list [PICLISTspamspam_OUTMITVMA.MIT.EDU]
Em nome de Tim Webb
Enviada em: terga-feira, 29 de janeiro de 2002 15:42
Para: @spam@PICLISTKILLspamspamMITVMA.MIT.EDU
Assunto: [PIC]: Can I set a port bit equ to a variable???


why am I getting these errors?

Error[108]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 27 : Illegal character
(,)
Error[108]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 28 : Illegal character
(,)
Error[108]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 29 : Illegal character
(,)
Error[128]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 66 : Missing argument(s)
Error[128]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 67 : Missing argument(s)
Error[128]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 98 : Missing argument(s)
Error[128]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 110 : Missing
argument(s)
Error[128]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 117 : Missing
argument(s)
Error[128]   C:\PROGRA~1\MPLAB\ET53965\LCD2.ASM 119 : Missing
argument(s)


       Title  "test.asm"
;
;       Revision:  01/29/02
;
       list p=16f877,c=140    ; processor type
       errorlevel          1, -(305)
       #include "p16f877.inc"
;
;       Configuration Bits:
;
;               Oscillator           = HS
;               Watchdog Timer       = Off
;               Power Up Timer       = On
;               Code Protect         = Off
;               Brown Out Detect     = On
;               Low Voltage Program  = Disabled
;               Data EE Protect      = Off
;               Flash Program Write  = Enabled
;               Background Debug     = Disabled
;
;
DelayL  equ     0x20            ; delay register LOW byte
DelayM  equ     0x21            ; delay register MID byte
DelayH  equ     0x22            ; delay register HIGH byte

rw      equ     PORTA,0
rs      equ     PORTA,1
cs      equ     PORTA,2



Start
       bcf     STATUS, RP0     ; select bank 0

       clrf    PORTA           ; clear PORTA
       clrf    PORTB           ; clear PORTB
       clrf    PORTC           ; clear PORTC
       clrf    PORTD           ; clear PORTD
       clrf    PORTE           ; clear PORTE

       bsf     STATUS, RP0     ; select bank 1

       clrf    TRISA           ; set as outputs
       clrf    TRISB
       clrf    TRISC
       clrf    TRISD
       clrf    TRISE

       movlw   b'00000111'
       movwf   ADCON1          ; PORTA inputs = digital

     call      delay_250ms     ; startup stabilize delay

       call    init

       call    text

stop
       goto    stop



init

       bsf     rs
       bsf     cs

       movlw   0x38
       movwf   PORTD

       call    clk

       movlw   0x0c
       movwf   PORTD

       call    clk

       movlw   0x06
       movwf   PORTD

       call    clk

       movlw   0x01
       movwf   PORTD

       call    clk

       return

text

       movlw   0x80
       movwf   PORTD

       call    clk

       bsf     rs

       movlw   'H'
       movwf   PORTD

       call    clk

       movlw   'I'
       movwf   PORTD

       call    clk

       bcf     rs

       return

clk

       call    delay
       bcf     cs
       call    delay
       bsf     cs

       return


delay                   ; 250ms delay

       clrf    DelayL          ; Clear DelayL Register
       clrf    DelayM          ; Clear DelayM Register
       movlw   06h             ; Move literal 06h to W register
       movwf   DelayH          ; Move w register to DelayH register

Wait1
       decfsz  DelayL          ; Decrement 1 from DelayL Register, skip
if
zero
       goto    Wait1           ; Not 0, continue loop
       decfsz  DelayM          ; Decrement 1 from DelayM Register, skip
if
zero
       goto    Wait1           ; Not 0, continue loop
       decfsz  DelayH          ; Decrement 1 from DelayH Register, skip
if
zero
       goto    Wait1           ; Not 0, continue loop

       return

       END

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\01\30@042725 by dr. Imre Bartfai

flavicon
face
Hi,

I guess you should use dots instead of commas in the equates, e. g.

outbit equ      porta.1

I hope this helps
Regards,
Imre

+-----------------------------------------------------------------------+
| The information transmitted is intended only for the person or entity |
| to which it is addressed and may contain confidential and/or          |
| privileged material.  Any review, retransmission, dissemination or    |
| other use of, or taking of any action in reliance upon, this          |
| information by persons or entities other than the intended recipient  |
| is prohibited. If you received this in error, please contact the      |
| sender and delete the material from any computer.                     |
+-----------------------------------------------------------------------+

On Tue, 29 Jan 2002, Tim Webb wrote:

{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email KILLspamlistservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body


More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...